File tree Expand file tree Collapse file tree 4 files changed +77
-0
lines changed
packages/create-next-stack/src Expand file tree Collapse file tree 4 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ import fs from "fs/promises"
2+
3+ export const exists = async ( path : string ) : Promise < boolean > => {
4+ try {
5+ await fs . access ( path )
6+ return true
7+ } catch ( error ) {
8+ return false
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ import { exists } from "../../../main/helpers/exists"
12import { runCommand } from "../../../main/helpers/run-command"
23import { checkFormattingLintingBuild } from "../helpers/check-formatting-linting-build"
34import { logTestMeta } from "../helpers/log-test-meta"
@@ -31,4 +32,14 @@ export const testNpm = async (createNextStackDir: string): Promise<void> => {
3132 } )
3233
3334 await checkFormattingLintingBuild ( runDirectory )
35+
36+ if ( await exists ( `${ runDirectory } /yarn.lock` ) ) {
37+ throw new Error ( `yarn.lock found.` )
38+ }
39+ if ( ! ( await exists ( `${ runDirectory } /package-lock.json` ) ) ) {
40+ throw new Error ( `package-lock.json not found.` )
41+ }
42+ if ( await exists ( `${ runDirectory } /pnpm-lock.yaml` ) ) {
43+ throw new Error ( `pnpm-lock.yaml found.` )
44+ }
3445}
Original file line number Diff line number Diff line change 1+ import { exists } from "../../../main/helpers/exists"
2+ import { runCommand } from "../../../main/helpers/run-command"
3+ import { checkFormattingLintingBuild } from "../helpers/check-formatting-linting-build"
4+ import { logTestMeta } from "../helpers/log-test-meta"
5+ import { minutesToMilliseconds } from "../helpers/minutes-to-milliseconds"
6+ import { prepareE2eTest } from "../helpers/prepare-e2e-test"
7+
8+ export const testPnpm = async ( createNextStackDir : string ) : Promise < void > => {
9+ logTestMeta ( testPnpm . name , __filename )
10+
11+ const { pathToCLI, runDirectory } = await prepareE2eTest ( createNextStackDir )
12+
13+ const args = [
14+ "--debug" ,
15+ "--package-manager=pnpm" ,
16+ "--prettier" ,
17+ "--styling=emotion" ,
18+ "--material-ui" ,
19+ "--react-hook-form" ,
20+ "--formik" ,
21+ "--framer-motion" ,
22+ "--formatting-pre-commit-hook" ,
23+ "--chakra" ,
24+ "." ,
25+ ]
26+
27+ await runCommand ( pathToCLI , args , {
28+ timeout : minutesToMilliseconds ( 10 ) ,
29+ cwd : runDirectory ,
30+ stdout : "inherit" ,
31+ stderr : "inherit" ,
32+ } )
33+
34+ await checkFormattingLintingBuild ( runDirectory )
35+
36+ if ( await exists ( `${ runDirectory } /yarn.lock` ) ) {
37+ throw new Error ( `yarn.lock found.` )
38+ }
39+ if ( await exists ( `${ runDirectory } /package-lock.json` ) ) {
40+ throw new Error ( `package-lock.json found.` )
41+ }
42+ if ( ! ( await exists ( `${ runDirectory } /pnpm-lock.yaml` ) ) ) {
43+ throw new Error ( `pnpm-lock.yaml not found.` )
44+ }
45+ }
Original file line number Diff line number Diff line change 1+ import { exists } from "../../../main/helpers/exists"
12import { runCommand } from "../../../main/helpers/run-command"
23import { checkFormattingLintingBuild } from "../helpers/check-formatting-linting-build"
34import { logTestMeta } from "../helpers/log-test-meta"
@@ -31,4 +32,14 @@ export const testYarn = async (createNextStackDir: string): Promise<void> => {
3132 } )
3233
3334 await checkFormattingLintingBuild ( runDirectory )
35+
36+ if ( ! ( await exists ( `${ runDirectory } /yarn.lock` ) ) ) {
37+ throw new Error ( `yarn.lock not found.` )
38+ }
39+ if ( await exists ( `${ runDirectory } /package-lock.json` ) ) {
40+ throw new Error ( `package-lock.json found.` )
41+ }
42+ if ( await exists ( `${ runDirectory } /pnpm-lock.yaml` ) ) {
43+ throw new Error ( `pnpm-lock.yaml found.` )
44+ }
3445}
You can’t perform that action at this time.
0 commit comments