-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add spindle hooks pkg #359
Conversation
"react": "^16.8.0 || ^17.0.0" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spindle-uiからコピーしたものの中から不要なものを削除しました
storybook, reg-suit, firebase, style周りのdepsを消しています
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useCarouselの動きを確認するときにstorybookとfirebaseはあった方が良さそうなので入れちゃいます
reg-suitは迷っていますが動きの確認が中心になるのでなくても良いかなと思っています
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b1f24c9
storybook追加してみました
設定はほとんどspindle-uiと同じです
@@ -0,0 +1,21 @@ | |||
MIT License |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
licenseはspindle-uiのままです
"files": [ | ||
{ | ||
"path": "./dist/**/*.js", | ||
"maxSize": "1 kB" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
仮で1kbにしています
@@ -0,0 +1,57 @@ | |||
# Spindle Hooks (In development) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
別途改善します
#175 を参考にESM考慮した方が良さそう |
831a58f
to
3dd5083
Compare
@@ -0,0 +1,5 @@ | |||
import { useSample } from './useSample'; | |||
|
|||
test('useSample', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
3dd5083
to
9f40fe9
Compare
packages/spindle-hooks/package.json
Outdated
"main": "./dist/index.mjs", | ||
"exports": "./dist/index.mjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cjsはないので"module"と区別していません。
exportsは指定されたパス以外でimportできないように制限できるようです:eyes:
https://shisama.hatenablog.com/entry/2020/12/21/090000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かにhooksの新しいパッケージだしesm onlyで配信しても良さそうっすね。
あとこの辺も参考にやっておいた方がいいのかな.
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a3d982d
一応enginesだけ設定しました:pray:
"type": "module"
はjestが動かないので設定していないです
Visit the preview URL for this PR (updated for commit 4d0e04d): https://ameba-spindle-hooks--pr359-feat-add-spindle-hoo-7ed0ffcm.web.app (expires Sun, 15 May 2022 09:04:44 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
b1f24c9
to
51e6f87
Compare
https://ameba-spindle-hooks--pr359-feat-add-spindle-hoo-7ed0ffcm.web.app/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eb52726
to
ed2ecfd
Compare
commitまとめたのでprereleaseしてみます |
c186003
to
17c7221
Compare
✨✨ That's perfect, there is no visual difference! ✨✨ Check out the report here. |
ea51831
to
28eb9df
Compare
23c6b5a
to
a1c93fc
Compare
a1c93fc
to
bed6014
Compare
82c3112
to
4f28736
Compare
- @openameba/spindle-hooks@0.0.1-alpha.0
- @openameba/spindle-hooks@0.0.1-alpha.1
- @openameba/spindle-hooks@0.0.1-alpha.2
4f28736
to
8a2e694
Compare
- @openameba/spindle-hooks@0.0.1-alpha.2
- @openameba/spindle-hooks@0.0.1-alpha.3
chore(release): publish
"prebuild": "yarn clean", | ||
"build": "run-s build:esm build:cjs", | ||
"build:cjs": "tsc -p tsconfig.cjs.json", | ||
"build:esm": "run-s build:esm:js build:esm:rename", | ||
"build:esm:js": "tsc -p tsconfig.esm.json", | ||
"build:esm:rename": "npx renamer --find js --replace mjs 'dist/**'", | ||
"prepublishOnly": "yarn build && yarn cp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herablog
この辺りだけspindle-uiに合わせてbundle作るように修正したのでざっと確認お願いします:pray:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q. そういえば配信方法変更したのは、どこがうまく動かなかったんだっけか..!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybookがうまく動かずで変更しました!
type: "module"
(内部でimport { Hoge } from "./mod.js"
みたいに読み込んでいるケース) の場合にESMが動かなかっただけなのでmjs
だけ配信して、cjsは配信しなくても良いかもです
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こりと同じ問題て感じかな..!?
storybookjs/storybook#9854 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
それです!リンク貼り忘れてましたすみません、、:pray:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
いえいえ〜そのうち対応進みそうな気もするけど、タイミングがむずかしいね:pien_2:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
難しいですね、、
他にもjestとかもまだexperimentalだったりするのでもあと少しという感じですかね、、
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ですよね〜いろんなアプリケーションから使われる性質を考えると、修正してもらった方針でいきましょうか!
[MEMO] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@openameba/spindle-hooks
のpackageを追加しました。spindle-ui
からコピーしてきたファイルの中から不要なものを削除しました。