@nx/express 16.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+
7
+
8
+ **Note:** Version bump only for package @nx/express
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017-2023 Narwhal Technologies Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
2
+
3
+ <div style="text-align: center;">
4
+
5
+ [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
6
+ [![License](https://img.shields.io/npm/l/@nrwl/workspace.svg?style=flat-square)]()
7
+ [![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nrwl/workspace)
8
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
9
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10
+ [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
11
+ [![Join us @nrwl/community on slack](https://img.shields.io/badge/slack-%40nrwl%2Fcommunity-brightgreen)](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc)
12
+
13
+ </div>
14
+
15
+
16
+ <hr>
17
+
18
+ # Nx: Smart, Fast and Extensible Build System
19
+
20
+ Nx is a next generation build system with first class monorepo support and powerful integrations.
21
+
22
+ This package is an [Express plugin for Nx](https://nx.dev/express/overview).
23
+
24
+ ## Getting Started
25
+
26
+ ### Creating an Nx Workspace
27
+
28
+ **Using `npx`**
29
+
30
+ ```bash
31
+ npx create-nx-workspace
32
+ ```
33
+
34
+ **Using `npm init`**
35
+
36
+ ```bash
37
+ npm init nx-workspace
38
+ ```
39
+
40
+ **Using `yarn create`**
41
+
42
+ ```bash
43
+ yarn create nx-workspace
44
+ ```
45
+
46
+ ### Adding Nx to an Existing Repository
47
+
48
+ Run:
49
+
50
+ ```bash
51
+ npx nx@latest init
52
+ ```
53
+
54
+ ## Documentation & Resources
55
+
56
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
57
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
58
+ - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
59
+ - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
60
+
61
+ <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
62
+ width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
63
+
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "Nx Express",
3
+ "version": "0.1",
4
+ "extends": ["@nrwl/workspace"],
5
+ "generators": {
6
+ "init": {
7
+ "factory": "./src/generators/init/init#initGenerator",
8
+ "schema": "./src/generators/init/schema.json",
9
+ "description": "Initialize the `@nrwl/express` plugin.",
10
+ "aliases": ["ng-add"],
11
+ "hidden": true
12
+ },
13
+
14
+ "application": {
15
+ "factory": "./src/generators/application/application#applicationGenerator",
16
+ "schema": "./src/generators/application/schema.json",
17
+ "aliases": ["app"],
18
+ "x-type": "application",
19
+ "description": "Create an Express application."
20
+ }
21
+ },
22
+ "schematics": {
23
+ "init": {
24
+ "factory": "./src/generators/init/init#initSchematic",
25
+ "schema": "./src/generators/init/schema.json",
26
+ "description": "Initialize the `@nrwl/express` plugin.",
27
+ "aliases": ["ng-add"],
28
+ "hidden": true
29
+ },
30
+
31
+ "application": {
32
+ "factory": "./src/generators/application/application#applicationSchematic",
33
+ "schema": "./src/generators/application/schema.json",
34
+ "aliases": ["app"],
35
+ "x-type": "application",
36
+ "description": "Create an Express application."
37
+ }
38
+ }
39
+ }
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { applicationGenerator } from './src/generators/application/application';
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applicationGenerator = void 0;
4
+ var application_1 = require("./src/generators/application/application");
5
+ Object.defineProperty(exports, "applicationGenerator", { enumerable: true, get: function () { return application_1.applicationGenerator; } });
6
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/express/index.ts"],"names":[],"mappings":";;;AAAA,wEAAgF;AAAvE,mHAAA,oBAAoB,OAAA"}
@@ -0,0 +1,34 @@
1
+ {
2
+ "generators": {
3
+ "update-16-0-0-add-nx-packages": {
4
+ "cli": "nx",
5
+ "version": "16.0.0-beta.1",
6
+ "description": "Replace @nrwl/express with @nx/express",
7
+ "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
8
+ }
9
+ },
10
+ "packageJsonUpdates": {
11
+ "13.7.0": {
12
+ "version": "13.7.0",
13
+ "packages": {
14
+ "express": {
15
+ "version": "4.17.2",
16
+ "alwaysAddToPackageJson": false
17
+ },
18
+ "@types/express": {
19
+ "version": "4.17.13",
20
+ "alwaysAddToPackageJson": false
21
+ }
22
+ }
23
+ },
24
+ "14.5.0": {
25
+ "version": "14.5.0-beta.4",
26
+ "packages": {
27
+ "express": {
28
+ "version": "^4.18.1",
29
+ "alwaysAddToPackageJson": false
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@nx/express",
3
+ "version": "16.0.0-beta.1",
4
+ "private": false,
5
+ "description": "The Nx Plugin for Express contains executors and generators for allowing your workspace to create powerful Express Node applications and APIs.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/nrwl/nx.git",
9
+ "directory": "packages/express"
10
+ },
11
+ "keywords": [
12
+ "Monorepo",
13
+ "Node",
14
+ "Express",
15
+ "Jest",
16
+ "Cypress",
17
+ "CLI"
18
+ ],
19
+ "main": "./index",
20
+ "typings": "./index.d.ts",
21
+ "author": "Victor Savkin",
22
+ "license": "MIT",
23
+ "bugs": {
24
+ "url": "https://github.com/nrwl/nx/issues"
25
+ },
26
+ "homepage": "https://nx.dev",
27
+ "schematics": "./generators.json",
28
+ "ng-update": {
29
+ "requirements": {},
30
+ "migrations": "./migrations.json"
31
+ },
32
+ "dependencies": {
33
+ "@nrwl/express": "16.0.0-beta.1",
34
+ "@nx/devkit": "16.0.0-beta.1",
35
+ "@nx/node": "16.0.0-beta.1"
36
+ },
37
+ "peerDependencies": {
38
+ "express": "^4.18.1"
39
+ },
40
+ "peerDependenciesMeta": {
41
+ "express": {
42
+ "optional": true
43
+ }
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "types": "./index.d.ts",
49
+ "gitHead": "abf534c265f5aa3aac146e55bb31de598ea281d7"
50
+ }
@@ -0,0 +1,5 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { Schema } from './schema';
3
+ export declare function applicationGenerator(tree: Tree, schema: Schema): Promise<() => Promise<void>>;
4
+ export default applicationGenerator;
5
+ export declare const applicationSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applicationSchematic = exports.applicationGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const node_1 = require("@nx/node");
7
+ const path_1 = require("path");
8
+ const init_1 = require("../init/init");
9
+ function addTypes(tree, options) {
10
+ (0, devkit_1.updateJson)(tree, (0, path_1.join)(options.appProjectRoot, 'tsconfig.app.json'), (json) => {
11
+ json.compilerOptions.types = [...json.compilerOptions.types, 'express'];
12
+ return json;
13
+ });
14
+ }
15
+ function addMainFile(tree, options) {
16
+ tree.write((0, path_1.join)(options.appProjectRoot, `src/main.${options.js ? 'js' : 'ts'}`), `/**
17
+ * This is not a production server yet!
18
+ * This is only a minimal backend to get started.
19
+ */
20
+
21
+ import express from 'express';
22
+ import * as path from 'path';
23
+
24
+ const app = express();
25
+
26
+ app.use('/assets', express.static(path.join(__dirname, 'assets')));
27
+
28
+ app.get('/api', (req, res) => {
29
+ res.send({ message: 'Welcome to ${options.name}!' });
30
+ });
31
+
32
+ const port = process.env.PORT || 3333;
33
+ const server = app.listen(port, () => {
34
+ console.log(\`Listening at http://localhost:\${port}/api\`);
35
+ });
36
+ server.on('error', console.error);
37
+ `);
38
+ if (options.js) {
39
+ (0, devkit_1.toJS)(tree);
40
+ }
41
+ }
42
+ // TODO (nicholas): Remove After Nx 16
43
+ // @deprecated Use `nx g @nrwl/node:app --framework=express instead.
44
+ function applicationGenerator(tree, schema) {
45
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
+ console.warn('As of Nx 16 using `nx g @nrwl/express:app` has been deprecated! Use `nx g @nrwl/node:app --framework=express instead.');
47
+ const options = normalizeOptions(tree, schema);
48
+ const initTask = yield (0, init_1.initGenerator)(tree, Object.assign(Object.assign({}, options), { skipFormat: true }));
49
+ const applicationTask = yield (0, node_1.applicationGenerator)(tree, Object.assign(Object.assign({}, schema), { bundler: 'webpack', skipFormat: true }));
50
+ addMainFile(tree, options);
51
+ addTypes(tree, options);
52
+ if (!options.skipFormat) {
53
+ yield (0, devkit_1.formatFiles)(tree);
54
+ }
55
+ return () => tslib_1.__awaiter(this, void 0, void 0, function* () {
56
+ yield initTask();
57
+ yield applicationTask();
58
+ });
59
+ });
60
+ }
61
+ exports.applicationGenerator = applicationGenerator;
62
+ exports.default = applicationGenerator;
63
+ exports.applicationSchematic = (0, devkit_1.convertNxGenerator)(applicationGenerator);
64
+ function normalizeOptions(host, options) {
65
+ const { layoutDirectory, projectDirectory } = (0, devkit_1.extractLayoutDirectory)(options.directory);
66
+ const appDirectory = projectDirectory
67
+ ? `${(0, devkit_1.names)(projectDirectory).fileName}/${(0, devkit_1.names)(options.name).fileName}`
68
+ : (0, devkit_1.names)(options.name).fileName;
69
+ const appsDir = layoutDirectory !== null && layoutDirectory !== void 0 ? layoutDirectory : (0, devkit_1.getWorkspaceLayout)(host).appsDir;
70
+ const appProjectRoot = (0, devkit_1.joinPathFragments)(appsDir, appDirectory);
71
+ return Object.assign(Object.assign({}, options), { appProjectRoot });
72
+ }
73
+ //# sourceMappingURL=application.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/express/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAAA,uCASoB;AAEpB,mCAA4E;AAC5E,+BAA4B;AAC5B,uCAA6C;AAO7C,SAAS,QAAQ,CAAC,IAAU,EAAE,OAAyB;IACrD,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC,EACjD,CAAC,IAAI,EAAE,EAAE;QACP,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC;IACd,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,IAAU,EAAE,OAAyB;IACxD,IAAI,CAAC,KAAK,CACR,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,YAAY,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EACpE;;;;;;;;;;;;;oCAagC,OAAO,CAAC,IAAI;;;;;;;;CAQ/C,CACE,CAAC;IAEF,IAAI,OAAO,CAAC,EAAE,EAAE;QACd,IAAA,aAAI,EAAC,IAAI,CAAC,CAAC;KACZ;AACH,CAAC;AACD,sCAAsC;AACtC,oEAAoE;AACpE,SAAsB,oBAAoB,CAAC,IAAU,EAAE,MAAc;;QACnE,OAAO,CAAC,IAAI,CACV,uHAAuH,CACxH,CAAC;QAEF,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAa,EAAC,IAAI,kCAAO,OAAO,KAAE,UAAU,EAAE,IAAI,IAAG,CAAC;QAC7E,MAAM,eAAe,GAAG,MAAM,IAAA,2BAAwB,EAAC,IAAI,kCACtD,MAAM,KACT,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,IAAI,IAChB,CAAC;QACH,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,GAAS,EAAE;YAChB,MAAM,QAAQ,EAAE,CAAC;YACjB,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC,CAAA,CAAC;IACJ,CAAC;CAAA;AAvBD,oDAuBC;AAED,kBAAe,oBAAoB,CAAC;AACvB,QAAA,oBAAoB,GAAG,IAAA,2BAAkB,EAAC,oBAAoB,CAAC,CAAC;AAE7E,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAAe;IACnD,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,IAAA,+BAAsB,EAClE,OAAO,CAAC,SAAS,CAClB,CAAC;IACF,MAAM,YAAY,GAAG,gBAAgB;QACnC,CAAC,CAAC,GAAG,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAC,QAAQ,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACvE,CAAC,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAEjC,MAAM,OAAO,GAAG,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IACpE,MAAM,cAAc,GAAG,IAAA,0BAAiB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAEhE,uCACK,OAAO,KACV,cAAc,IACd;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { UnitTestRunner } from '../../utils/test-runners';
2
+ import type { Linter } from '@nx/linter';
3
+
4
+ export interface Schema {
5
+ name: string;
6
+ skipFormat: boolean;
7
+ skipPackageJson: boolean;
8
+ directory?: string;
9
+ unitTestRunner: UnitTestRunner;
10
+ tags?: string;
11
+ linter: Linter;
12
+ frontendProject?: string;
13
+ babelJest?: boolean;
14
+ js: boolean;
15
+ pascalCaseFiles: boolean;
16
+ standaloneConfig?: boolean;
17
+ setParserOptionsProject?: boolean;
18
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "SchematicsNxExpressApp",
5
+ "title": "Nx Application Options Schema",
6
+ "description": "Nx Application Options Schema.",
7
+ "type": "object",
8
+ "properties": {
9
+ "name": {
10
+ "description": "The name of the application.",
11
+ "type": "string",
12
+ "$default": {
13
+ "$source": "argv",
14
+ "index": 0
15
+ },
16
+ "x-prompt": "What name would you like to use for the node application?",
17
+ "pattern": "^[a-zA-Z].*$"
18
+ },
19
+ "directory": {
20
+ "description": "The directory of the new application.",
21
+ "type": "string"
22
+ },
23
+ "skipFormat": {
24
+ "description": "Skip formatting files.",
25
+ "type": "boolean",
26
+ "default": false
27
+ },
28
+ "skipPackageJson": {
29
+ "type": "boolean",
30
+ "default": false,
31
+ "description": "Do not add dependencies to `package.json`."
32
+ },
33
+ "linter": {
34
+ "description": "The tool to use for running lint checks.",
35
+ "type": "string",
36
+ "enum": ["eslint"],
37
+ "default": "eslint"
38
+ },
39
+ "unitTestRunner": {
40
+ "type": "string",
41
+ "enum": ["jest", "none"],
42
+ "description": "Test runner to use for unit tests.",
43
+ "default": "jest"
44
+ },
45
+ "tags": {
46
+ "type": "string",
47
+ "description": "Add tags to the application (used for linting)."
48
+ },
49
+ "frontendProject": {
50
+ "type": "string",
51
+ "description": "Frontend project that needs to access this application. This sets up proxy configuration."
52
+ },
53
+ "babelJest": {
54
+ "type": "boolean",
55
+ "description": "Use `babel` instead `ts-jest`.",
56
+ "default": false
57
+ },
58
+ "pascalCaseFiles": {
59
+ "type": "boolean",
60
+ "description": "Use pascal case file names.",
61
+ "alias": "P",
62
+ "default": false
63
+ },
64
+ "js": {
65
+ "type": "boolean",
66
+ "description": "Generate JavaScript files rather than TypeScript files.",
67
+ "default": false
68
+ },
69
+ "standaloneConfig": {
70
+ "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
71
+ "type": "boolean",
72
+ "default": true,
73
+ "x-deprecated": "Nx only supports standaloneConfig"
74
+ },
75
+ "setParserOptionsProject": {
76
+ "type": "boolean",
77
+ "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
78
+ "default": false
79
+ }
80
+ },
81
+ "required": []
82
+ }
@@ -0,0 +1,5 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import type { Schema } from './schema';
3
+ export declare function initGenerator(tree: Tree, schema: Schema): Promise<() => Promise<void>>;
4
+ export default initGenerator;
5
+ export declare const initSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initSchematic = exports.initGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const node_1 = require("@nx/node");
7
+ const versions_1 = require("@nx/node/src/utils/versions");
8
+ const versions_2 = require("../../utils/versions");
9
+ function updateDependencies(tree) {
10
+ (0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nrwl/express'], []);
11
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {
12
+ express: versions_2.expressVersion,
13
+ tslib: versions_1.tslibVersion,
14
+ }, {
15
+ '@types/express': versions_2.expressTypingsVersion,
16
+ '@nrwl/express': versions_2.nxVersion,
17
+ });
18
+ }
19
+ function initGenerator(tree, schema) {
20
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
+ const initTask = yield (0, node_1.initGenerator)(tree, Object.assign(Object.assign({}, schema), { skipFormat: true }));
22
+ const installTask = updateDependencies(tree);
23
+ if (!schema.skipFormat) {
24
+ yield (0, devkit_1.formatFiles)(tree);
25
+ }
26
+ return () => tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ yield initTask();
28
+ yield installTask();
29
+ });
30
+ });
31
+ }
32
+ exports.initGenerator = initGenerator;
33
+ exports.default = initGenerator;
34
+ exports.initSchematic = (0, devkit_1.convertNxGenerator)(initGenerator);
35
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/express/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,uCAMoB;AACpB,mCAA8D;AAC9D,0DAA2D;AAC3D,mDAI8B;AAG9B,SAAS,kBAAkB,CAAC,IAAU;IACpC,IAAA,0CAAiC,EAAC,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC;IAE/D,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ;QACE,OAAO,EAAE,yBAAc;QACvB,KAAK,EAAE,uBAAY;KACpB,EACD;QACE,gBAAgB,EAAE,gCAAqB;QACvC,eAAe,EAAE,oBAAS;KAC3B,CACF,CAAC;AACJ,CAAC;AAED,SAAsB,aAAa,CAAC,IAAU,EAAE,MAAc;;QAC5D,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAiB,EAAC,IAAI,kCACxC,MAAM,KACT,UAAU,EAAE,IAAI,IAChB,CAAC;QACH,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,GAAS,EAAE;YAChB,MAAM,QAAQ,EAAE,CAAC;YACjB,MAAM,WAAW,EAAE,CAAC;QACtB,CAAC,CAAA,CAAC;IACJ,CAAC;CAAA;AAdD,sCAcC;AAED,kBAAe,aAAa,CAAC;AAChB,QAAA,aAAa,GAAG,IAAA,2BAAkB,EAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export interface Schema {
2
+ unitTestRunner?: 'jest' | 'none';
3
+ skipFormat?: boolean;
4
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxExpressInit",
5
+ "title": "Init Express Plugin",
6
+ "description": "Init Express Plugin.",
7
+ "type": "object",
8
+ "properties": {
9
+ "unitTestRunner": {
10
+ "description": "Adds the specified unit test runner.",
11
+ "type": "string",
12
+ "enum": ["jest", "none"],
13
+ "default": "jest"
14
+ },
15
+ "skipFormat": {
16
+ "description": "Skip formatting files.",
17
+ "type": "boolean",
18
+ "default": false
19
+ }
20
+ },
21
+ "required": []
22
+ }
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function replacePackage(tree: Tree): Promise<void>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
6
+ function replacePackage(tree) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ yield (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/express', '@nx/express');
9
+ yield (0, devkit_1.formatFiles)(tree);
10
+ });
11
+ }
12
+ exports.default = replacePackage;
13
+ //# sourceMappingURL=update-16-0-0-add-nx-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-16-0-0-add-nx-packages.js","sourceRoot":"","sources":["../../../../../../packages/express/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAC/C,0EAAuF;AAEvF,SAA8B,cAAc,CAAC,IAAU;;QACrD,MAAM,IAAA,iDAA+B,EAAC,IAAI,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;QAE5E,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAJD,iCAIC"}
@@ -0,0 +1,3 @@
1
+ export declare const nxVersion: any;
2
+ export declare const expressVersion = "^4.18.1";
3
+ export declare const expressTypingsVersion = "4.17.13";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.expressTypingsVersion = exports.expressVersion = exports.nxVersion = void 0;
4
+ exports.nxVersion = require('../../package.json').version;
5
+ exports.expressVersion = '^4.18.1';
6
+ exports.expressTypingsVersion = '4.17.13';
7
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/express/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,cAAc,GAAG,SAAS,CAAC;AAC3B,QAAA,qBAAqB,GAAG,SAAS,CAAC"}