Skip to content

Commit

Permalink
Start writing CircleCI script to test empty init
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun Lloyd committed Nov 29, 2023
1 parent 0032ff2 commit 07790cb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,32 @@ jobs:
command: yarn upload-bench $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench)
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench)
test-empty-init:
parameters:
packageManager:
type: string
template:
type: string
parallelism:
type: integer
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Move to parent directory
command: cd ..
- run:
name: Create empty project
command: mkdir empty-<< parameters.template >> && cd empty-<< parameters.template >>
- run:
name: Run storybook init
command: yarn storybook init
environment:
STORYBOOK_PACKAGE_MANAGER: << parameters.packageManager >>
STORYBOOK_INIT_EMPTY_TYPE: << parameters.template >>

workflows:
docs:
Expand Down Expand Up @@ -640,6 +666,16 @@ workflows:
parallelism: 31
requires:
- build-sandboxes
# TODO: Uncomment when ready to test
# - test-empty-init:
# parallelism: 15
# requires:
# - build
# matrix:
# parameters:
# packageManager: [yarn2],
# template: ["react-vite-ts", "nextjs-ts", "vue-vite-ts", "angular-cli", "lit-vite-ts"]

# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
# parallelism: 4
Expand Down
6 changes: 5 additions & 1 deletion code/lib/cli/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ command('init')
.description('Initialize Storybook into your project.')
.option('-f --force', 'Force add Storybook')
.option('-s --skip-install', 'Skip installing deps')
.option('--package-manager <npm|pnpm|yarn1|yarn2>', 'Force package manager for installing deps')
.option(
'--package-manager <npm|pnpm|yarn1|yarn2>',
'Force package manager for installing deps',
process.env.STORYBOOK_PACKAGE_MANAGER
)
.option('-N --use-npm', 'Use npm to install deps (deprecated)')
.option('--use-pnp', 'Enable pnp mode for Yarn 2+')
.option('-p --parser <babel | babylon | flow | ts | tsx>', 'jscodeshift parser')
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/scaffold-new-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const buildProjectDisplayNameForPrint = ({ displayName }: SupportedProject) => {
* @param packageManager The package manager to use.
*/
export const scaffoldNewProject = async (packageManager: PackageManagerName) => {
const packageManagerName = 'pnpm'; // packageManagerToCoercedName(packageManager);
const packageManagerName = packageManagerToCoercedName(packageManager);

logger.plain(
boxen(
Expand Down

0 comments on commit 07790cb

Please sign in to comment.