Skip to content

Commit

Permalink
feat: fail fast when no packages found
Browse files Browse the repository at this point in the history
  • Loading branch information
linbudu599 committed Mar 24, 2022
1 parent 4989791 commit 707de8a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 26 deletions.
32 changes: 16 additions & 16 deletions packages/apollo-element-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@apollo-elements/components": "^2.0.0",
"@apollo-elements/core": "^1.0.0",
"@apollo/client": "^3.5.4",
"graphql": "^15.0.0",
"lit": "^2.1.1",
"lit-element": "^3.1.1",
"@apollo-elements/components": "^3.0.1",
"@apollo-elements/core": "^2.1.0",
"@apollo/client": "^3.5.10",
"graphql": "^16.3.0",
"lit": "^2.2.1",
"lit-element": "^3.2.0",
"pwa-helpers": "^0.9.1",
"tslib": "^2.3.1"
},
"devDependencies": {
"@apollo-elements/create": "^3.0.3",
"@graphql-codegen/cli": "^2.3.0",
"@apollo-elements/create": "^4.0.2",
"@graphql-codegen/cli": "^2.6.2",
"@graphql-codegen/introspection": "^2.1.1",
"@graphql-codegen/near-operation-file-preset": "^2.2.2",
"@graphql-codegen/typed-document-node": "^2.2.1",
"@graphql-codegen/typescript": "^2.4.1",
"@graphql-codegen/typescript-operations": "^2.2.1",
"@graphql-codegen/near-operation-file-preset": "^2.2.9",
"@graphql-codegen/typed-document-node": "^2.2.8",
"@graphql-codegen/typescript": "^2.4.8",
"@graphql-codegen/typescript-operations": "^2.3.5",
"@open-wc/rollup-plugin-html": "^1.x",
"@pwrs/eslint-config": "^0.x",
"@rollup/plugin-commonjs": "^17.x",
"@rollup/plugin-node-resolve": "^11.x",
"@rollup/plugin-commonjs": "^21.x",
"@rollup/plugin-node-resolve": "^13.x",
"@web/dev-server": "^0.1.x",
"@web/dev-server-esbuild": "^0.2.x",
"@web/dev-server-rollup": "^0.3.x",
"npm-run-all": "^4.x",
"rollup": "^2.x",
"rollup-plugin-esbuild": "^2.x",
"rollup-plugin-lit-css": "^2.x",
"rollup-plugin-esbuild": "^4.x",
"rollup-plugin-lit-css": "^3.x",
"typescript": "^4.x"
},
"keywords": []
Expand Down
10 changes: 5 additions & 5 deletions packages/apollo-server-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
},
"dependencies": {
"apollo-graphql": "^0.9.5",
"apollo-server": "^3.6.4",
"apollo-server-core": "^3.6.4",
"chalk": "4.0.0",
"apollo-server": "^3.6.5",
"apollo-server-core": "^3.6.5",
"chalk": "5.0.1",
"class-validator": "^0.13.2",
"graphql": "^15.3.0",
"graphql": "^16.3.0",
"graphql-subscriptions": "^2.0.0",
"nexus": "^1.3.0",
"nexus-plugin-prisma": "^0.35.0",
"reflect-metadata": "^0.1.13",
"type-graphql": "^1.1.1"
},
"resolutions": {
"graphql": "^15.3.0"
"graphql": "^16.3.0"
}
}
4 changes: 2 additions & 2 deletions packages/astro-docs-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"@algolia/client-search": "^4.13.0",
"@docsearch/css": "^3.0.0",
"@docsearch/react": "^3.0.0",
"@types/react": "^17.0.40",
"@types/react": "^17.0.42",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@astrojs/renderer-preact": "^0.5.0",
"@astrojs/renderer-react": "^0.5.0",
"astro": "^0.24.2"
"astro": "^0.24.3"
}
}
6 changes: 3 additions & 3 deletions packages/cra-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.26",
"@types/react": "^17.0.40",
"@types/react-dom": "^17.0.13",
"@types/node": "^17.0.23",
"@types/react": "^17.0.42",
"@types/react-dom": "^17.0.14",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "5.0.0",
Expand Down
5 changes: 5 additions & 0 deletions scripts/cache-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export default function useCachePackage(cli: CAC) {
fs.ensureDirSync(CLIUtils.resolvedPackageRootDir);
const existPackages = CLIUtils.existPackages;

if (!existPackages.length) {
consola.warn('No package found in current workspace, exit.');
process.exit(0);
}

for (const p of existPackages) {
const projectSrcPath = CLIUtils.resolvePackageDir(p);
const projectDestPath = CLIUtils.resolveCachePackageDir(p);
Expand Down
5 changes: 5 additions & 0 deletions scripts/init-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export default function useInitWorkspaceAfterInstall(cli: CAC) {
.action(async () => {
const existPackages = CLIUtils.existPackages;

if (!existPackages.length) {
consola.warn('No package found in current workspace, exit.');
process.exit(0);
}

const chosedStarters = await CLIUtils.createPackageMultiSelector(
'chosedStarters',
'Pick starters to initialize workspace'
Expand Down

0 comments on commit 707de8a

Please sign in to comment.