Skip to content

Commit

Permalink
Merge pull request #18759 from storybookjs/future/move-code-into-dire…
Browse files Browse the repository at this point in the history
…ctory

Future - Move all code into a `code` directory
  • Loading branch information
ndelangen authored Jul 26, 2022
2 parents 9711bfc + dd82d44 commit 441338a
Show file tree
Hide file tree
Showing 3,199 changed files with 25,618 additions and 4,004 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .ci/danger/dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const flatten = require('lodash/flatten');
const intersection = require('lodash/intersection');
const isEmpty = require('lodash/isEmpty');

const pkg = require('../../package.json'); // eslint-disable-line import/newline-after-import
const pkg = require('../../code/package.json'); // eslint-disable-line import/newline-after-import
const prLogConfig = pkg['pr-log'];

const Versions = {
Expand Down
121 changes: 87 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,40 @@ jobs:
- restore_cache:
name: Restore Yarn cache
keys:
- build-yarn-2-cache-v3--{{ checksum "yarn.lock" }}
- build-yarn-2-cache-v3--{{ checksum "code/yarn.lock" }}
- run:
name: Install dependencies
command: yarn install --immutable
command: |
cd code
yarn install --immutable
- run:
name: Install script dependencies
command: |
cd scripts
yarn install --immutable
- run:
name: Bootstrap
command: |
cd code
yarn bootstrap --build
git diff --exit-code
- save_cache:
name: Save Yarn cache
key: build-yarn-2-cache-v3--{{ checksum "yarn.lock" }}
key: build-yarn-2-cache-v3--{{ checksum "code/yarn.lock" }}
paths:
- ~/.yarn/berry/cache
- persist_to_workspace:
root: .
paths:
- examples
- node_modules
- addons
- frameworks
- lib
- renderers
- presets
- code/node_modules
- scripts/node_modules
- code/examples
- code/node_modules
- code/addons
- code/frameworks
- code/lib
- code/renderers
- code/presets
chromatic:
executor: sb_node_14_browsers
parallelism: 15
Expand All @@ -121,6 +131,7 @@ jobs:
- run:
name: chromatic
command: |
cd code
yarn run-chromatics
examples:
executor:
Expand All @@ -135,11 +146,12 @@ jobs:
- run:
name: examples
command: |
cd code
yarn build-storybooks --all
- persist_to_workspace:
root: .
paths:
- built-storybooks
- code/built-storybooks
publish:
executor:
class: medium
Expand All @@ -151,7 +163,9 @@ jobs:
at: .
- run:
name: running local registry
command: yarn local-registry --publish
command: |
cd code
yarn local-registry --publish
- persist_to_workspace:
root: .
paths:
Expand All @@ -178,14 +192,20 @@ jobs:
at: .
- run:
name: running local registry
command: yarn local-registry --port 6000 --open
command: |
cd code
yarn local-registry --port 6000 --open
background: true
- run:
name: Wait for registry
command: yarn wait-on http://localhost:6000
command: |
cd code
yarn wait-on http://localhost:6000
- run:
name: Run E2E (extended) tests
command: yarn test:e2e-framework --clean --all --skip angular --skip angular12 --skip vue3 --skip web_components_typescript --skip cra --skip react
command: |
cd code
yarn test:e2e-framework --clean --all --skip angular --skip angular12 --skip vue3 --skip web_components_typescript --skip cra --skip react
no_output_timeout: 5m
- store_artifacts:
path: /tmp/cypress-record
Expand All @@ -202,16 +222,22 @@ jobs:
at: .
- run:
name: Running local registry
command: yarn local-registry --port 6000 --open
command: |
cd code
yarn local-registry --port 6000 --open
background: true
- run:
name: Wait for registry
command: yarn wait-on http://localhost:6000
command: |
cd code
yarn wait-on http://localhost:6000
- run:
name: Run E2E (core) tests
# Do not test CRA here because it's done in PnP part
# TODO: Remove `web_components_typescript` as soon as Lit 2 stable is released
command: yarn test:e2e-framework vue3 angular130 angular13 angular12 web_components_typescript web_components_lit2 react react_legacy_root_api
command: |
cd code
yarn test:e2e-framework vue3 angular130 angular13 angular12 web_components_typescript web_components_lit2 react react_legacy_root_api
no_output_timeout: 5m
- run:
name: prep artifacts
Expand Down Expand Up @@ -259,21 +285,29 @@ jobs:
at: .
- run:
name: install playright
command: npx playwright install
command: |
cd code
npx playwright install
- run:
name: Running local registry
command: yarn local-registry --port 6000 --open
command: |
cd code
yarn local-registry --port 6000 --open
background: true
- run:
name: Wait for registry
command: yarn wait-on http://localhost:6000
command: |
cd code
yarn wait-on http://localhost:6000
- run:
name: set up cra repro, skip tests
command: node ./lib/cli/bin/index.js repro -t cra --e2e ../cra-bench
command: |
cd code
node ./lib/cli/bin/index.js repro -t cra --e2e ../cra-bench
- run:
name: Run @storybook/bench on repro
command: |
cd ../cra-bench
cd ./cra-bench
npx @storybook/[email protected] 'echo noop' --label cra
e2e-tests-pnp:
executor:
Expand All @@ -287,14 +321,20 @@ jobs:
at: .
- run:
name: Running local registry
command: yarn local-registry --port 6000 --open
command: |
cd code
yarn local-registry --port 6000 --open
background: true
- run:
name: Wait for registry
command: yarn wait-on http://localhost:6000
command: |
cd code
yarn wait-on http://localhost:6000
- run:
name: run e2e tests cra
command: yarn test:e2e-framework --pnp cra
command: |
cd code
yarn test:e2e-framework --pnp cra
# - run:
# name: run e2e tests vue
# command: yarn test:e2e-framework --pnp sfcVue
Expand All @@ -319,14 +359,20 @@ jobs:
at: .
- run:
name: running example
command: yarn serve-storybooks
command: |
cd code
yarn serve-storybooks
background: true
- run:
name: await running examples
command: yarn await-serve-storybooks
command: |
cd code
yarn await-serve-storybooks
- run:
name: cypress run
command: yarn test:e2e-examples
command: |
cd code
yarn test:e2e-examples
- store_artifacts:
path: /tmp/cypress-record
destination: cypress
Expand All @@ -347,6 +393,7 @@ jobs:
- run:
name: smoke tests
command: |
cd code
yarn smoketest-storybooks --all
lint:
executor:
Expand All @@ -359,7 +406,9 @@ jobs:
at: .
- run:
name: Lint
command: yarn lint
command: |
cd code
yarn lint
unit-tests:
executor: sb_node_14_browsers
steps:
Expand All @@ -369,13 +418,15 @@ jobs:
at: .
- run:
name: Test
command: yarn test --coverage --runInBand --ci
command: |
cd code
yarn test --coverage --runInBand --ci
- store_test_results:
path: junit.xml
path: code/junit.xml
- persist_to_workspace:
root: .
paths:
- coverage
- code/coverage
coverage:
executor:
class: small
Expand All @@ -387,7 +438,9 @@ jobs:
at: .
- run:
name: Upload coverage
command: yarn coverage
command: |
cd code
yarn coverage
workflows:
test:
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/.yarn/** linguist-generated
/**/.yarn/** linguist-generated
2 changes: 2 additions & 0 deletions .github/workflows/generate-repros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
run: |
git config --global user.name "Storybook Bot"
git config --global user.email "[email protected]"
- name: Change directory
run: cd code
- name: Install dependencies
run: yarn install
- name: Generate repros with Latest Storybook CLI
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
cache: yarn
- name: install, bootstrap
run: |
cd code
yarn install --immutable
yarn bootstrap --core
- name: test
run: |
cd code
yarn test --runInBand --ci
29 changes: 1 addition & 28 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,10 @@ node_modules
.idea
*.iml
*.sw*
npm-shrinkwrap.json
dist
.tern-port
*.DS_Store
.cache
.parcel-cache
coverage/
*.lerna_backup
build
packages/examples/automated-*
/**/LICENSE
docs/public
packs/*.tgz
package-lock.json
.nvmrc
storybook-static
integration/__image_snapshots__/__diff_output__
.jest-test-results.json
/examples/cra-kitchen-sink/src/__image_snapshots__/__diff_output__/
lib/*.jar
lib/**/dll
/false
/addons/docs/common/config-*
built-storybooks
cypress/videos
cypress/screenshots
examples/ember-cli/ember-output
.verdaccio-cache
tsconfig.tsbuildinfo
examples/angular-cli/addon-jest.testresults.json
junit.xml
.next

# Yarn stuff
/**/.yarn/*
Expand All @@ -43,3 +15,4 @@ junit.xml
!/**/.yarn/sdks
!/**/.yarn/versions
/**/.pnp.*
/yarn.lock
Loading

0 comments on commit 441338a

Please sign in to comment.