Skip to content

Commit

Permalink
Infra: update Yarn scripts (#579)
Browse files Browse the repository at this point in the history
* fix(infra): update Yarn scripts

- Remove unnecessary extract-storybook scripts; they are deprecated and
  breaking the deployed builds. Adding the `storyStoreV7` feature back
  into the config accomplishes the same task
- Visually separate groups of scripts for easier locating
- Group the WC and React scripts together
- Rename the scripts to more consistent names; **take note of these**
- Add `watch:tsc` to the dev scripts so that component file changes
  reflect immediately in Storybook while developing

Also bumped dependencies

* chore(infra): refresh yarn.lock

* fix(infra): update Chromatic workflow command

* fix(infra): update babel plugin name

* fix(lint): update TS syntax

* Revert "chore(infra): refresh yarn.lock"

This reverts commit 4bd67ec.

* fix(infra): revert and fix deps and config
  • Loading branch information
daneah authored Aug 7, 2023
1 parent c1873e3 commit ac4af52
Show file tree
Hide file tree
Showing 4 changed files with 397 additions and 381 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: yarn storybook:setup

- name: Build Storybook
run: yarn build-storybook:wc
run: yarn storybook:wc:build

- name: Publish to Chromatic
uses: chromaui/action@v1
Expand Down
3 changes: 3 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const config = {
'@storybook/addon-essentials',
'@storybook/addon-links',
],
features: {
storyStoreV7: true,
},
docs: {
autodocs: true,
},
Expand Down
46 changes: 26 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,46 @@
"build:tokens": "yarn workspace @ithaka/pharos build:tokens",
"analyze": "yarn workspace @ithaka/pharos analyze",
"format": "prettier packages/* --write",

"lint": "yarn lint:lit-analyzer && yarn lint:eslint && yarn lint:styles && yarn lint:icons",
"lint:eslint": "eslint 'packages/**/*.{ts,tsx,mdx,js,jsx,mjs}'",
"lint:lit-analyzer": "lit-analyzer 'packages/*/src/**/!(*.css|*.test).ts' --strict --rules.no-missing-import off --rules.no-unknown-tag-name off",
"lint:styles": "stylelint 'packages/**/*.{scss,css}'",
"lint:icons": "svglint --ci packages/pharos/assets/icons/*.svg",

"test": "yarn workspace @ithaka/pharos test",
"test:cli": "yarn workspace @ithaka/pharos-cli test",
"watch:tsc": "yarn workspace @ithaka/pharos build:tsc:watch",
"watch:styles": "yarn workspace @ithaka/pharos build:styles:watch",
"build:core": "yarn workspace @ithaka/pharos build",

"storybook:build": "yarn storybook:setup && yarn storybook:react:build && yarn storybook:wc:build && yarn storybook:main:build",
"storybook:setup": "yarn build:core",

"prestorybook:wc": "yarn storybook:setup",
"storybook:wc": "yarn storybook:wc:start",
"storybook:wc:start": "storybook dev -c .storybook/wc -p 9000",
"prestorybook:wc:dev": "yarn storybook:setup",
"storybook:wc:dev": "concurrently \"yarn:storybook:wc:start\" \"yarn:watch:styles\" --raw --kill-others",
"storybook:wc:dev": "concurrently \"yarn:storybook:wc:start\" \"yarn:watch:tsc\" \"yarn:watch:styles\" --raw --kill-others",
"storybook:wc:build": "storybook build -c .storybook/wc -o .storybook-static/wc",

"prestorybook:react": "yarn storybook:setup",
"storybook:react": "yarn storybook:react:start",
"storybook:react:start": "storybook dev -c .storybook/react -p 9001",
"prestorybook:react:dev": "yarn storybook:setup",
"storybook:react:dev": "concurrently \"yarn:storybook:react:start\" \"yarn:watch:styles\" --raw --kill-others",
"storybook:react:dev": "concurrently \"yarn:storybook:react:start\" \"yarn:watch:tsc\" \"yarn:watch:styles\" --raw --kill-others",
"storybook:react:build": "storybook build -c .storybook/react -o .storybook-static/react",

"storybook:main:dev": "storybook dev -c .storybook/main -p 9002",
"build-storybook:react": "storybook build -c .storybook/react -o .storybook-static/react",
"build-storybook:wc": "storybook build -c .storybook/wc -o .storybook-static/wc",
"build-storybook:main": "storybook build -c .storybook/main -o .storybook-static/main",
"build-storybook": "yarn storybook:setup && yarn build-storybook:react && yarn build-storybook:wc && yarn build-storybook:main && yarn extract-storybook:wc && yarn extract-storybook:react",
"extract-storybook:wc": "storybook extract .storybook-static/wc",
"extract-storybook:react": "storybook extract .storybook-static/react",
"storybook:main:build": "storybook build -c .storybook/main -o .storybook-static/main",

"presite:build": "yarn build:core",
"site:build": "yarn workspace @ithaka/pharos-site build",
"presite:develop": "yarn build:core",
"site:develop": "yarn workspace @ithaka/pharos-site develop",
"site:serve": "yarn workspace @ithaka/pharos-site serve",
"site:clean": "yarn workspace @ithaka/pharos-site clean",

"release": "changeset publish",
"prepare": "husky install"
},
Expand All @@ -67,16 +73,16 @@
"@commitlint/config-conventional": "^15.0.0",
"@emotion/babel-plugin": "^11.9.2",
"@size-limit/preset-small-lib": "^7.0.4",
"@storybook/addon-a11y": "^7.2.0",
"@storybook/addon-essentials": "^7.2.0",
"@storybook/addon-links": "^7.2.0",
"@storybook/addon-styling": "^1.3.2",
"@storybook/blocks": "^7.2.0",
"@storybook/manager-api": "^7.2.0",
"@storybook/react-vite": "^7.2.0",
"@storybook/theming": "^7.2.0",
"@storybook/web-components": "^7.2.0",
"@storybook/web-components-vite": "^7.2.0",
"@storybook/addon-a11y": "^7.2.1",
"@storybook/addon-essentials": "^7.2.1",
"@storybook/addon-links": "^7.2.1",
"@storybook/addon-styling": "^1.3.5",
"@storybook/blocks": "^7.2.1",
"@storybook/manager-api": "^7.2.1",
"@storybook/react-vite": "^7.2.1",
"@storybook/theming": "^7.2.1",
"@storybook/web-components": "^7.2.1",
"@storybook/web-components-vite": "^7.2.1",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
Expand All @@ -92,7 +98,7 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.12",
"eslint-plugin-storybook": "^0.6.13",
"eslint-plugin-wc": "^1.3.2",
"husky": "^7.0.0",
"lint-staged": "^12.0.2",
Expand All @@ -109,7 +115,7 @@
"react-dom": "^17.0.0",
"sass": "^1.63.6",
"size-limit": "^7.0.4",
"storybook": "^7.2.0",
"storybook": "^7.2.1",
"stylelint": "^15.10.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard-scss": "^10.0.0",
Expand Down
Loading

0 comments on commit ac4af52

Please sign in to comment.