Skip to content

Commit

Permalink
feat(node): remove library generator in favor of @nrwl/js:library (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Oct 12, 2022
1 parent 136e1a8 commit e74a54d
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 1,057 deletions.
130 changes: 0 additions & 130 deletions docs/generated/packages/node.json
Expand Up @@ -138,136 +138,6 @@
"implementation": "/packages/node/src/generators/application/application.ts",
"hidden": false,
"path": "/packages/node/src/generators/application/schema.json"
},
{
"name": "library",
"factory": "./src/generators/library/library",
"schema": {
"$schema": "http://json-schema.org/schema",
"cli": "nx",
"$id": "NxNodeLibrary",
"title": "Create a Node Library for Nx",
"description": "Create a Node Library for an Nx workspace.",
"type": "object",
"examples": [
{
"command": "nx g lib mylib --directory=myapp",
"description": "Generate `libs/myapp/mylib`"
}
],
"properties": {
"name": {
"type": "string",
"description": "Library name",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the library?"
},
"directory": {
"type": "string",
"description": "A directory where the lib is placed",
"alias": "dir"
},
"simpleModuleName": {
"description": "Keep the module name simple (when using `--directory`).",
"type": "boolean",
"default": false
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint"],
"default": "eslint"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest"
},
"tags": {
"type": "string",
"description": "Add tags to the library (used for linting).",
"alias": "t"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
},
"skipTsConfig": {
"type": "boolean",
"default": false,
"description": "Do not update `tsconfig.base.json` for development experience."
},
"publishable": {
"type": "boolean",
"description": "Create a publishable library."
},
"buildable": {
"type": "boolean",
"default": false,
"description": "Generate a buildable library."
},
"compiler": {
"type": "string",
"enum": ["tsc", "swc"],
"default": "tsc",
"description": "The compiler used by the build and test targets."
},
"importPath": {
"type": "string",
"description": "The library name used to import it, like `@myorg/my-awesome-lib`. Must be a valid npm name."
},
"rootDir": {
"type": "string",
"description": "Sets the `rootDir` for TypeScript compilation. When not defined, it uses the project's root property, or `srcRootForCompilationRoot` if it is defined."
},
"testEnvironment": {
"type": "string",
"enum": ["jsdom", "node"],
"description": "The test environment to use if `unitTestRunner` is set to `jest`.",
"default": "jsdom"
},
"babelJest": {
"type": "boolean",
"description": "Use `babel` instead of `ts-jest`.",
"default": false
},
"pascalCaseFiles": {
"type": "boolean",
"description": "Use pascal case file names.",
"alias": "P",
"default": false
},
"js": {
"type": "boolean",
"description": "Generate JavaScript files rather than TypeScript files.",
"default": false
},
"strict": {
"type": "boolean",
"description": "Whether to enable tsconfig strict mode or not.",
"default": false
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
},
"setParserOptionsProject": {
"type": "boolean",
"description": "Whether or not to configure the ESLint `parserOptions.project`. We do not do this by default for lint performance reasons.",
"default": false
}
},
"required": ["name"],
"presets": []
},
"aliases": ["lib"],
"x-type": "library",
"description": "Create a node library.",
"implementation": "/packages/node/src/generators/library/library.ts",
"hidden": false,
"path": "/packages/node/src/generators/library/schema.json"
}
],
"executors": [
Expand Down
2 changes: 1 addition & 1 deletion docs/packages.json
Expand Up @@ -248,7 +248,7 @@
"path": "generated/packages/node.json",
"schemas": {
"executors": ["webpack", "node"],
"generators": ["init", "application", "library"]
"generators": ["init", "application"]
}
},
{
Expand Down
1 change: 0 additions & 1 deletion nx-dev/nx-dev-e2e/src/integration/packages.spec.ts
Expand Up @@ -296,7 +296,6 @@ describe('nx-dev: Packages Section', () => {
title: '@nrwl/node:application',
path: '/packages/node/generators/application',
},
{ title: '@nrwl/node:library', path: '/packages/node/generators/library' },
{ title: '@nrwl/node:webpack', path: '/packages/node/executors/webpack' },
{ title: '@nrwl/node:node', path: '/packages/node/executors/node' },
{ title: 'nx', path: '/packages/nx' },
Expand Down
16 changes: 1 addition & 15 deletions packages/node/generators.json
@@ -1,7 +1,7 @@
{
"name": "nx/node",
"version": "0.1",
"extends": ["@nrwl/workspace"],
"extends": ["@nrwl/js"],
"generators": {
"init": {
"factory": "./src/generators/init/init",
Expand All @@ -16,13 +16,6 @@
"aliases": ["app"],
"x-type": "application",
"description": "Create a node application."
},
"library": {
"factory": "./src/generators/library/library",
"schema": "./src/generators/library/schema.json",
"aliases": ["lib"],
"x-type": "library",
"description": "Create a node library."
}
},
"schematics": {
Expand All @@ -39,13 +32,6 @@
"aliases": ["app"],
"x-type": "application",
"description": "Create a node application."
},
"library": {
"factory": "./src/generators/library/library#librarySchematic",
"schema": "./src/generators/library/schema.json",
"aliases": ["lib"],
"x-type": "library",
"description": "Create a node library."
}
}
}
7 changes: 6 additions & 1 deletion packages/node/index.ts
@@ -1,3 +1,8 @@
import { libraryGenerator } from '@nrwl/js';

// backwards compat
// TODO(jack): Remove in Nx 16
export { libraryGenerator };

export { applicationGenerator } from './src/generators/application/application';
export { libraryGenerator } from './src/generators/library/library';
export { initGenerator } from './src/generators/init/init';

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions packages/node/src/generators/library/files/lib/tsconfig.lib.json

This file was deleted.

1 comment on commit e74a54d

@vercel
Copy link

@vercel vercel bot commented on e74a54d Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.