From 0587e055f96523f9ad5f5334d77b3a9482168cdd Mon Sep 17 00:00:00 2001 From: Karol Rzotki Date: Tue, 12 Nov 2024 13:53:42 +0100 Subject: [PATCH] fix(gene init): Add missing required deps --- packages/create/bin/create-gene-workspace.js | 20 ++++++++++++++++ .../gene-workspace-generator/index.ts | 23 +++++++++++++------ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/packages/create/bin/create-gene-workspace.js b/packages/create/bin/create-gene-workspace.js index 36d39e0..b5fba85 100755 --- a/packages/create/bin/create-gene-workspace.js +++ b/packages/create/bin/create-gene-workspace.js @@ -85,6 +85,7 @@ async function runCommands() { console.log('Installing dependencies with pnpm'); + // Install dependencies await execCommand('pnpm', [ 'install', `@brainly-gene/core@${packageVersion}`, @@ -97,6 +98,11 @@ async function runCommands() { `inversify@5.1.1`, `@tanstack/react-query@5.55.4`, '@nrwl/next@15.8.6', + 'style-loader@2.0.0', + 'css-loader@3.6.0', + 'sass@1.55.0', + 'sass-loader@9.0.2', + '@apollo/client@3.6.9', ]); // Install dev dependencies @@ -116,6 +122,20 @@ async function runCommands() { 'eslint-plugin-react@7.31.11', 'eslint-config-next@13.1.1', '@nrwl/jest@15.8.9', + "msw@0.49.2", + "msw-storybook-addon@1.6.3", + "@storybook/addon-actions@6.5.16", + "@storybook/core-server@6.5.16", + "@storybook/addon-backgrounds@6.3.8", + "@storybook/addon-knobs@6.3.1", + "@storybook/addon-links@6.3.8", + "@storybook/addon-storysource@6.3.8", + "@storybook/addon-viewport@6.3.8", + "@storybook/addons@6.3.8", + "@storybook/builder-webpack5@6.5.16", + "@storybook/manager-webpack5@6.5.16", + "@storybook/react@6.5.16", + "@storybook/theming@6.5.16" ]); console.log('Generating gene-workspace with pnpm nx'); diff --git a/packages/gene-tools/src/generators/gene-workspace-generator/index.ts b/packages/gene-tools/src/generators/gene-workspace-generator/index.ts index 8f53297..9a29c99 100644 --- a/packages/gene-tools/src/generators/gene-workspace-generator/index.ts +++ b/packages/gene-tools/src/generators/gene-workspace-generator/index.ts @@ -19,14 +19,23 @@ export default async function (tree: Tree) { await generateFiles(tree, joinPathFragments(__dirname, './files'), './', {}); // Update .eslintrc.json - // TODO once eslint plugin will be stablized enable it again - // const eslintJson = tree.read('.eslintrc.json', 'utf-8'); - // const updatedEslintJson = eslintJson.replace( - // 'plugin:@nrwl/nx/typescript', - // 'plugin:@brainly-gene/eslint-plugin/basic' - // ); + const eslintJson = tree.read('.eslintrc.json', 'utf-8'); + const updatedEslintJson = eslintJson + .replace( + 'plugin:@nrwl/nx/typescript', + 'plugin:@brainly-gene/eslint-plugin/basic' + ) + .replace( + '"plugins": ["@nrwl/nx"]', + '"plugins": ["@nrwl/nx", "@brainly-gene"]' + ); - // tree.write('.eslintrc.json', updatedEslintJson); + tree.write('.eslintrc.json', updatedEslintJson); + + // Update .gitignore to ignore .storybook/assets + const gitignore = tree.read('.gitignore', 'utf-8'); + const updatedGitignore = gitignore + '\n.storybook/assets'; + tree.write('.gitignore', updatedGitignore); return () => { installPackagesTask(tree);