Skip to content

Commit

Permalink
feat(js): map non-buildable libraries to their source
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Nov 29, 2024
1 parent 7ecbab3 commit 92a2604
Show file tree
Hide file tree
Showing 49 changed files with 443 additions and 201 deletions.
4 changes: 2 additions & 2 deletions docs/generated/packages/expo/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests",
"default": "jest",
"default": "none",
"x-priority": "important"
},
"tags": {
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/packages/expo/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest",
"default": "none",
"x-priority": "important"
},
"tags": {
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/packages/next/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
Expand All @@ -78,7 +78,7 @@
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest",
"default": "none",
"x-prompt": "What unit test runner should be used?",
"x-priority": "important"
},
Expand Down
15 changes: 12 additions & 3 deletions docs/generated/packages/next/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,27 @@
]
}
},
"bundler": {
"type": "string",
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
"enum": ["none", "vite", "rollup"],
"default": "none",
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
"x-priority": "important"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["vitest", "jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "vitest",
"default": "none",
"x-prompt": "What unit test runner should be used?",
"x-priority": "important"
},
Expand Down Expand Up @@ -103,7 +111,8 @@
"buildable": {
"type": "boolean",
"default": false,
"description": "Generate a buildable library."
"description": "Generate a buildable library that uses rollup to bundle.",
"x-deprecated": "Use the `bundler` option for greater control (none, vite, rollup)."
},
"importPath": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests",
"default": "jest",
"default": "none",
"x-priority": "important"
},
"tags": {
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/packages/react-native/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest",
"default": "none",
"x-priority": "important"
},
"tags": {
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/packages/react/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["vitest", "jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "vitest",
"default": "none",
"x-prompt": "What unit test runner should be used?",
"x-priority": "important"
},
Expand Down
17 changes: 10 additions & 7 deletions docs/generated/packages/react/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,26 @@
]
}
},
"bundler": {
"type": "string",
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
"enum": ["none", "vite", "rollup"],
"default": "none",
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
"x-priority": "important"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["vitest", "jest", "none"],
"default": "vitest",
"default": "none",
"description": "Test runner to use for unit tests.",
"x-prompt": "What unit test runner should be used?",
"x-priority": "important"
Expand Down Expand Up @@ -151,11 +159,6 @@
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
},
"bundler": {
"type": "string",
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
"enum": ["none", "vite", "rollup"]
},
"compiler": {
"type": "string",
"enum": ["babel", "swc"],
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/packages/remix/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
"unitTestRunner": {
"type": "string",
"enum": ["vitest", "jest", "none"],
"default": "vitest",
"default": "none",
"description": "Test runner to use for unit tests.",
"x-prompt": "What unit test runner should be used?",
"x-priority": "important"
Expand Down
21 changes: 15 additions & 6 deletions docs/generated/packages/remix/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@
"enum": ["none", "css"],
"default": "css"
},
"buildable": {
"type": "boolean",
"description": "Should the library be buildable?",
"default": false
"bundler": {
"type": "string",
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
"enum": ["none", "vite", "rollup"],
"default": "none",
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
"x-priority": "important"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint",
"default": "none",
"x-prompt": "Which linter would you like to use?",
"x-priority": "important"
},
Expand All @@ -55,7 +58,7 @@
"enum": ["vitest", "jest", "none"],
"description": "Test Runner to use for Unit Tests",
"x-prompt": "What test runner should be used?",
"default": "vitest",
"default": "none",
"x-priority": "important"
},
"importPath": {
Expand All @@ -72,6 +75,12 @@
"description": "Skip formatting files after generator runs",
"default": false,
"x-priority": "internal"
},
"buildable": {
"type": "boolean",
"default": false,
"description": "Generate a buildable library that uses rollup to bundle.",
"x-deprecated": "Use the `bundler` option for greater control (none, vite, rollup)."
}
},
"required": ["directory"],
Expand Down
17 changes: 10 additions & 7 deletions e2e/eslint/src/linter-legacy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ describe('Linter (legacy)', () => {
newProject({
packages: ['@nx/react', '@nx/js', '@nx/eslint'],
});
runCLI(`generate @nx/react:app apps/${myapp} --tags=validtag`, {
env: { NX_ADD_PLUGINS: 'false' },
});
runCLI(`generate @nx/js:lib apps/${mylib}`, {
runCLI(
`generate @nx/react:app apps/${myapp} --tags=validtag --linter=eslint`,
{
env: { NX_ADD_PLUGINS: 'false' },
}
);
runCLI(`generate @nx/js:lib apps/${mylib} --linter=eslint`, {
env: { NX_ADD_PLUGINS: 'false' },
});
});
Expand Down Expand Up @@ -135,10 +138,10 @@ describe('Linter (legacy)', () => {
bundler: 'vite',
e2eTestRunner: 'none',
});
runCLI(`generate @nx/js:lib libs/${mylib}`, {
runCLI(`generate @nx/js:lib libs/${mylib} --linter=eslint`, {
env: { NX_ADD_PLUGINS: 'false' },
});
runCLI(`generate @nx/js:lib libs/${mylib2}`, {
runCLI(`generate @nx/js:lib libs/${mylib2} --linter=eslint`, {
env: { NX_ADD_PLUGINS: 'false' },
});

Expand Down Expand Up @@ -190,7 +193,7 @@ describe('Linter (legacy)', () => {
bundler: 'vite',
e2eTestRunner: 'none',
});
runCLI(`generate @nx/js:lib ${mylib}`, {
runCLI(`generate @nx/js:lib ${mylib} --linter=eslint`, {
env: { NX_ADD_PLUGINS: 'false' },
});

Expand Down
Loading

0 comments on commit 92a2604

Please sign in to comment.