-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: uncache stories before extracting them (#828) * ✨ add fetching env support for storybook v7+ (#827) * feat: add fetching env support for storybook v7+ * chore: lint using --fix * fix: evalStorybookEnvironmentInfo * feat: update package.json and lockfile for storybook v7 * fix: convert start-storybook to storybook dev * fix: add framework option to storybook config * feat: update babel and package config to node 16 * feat: update github actions to use node 16 * chore: lint fix * feat: add storybook-v6 to support start-storybook and build-storybook binaries * wip: use storybook 6 as default * fix: make storybook6 default, and keep storybook7 separate * fix: inherit stdio to run tests * fix: support storybook6 tests * wip: add flag support for switching between storybook v6 <> v7 tests * fix: build storybook command in pretest * wip: add utils and support for storybook v7 tests only * test: fix case where storybook had not loaded yet for live url testing * wip: run storybook6 tests by default * fix: change babel build target version to 14 * feat: add storybook v6 and v7 test workflows, also remove default test workflow * feat: downgrade node 16 to node 14 in github workflows and package json engine * feat: upgrade node 14 to 16 for lint and release workflows, since they run yarn in their workflows * chore: update yarn.lock as per storybook v7, node 16 * fix: pin action sha, use inputs.branch and use yarn test in v6 * fix: check if error exists before checking for message attribute * docs: add and update `Development` section in readme * chore: add EOF
- Loading branch information
Showing
15 changed files
with
2,882 additions
and
5,470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Test | ||
on: | ||
push: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
required: false | ||
type: string | ||
default: master | ||
jobs: | ||
test: | ||
name: Test Storybook v6 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [14] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions-ecosystem/action-regex-match@9e6c4fb3d5e898f505be7a1fb6e7b0a278f6665b | ||
id: regex-match | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
with: | ||
text: ${{ inputs.branch }} | ||
regex: '^[a-zA-Z0-9_/\-]+$' | ||
- name: Break on invalid branch name | ||
run: exit 1 | ||
if: ${{ github.event_name == 'workflow_dispatch' && steps.regex-match.outputs && steps.regex-match.outputs.match == '' }} | ||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: ./prepare-storybook-v6-tests.sh | ||
- uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}/node-${{ matrix.node }}/${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}/node-${{ matrix.node }}/ | ||
- run: yarn | ||
env: | ||
PERCY_POSTINSTALL_BROWSER: true | ||
- run: yarn build | ||
- name: Set up @percy/cli from git | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
run: | | ||
cd /tmp | ||
git clone --branch ${{ inputs.branch }} --depth 1 https://github.com/percy/cli | ||
cd cli | ||
PERCY_PACKAGES=`find packages -type d -mindepth 1 -maxdepth 1 | sed -e 's/packages/@percy/g' | tr '\n' ' '` | ||
echo "Packages: $PERCY_PACKAGES" | ||
git log -1 | ||
yarn | ||
yarn build | ||
yarn global:link | ||
cd ${{ github.workspace }} | ||
yarn link `echo $PERCY_PACKAGES` | ||
npx percy --version | ||
- run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "@percy/storybook", | ||
"version": "4.3.7", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/percy/percy-storybook.git" | ||
}, | ||
"engine": { | ||
"node": ">=14" | ||
}, | ||
"files": [ | ||
"bin", | ||
"dist" | ||
], | ||
"bin": { | ||
"percy-storybook": "./bin/percy-storybook.cjs" | ||
}, | ||
"main": "./dist/index.js", | ||
"exports": "./dist/index.js", | ||
"type": "module", | ||
"scripts": { | ||
"build": "babel src --out-dir dist", | ||
"clean": "git clean -Xdf -e !node_modules -e !node_modules/**", | ||
"lint": "eslint --ignore-path .gitignore .", | ||
"readme": "percy-cli-readme", | ||
"pretest": "build-storybook --config-dir=./test/.storybook --output-dir=./test/.storybook-build --loglevel error", | ||
"test": "yarn test:env jasmine --config=./test/jasmine.json", | ||
"test:env": "cross-env NODE_ENV=test NODE_OPTIONS='--loader=./test/loader.js'", | ||
"test:coverage": "nyc yarn test" | ||
}, | ||
"@percy/cli": { | ||
"commands": [ | ||
"./dist/storybook.js" | ||
] | ||
}, | ||
"dependencies": { | ||
"@percy/cli-command": "^1.24.0", | ||
"cross-spawn": "^7.0.3", | ||
"qs": "^6.11.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.23.0", | ||
"@babel/core": "^7.23.2", | ||
"@babel/eslint-parser": "^7.19.1", | ||
"@babel/eslint-plugin": "^7.19.1", | ||
"@babel/preset-env": "^7.22.9", | ||
"@storybook/react": "^6.5.13", | ||
"babel-eslint": "^10.0.3", | ||
"babel-plugin-istanbul": "^6.1.1", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.51.0", | ||
"eslint-config-standard": "^17.0.0", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-n": "^15.4.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"jasmine": "^4.5.0", | ||
"jasmine-spec-reporter": "^7.0.0", | ||
"mock-require": "^3.0.3", | ||
"nock": "^13.2.9", | ||
"nyc": "^15.1.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
# move package and storybook configs | ||
mv ./packageV6.json ./package.json | ||
mv ./test/.storybook/mainV6.js ./test/.storybook/main.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
stories: ['*.stories.js'], | ||
features: { | ||
postcss: false | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.