@nrwl/angular 15.9.0-beta.8 → 15.9.0-rc.0
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/executors.json +0 -10
- package/migrations.json +6 -0
- package/package.json +9 -9
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +1 -6
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js.map +1 -1
- package/src/generators/application/lib/add-e2e.js +14 -1
- package/src/generators/application/lib/add-e2e.js.map +1 -1
- package/src/generators/application/lib/add-unit-test-runner.js +0 -1
- package/src/generators/application/lib/add-unit-test-runner.js.map +1 -1
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +1 -1
- package/src/generators/component-cypress-spec/component-cypress-spec.js +27 -24
- package/src/generators/component-cypress-spec/component-cypress-spec.js.map +1 -1
- package/src/generators/component-story/component-story.d.ts +1 -1
- package/src/generators/component-story/component-story.js +19 -16
- package/src/generators/component-story/component-story.js.map +1 -1
- package/src/generators/init/init.js +53 -46
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/library/library.js +4 -4
- package/src/generators/library/library.js.map +1 -1
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +2 -4
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js.map +1 -1
- package/src/generators/setup-mf/lib/setup-serve-target.js +1 -1
- package/src/generators/setup-mf/lib/setup-serve-target.js.map +1 -1
- package/src/generators/setup-mf/setup-mf.d.ts +1 -1
- package/src/generators/setup-mf/setup-mf.js +4 -0
- package/src/generators/setup-mf/setup-mf.js.map +1 -1
- package/src/generators/setup-ssr/setup-ssr.js +5 -7
- package/src/generators/setup-ssr/setup-ssr.js.map +1 -1
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.js +5 -4
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.js.map +1 -1
- package/src/generators/stories/stories.d.ts +1 -1
- package/src/generators/stories/stories.js +40 -37
- package/src/generators/stories/stories.js.map +1 -1
- package/src/generators/storybook-configuration/lib/generate-stories.d.ts +1 -1
- package/src/generators/storybook-configuration/lib/generate-stories.js +10 -7
- package/src/generators/storybook-configuration/lib/generate-stories.js.map +1 -1
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +1 -0
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js.map +1 -1
- package/src/generators/storybook-configuration/schema.d.ts +1 -0
- package/src/generators/storybook-configuration/schema.json +7 -0
- package/src/generators/storybook-configuration/storybook-configuration.js +1 -1
- package/src/generators/storybook-configuration/storybook-configuration.js.map +1 -1
- package/src/generators/utils/dependencies.js +6 -5
- package/src/generators/utils/dependencies.js.map +1 -1
- package/src/generators/utils/insert-ngmodule-import.js +5 -2
- package/src/generators/utils/insert-ngmodule-import.js.map +1 -1
- package/src/generators/utils/testing.js +12 -12
- package/src/generators/utils/testing.js.map +1 -1
- package/src/generators/utils/version-utils.d.ts +2 -0
- package/src/generators/utils/version-utils.js +13 -1
- package/src/generators/utils/version-utils.js.map +1 -1
- package/src/generators/utils/warn-for-schematic-usage.js +1 -1
- package/src/generators/utils/warn-for-schematic-usage.js.map +1 -1
- package/src/migrations/update-15-9-0/update-file-server-executor.d.ts +2 -0
- package/src/migrations/update-15-9-0/update-file-server-executor.js +46 -0
- package/src/migrations/update-15-9-0/update-file-server-executor.js.map +1 -0
- package/src/executors/file-server/compat.d.ts +0 -2
- package/src/executors/file-server/compat.js +0 -6
- package/src/executors/file-server/compat.js.map +0 -1
- package/src/executors/file-server/file-server.impl.d.ts +0 -8
- package/src/executors/file-server/file-server.impl.js +0 -177
- package/src/executors/file-server/file-server.impl.js.map +0 -1
- package/src/executors/file-server/schema.d.ts +0 -16
- package/src/executors/file-server/schema.json +0 -80
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-utils.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/version-utils.ts"],"names":[],"mappings":";;;AACA,yCAAsE;AACtE,mCAA8C;AAC9C,mDAAsD;
|
|
1
|
+
{"version":3,"file":"version-utils.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/version-utils.ts"],"names":[],"mappings":";;;AACA,yCAAsE;AACtE,mCAA8C;AAC9C,uDAAuD;AACvD,mDAAsD;AACtD,2FAAsF;AAEtF,SAAgB,+CAA+C,CAC7D,IAAU;;IAEV,MAAM,mBAAmB,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAC;IAElE,MAAM,mBAAmB,GAAG;QAC1B,EAAE,EAAE,aAAa;KAClB,CAAC;IAEF,OAAO,MAAA,mBAAmB,CAAC,mBAAmB,CAAC,mCAAI,IAAI,CAAC;AAC1D,CAAC;AAVD,0GAUC;AAED,SAAgB,0BAA0B,CAAC,IAAU;;IACnD,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC/C,MAAM,uBAAuB,GAC3B,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAEhE,IACE,CAAC,uBAAuB;QACxB,uBAAuB,KAAK,QAAQ;QACpC,uBAAuB,KAAK,MAAM,EAClC;QACA,OAAO,MAAA,IAAA,cAAK,EAAC,yBAAc,CAAC,mCAAI,IAAA,eAAM,EAAC,yBAAc,CAAC,CAAC,OAAO,CAAC;KAChE;IAED,OAAO,CACL,MAAA,IAAA,cAAK,EAAC,uBAAuB,CAAC,mCAAI,IAAA,eAAM,EAAC,uBAAuB,CAAC,CAAC,OAAO,CAC1E,CAAC;AACJ,CAAC;AAhBD,gEAgBC;AAED,SAAgB,+BAA+B,CAAC,IAAU;IACxD,OAAO,IAAA,cAAK,EAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,0EAEC;AAED,SAAgB,8BAA8B,CAAC,IAAU;IACvD,MAAM,gBAAgB,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAE1D,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,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C,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAG,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,SAAS,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;IAC/C,MAAM,YAAY,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;IAErD,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,eAAe,CAChB,CAAC;AACJ,CAAC;AA5BD,0FA4BC;AAED,SAAgB,QAAQ,CAAC,IAAU;IACjC,MAAM,mBAAmB,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAC;IAClE,QAAQ,mBAAmB,EAAE;QAC3B,KAAK,EAAE;YACL,OAAO,yDAA0B,CAAC,UAAU,CAAC;QAC/C;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC;AARD,4BAQC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.warnForSchematicUsage = void 0;
|
|
4
4
|
function warnForSchematicUsage(convertedGenerator) {
|
|
5
|
-
console.warn('Running generators as schematics is deprecated and will be removed in v17.');
|
|
5
|
+
console.warn('Running generators as schematics is deprecated and will be removed in v17. Prefer `callRule(convertNxGenerator(generator)(options), tree, context)` where "generator" is the name of the generator you wish to use.');
|
|
6
6
|
return convertedGenerator;
|
|
7
7
|
}
|
|
8
8
|
exports.warnForSchematicUsage = warnForSchematicUsage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warn-for-schematic-usage.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/warn-for-schematic-usage.ts"],"names":[],"mappings":";;;AAAA,SAAgB,qBAAqB,CAAI,kBAAqB;IAC5D,OAAO,CAAC,IAAI,CACV,
|
|
1
|
+
{"version":3,"file":"warn-for-schematic-usage.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/warn-for-schematic-usage.ts"],"names":[],"mappings":";;;AAAA,SAAgB,qBAAqB,CAAI,kBAAqB;IAC5D,OAAO,CAAC,IAAI,CACV,qNAAqN,CACtN,CAAC;IAEF,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAND,sDAMC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const versions_1 = require("../../utils/versions");
|
|
6
|
+
function updateFileServerExecutor(tree) {
|
|
7
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
const oldExecutor = '@nrwl/angular:file-server';
|
|
9
|
+
const newExecutor = '@nrwl/web:file-server';
|
|
10
|
+
let needsNrwlWeb = false;
|
|
11
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
12
|
+
if (nxJson.targetDefaults) {
|
|
13
|
+
let nxJsonChanged = false;
|
|
14
|
+
for (const [targetName, target] of Object.entries(nxJson.targetDefaults)) {
|
|
15
|
+
if (target.executor === oldExecutor) {
|
|
16
|
+
nxJson.targetDefaults[targetName].executor = newExecutor;
|
|
17
|
+
nxJsonChanged = true;
|
|
18
|
+
needsNrwlWeb = true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (nxJsonChanged) {
|
|
22
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
26
|
+
for (const [projectName, project] of projects.entries()) {
|
|
27
|
+
let projectChanged = false;
|
|
28
|
+
for (const [targetName, target] of Object.entries(project.targets)) {
|
|
29
|
+
if (target.executor === oldExecutor) {
|
|
30
|
+
project.targets[targetName].executor = newExecutor;
|
|
31
|
+
projectChanged = true;
|
|
32
|
+
needsNrwlWeb = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (projectChanged) {
|
|
36
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (needsNrwlWeb) {
|
|
40
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nrwl/web': versions_1.nxVersion });
|
|
41
|
+
}
|
|
42
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
exports.default = updateFileServerExecutor;
|
|
46
|
+
//# sourceMappingURL=update-file-server-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-file-server-executor.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-15-9-0/update-file-server-executor.ts"],"names":[],"mappings":";;;AACA,yCAOsB;AACtB,mDAAiD;AAEjD,SAA8B,wBAAwB,CAAC,IAAU;;QAC/D,MAAM,WAAW,GAAG,2BAA2B,CAAC;QAChD,MAAM,WAAW,GAAG,uBAAuB,CAAC;QAC5C,IAAI,YAAY,GAAG,KAAK,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;QAChC,IAAI,MAAM,CAAC,cAAc,EAAE;YACzB,IAAI,aAAa,GAAG,KAAK,CAAC;YAE1B,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;gBACxE,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE;oBACnC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,GAAG,WAAW,CAAC;oBACzD,aAAa,GAAG,IAAI,CAAC;oBACrB,YAAY,GAAG,IAAI,CAAC;iBACrB;aACF;YAED,IAAI,aAAa,EAAE;gBACjB,IAAA,qBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;aAC5B;SACF;QAED,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,KAAK,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;YACvD,IAAI,cAAc,GAAG,KAAK,CAAC;YAE3B,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;gBAClE,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE;oBACnC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,GAAG,WAAW,CAAC;oBACnD,cAAc,GAAG,IAAI,CAAC;oBACtB,YAAY,GAAG,IAAI,CAAC;iBACrB;aACF;YAED,IAAI,cAAc,EAAE;gBAClB,IAAA,mCAA0B,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;aACxD;SACF;QAED,IAAI,YAAY,EAAE;YAChB,IAAA,qCAA4B,EAAC,IAAI,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,oBAAS,EAAE,CAAC,CAAC;SACpE;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AA5CD,2CA4CC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
-
const file_server_impl_1 = require("./file-server.impl");
|
|
5
|
-
exports.default = (0, devkit_1.convertNxExecutor)(file_server_impl_1.default);
|
|
6
|
-
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/executors/file-server/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AAEjD,yDAAoD;AAEpD,kBAAe,IAAA,0BAAiB,EAAC,0BAAkB,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
-
import { Schema } from './schema';
|
|
3
|
-
export default function fileServerExecutor(options: Schema, context: ExecutorContext): AsyncGenerator<{
|
|
4
|
-
success: boolean;
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
}, {
|
|
7
|
-
success: boolean;
|
|
8
|
-
}, unknown>;
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const child_process_1 = require("child_process");
|
|
6
|
-
const chokidar_1 = require("chokidar");
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const ignore_1 = require("ignore");
|
|
9
|
-
const package_json_1 = require("nx/src/utils/package-json");
|
|
10
|
-
const os_1 = require("os");
|
|
11
|
-
const path_1 = require("path");
|
|
12
|
-
// platform specific command name
|
|
13
|
-
const pmCmd = (0, os_1.platform)() === 'win32' ? `npx.cmd` : 'npx';
|
|
14
|
-
function getHttpServerArgs(options) {
|
|
15
|
-
const args = ['-c-1'];
|
|
16
|
-
if (options.cors) {
|
|
17
|
-
args.push(`--cors`);
|
|
18
|
-
}
|
|
19
|
-
if (options.port) {
|
|
20
|
-
args.push(`-p=${options.port}`);
|
|
21
|
-
}
|
|
22
|
-
if (options.host) {
|
|
23
|
-
args.push(`-a=${options.host}`);
|
|
24
|
-
}
|
|
25
|
-
if (options.ssl) {
|
|
26
|
-
args.push(`-S`);
|
|
27
|
-
}
|
|
28
|
-
if (options.sslCert) {
|
|
29
|
-
args.push(`-C=${options.sslCert}`);
|
|
30
|
-
}
|
|
31
|
-
if (options.sslKey) {
|
|
32
|
-
args.push(`-K=${options.sslKey}`);
|
|
33
|
-
}
|
|
34
|
-
if (options.proxyUrl) {
|
|
35
|
-
args.push(`-P=${options.proxyUrl}`);
|
|
36
|
-
}
|
|
37
|
-
if (options.proxyOptions) {
|
|
38
|
-
Object.keys(options.proxyOptions).forEach((key) => {
|
|
39
|
-
args.push(`--proxy-options.${key}=options.proxyOptions[key]`);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return args;
|
|
43
|
-
}
|
|
44
|
-
function getBuildTargetCommand(options) {
|
|
45
|
-
const cmd = ['nx', 'run', options.buildTarget];
|
|
46
|
-
if (options.parallel) {
|
|
47
|
-
cmd.push(`--parallel`);
|
|
48
|
-
}
|
|
49
|
-
if (options.maxParallel) {
|
|
50
|
-
cmd.push(`--maxParallel=${options.maxParallel}`);
|
|
51
|
-
}
|
|
52
|
-
return cmd;
|
|
53
|
-
}
|
|
54
|
-
function getBuildTargetOutputPath(options, context) {
|
|
55
|
-
let buildOptions;
|
|
56
|
-
try {
|
|
57
|
-
const [project, target, config] = options.buildTarget.split(':');
|
|
58
|
-
const buildTarget = context.projectsConfigurations.projects[project].targets[target];
|
|
59
|
-
buildOptions = config
|
|
60
|
-
? Object.assign(Object.assign({}, buildTarget.options), buildTarget.configurations[config]) : buildTarget.options;
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
throw new Error(`Invalid buildTarget: ${options.buildTarget}`);
|
|
64
|
-
}
|
|
65
|
-
// TODO: vsavkin we should also check outputs
|
|
66
|
-
const outputPath = buildOptions.outputPath;
|
|
67
|
-
if (!outputPath) {
|
|
68
|
-
throw new Error(`Invalid buildTarget: ${options.buildTarget}. The target must contain outputPath property.`);
|
|
69
|
-
}
|
|
70
|
-
return outputPath;
|
|
71
|
-
}
|
|
72
|
-
function getIgnoredGlobs(root) {
|
|
73
|
-
const ig = (0, ignore_1.default)();
|
|
74
|
-
try {
|
|
75
|
-
ig.add((0, fs_1.readFileSync)(`${root}/.gitignore`, 'utf-8'));
|
|
76
|
-
}
|
|
77
|
-
catch (_a) { }
|
|
78
|
-
try {
|
|
79
|
-
ig.add((0, fs_1.readFileSync)(`${root}/.nxignore`, 'utf-8'));
|
|
80
|
-
}
|
|
81
|
-
catch (_b) { }
|
|
82
|
-
return ig;
|
|
83
|
-
}
|
|
84
|
-
function createFileWatcher(root, changeHandler) {
|
|
85
|
-
const ignoredGlobs = getIgnoredGlobs(root);
|
|
86
|
-
const layout = (0, devkit_1.workspaceLayout)();
|
|
87
|
-
const watcher = (0, chokidar_1.watch)([
|
|
88
|
-
(0, devkit_1.joinPathFragments)(layout.appsDir, '**'),
|
|
89
|
-
(0, devkit_1.joinPathFragments)(layout.libsDir, '**'),
|
|
90
|
-
], {
|
|
91
|
-
cwd: root,
|
|
92
|
-
ignoreInitial: true,
|
|
93
|
-
});
|
|
94
|
-
watcher.on('all', (_event, path) => {
|
|
95
|
-
if (ignoredGlobs.ignores(path))
|
|
96
|
-
return;
|
|
97
|
-
changeHandler();
|
|
98
|
-
});
|
|
99
|
-
return () => watcher.close();
|
|
100
|
-
}
|
|
101
|
-
function fileServerExecutor(options, context) {
|
|
102
|
-
return tslib_1.__asyncGenerator(this, arguments, function* fileServerExecutor_1() {
|
|
103
|
-
let running = false;
|
|
104
|
-
const run = () => {
|
|
105
|
-
if (!running) {
|
|
106
|
-
running = true;
|
|
107
|
-
try {
|
|
108
|
-
const args = getBuildTargetCommand(options);
|
|
109
|
-
(0, child_process_1.execFileSync)(pmCmd, args, {
|
|
110
|
-
stdio: [0, 1, 2],
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
catch (_a) {
|
|
114
|
-
throw new Error("Project failed to build. Check the build's error output for more information.");
|
|
115
|
-
}
|
|
116
|
-
running = false;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
let disposeWatch;
|
|
120
|
-
if (options.watch) {
|
|
121
|
-
disposeWatch = createFileWatcher(context.root, run);
|
|
122
|
-
}
|
|
123
|
-
// perform initial run
|
|
124
|
-
run();
|
|
125
|
-
const outputPath = getBuildTargetOutputPath(options, context);
|
|
126
|
-
if (options.spa) {
|
|
127
|
-
const src = (0, path_1.join)(outputPath, 'index.html');
|
|
128
|
-
const dst = (0, path_1.join)(outputPath, '404.html');
|
|
129
|
-
// See: https://github.com/http-party/http-server#magic-files
|
|
130
|
-
(0, fs_1.copyFileSync)(src, dst);
|
|
131
|
-
}
|
|
132
|
-
const args = getHttpServerArgs(options);
|
|
133
|
-
const { path: pathToHttpServerPkgJson, packageJson } = (0, package_json_1.readModulePackageJson)('http-server');
|
|
134
|
-
const pathToHttpServerBin = packageJson.bin['http-server'];
|
|
135
|
-
const pathToHttpServer = (0, path_1.resolve)(pathToHttpServerPkgJson.replace('package.json', ''), pathToHttpServerBin);
|
|
136
|
-
const serve = (0, child_process_1.fork)(pathToHttpServer, [outputPath, ...args], {
|
|
137
|
-
stdio: 'pipe',
|
|
138
|
-
cwd: context.root,
|
|
139
|
-
env: Object.assign({ FORCE_COLOR: 'true' }, process.env),
|
|
140
|
-
});
|
|
141
|
-
const processExitListener = () => {
|
|
142
|
-
serve.kill();
|
|
143
|
-
if (disposeWatch) {
|
|
144
|
-
disposeWatch();
|
|
145
|
-
}
|
|
146
|
-
if (options.spa) {
|
|
147
|
-
(0, fs_1.unlinkSync)((0, path_1.join)(outputPath, '404.html'));
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
process.on('exit', processExitListener);
|
|
151
|
-
process.on('SIGTERM', processExitListener);
|
|
152
|
-
serve.stdout.on('data', (chunk) => {
|
|
153
|
-
if (chunk.toString().indexOf('GET') === -1) {
|
|
154
|
-
process.stdout.write(chunk);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
serve.stderr.on('data', (chunk) => {
|
|
158
|
-
process.stderr.write(chunk);
|
|
159
|
-
});
|
|
160
|
-
yield yield tslib_1.__await({
|
|
161
|
-
success: true,
|
|
162
|
-
baseUrl: `${options.ssl ? 'https' : 'http'}://${options.host}:${options.port}`,
|
|
163
|
-
});
|
|
164
|
-
return yield tslib_1.__await(new Promise((res) => {
|
|
165
|
-
serve.on('exit', (code) => {
|
|
166
|
-
if (code == 0) {
|
|
167
|
-
res({ success: true });
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
res({ success: false });
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}));
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
exports.default = fileServerExecutor;
|
|
177
|
-
//# sourceMappingURL=file-server.impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/executors/file-server/file-server.impl.ts"],"names":[],"mappings":";;;AAAA,yCAIsB;AACtB,iDAAmD;AACnD,uCAAiC;AACjC,2BAA4D;AAC5D,mCAA4B;AAC5B,4DAAkE;AAClE,2BAA8B;AAC9B,+BAAqC;AAGrC,iCAAiC;AACjC,MAAM,KAAK,GAAG,IAAA,aAAQ,GAAE,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AAEzD,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAEtB,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACrB;IAED,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;KACjC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;KACjC;IACD,IAAI,OAAO,CAAC,GAAG,EAAE;QACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACjB;IACD,IAAI,OAAO,CAAC,OAAO,EAAE;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;KACpC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE;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AC,KAAK,EAAE,EAAE;YAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,4BAAM;YACJ,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,OAAO,CAAC,IAAI,IAC1D,OAAO,CAAC,IACV,EAAE;SACH,CAAA,CAAC;QAEF,6BAAO,IAAI,OAAO,CAAuB,CAAC,GAAG,EAAE,EAAE;YAC/C,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACxB,IAAI,IAAI,IAAI,CAAC,EAAE;oBACb,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxB;qBAAM;oBACL,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;iBACzB;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,EAAC;IACL,CAAC;CAAA;AAjGD,qCAiGC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface Schema {
|
|
2
|
-
host: string;
|
|
3
|
-
port: number;
|
|
4
|
-
ssl: boolean;
|
|
5
|
-
sslKey?: string;
|
|
6
|
-
sslCert?: string;
|
|
7
|
-
proxyUrl?: string;
|
|
8
|
-
buildTarget: string;
|
|
9
|
-
parallel: boolean;
|
|
10
|
-
maxParallel?: number;
|
|
11
|
-
withDeps: boolean;
|
|
12
|
-
proxyOptions?: object;
|
|
13
|
-
watch?: boolean;
|
|
14
|
-
spa?: boolean;
|
|
15
|
-
cors?: boolean;
|
|
16
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"title": "File Server",
|
|
5
|
-
"description": "Serves a static web application from a folder.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"cli": "nx",
|
|
8
|
-
"properties": {
|
|
9
|
-
"buildTarget": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "Target which builds the application."
|
|
12
|
-
},
|
|
13
|
-
"parallel": {
|
|
14
|
-
"type": "boolean",
|
|
15
|
-
"description": "Build the target in parallel.",
|
|
16
|
-
"default": true
|
|
17
|
-
},
|
|
18
|
-
"maxParallel": {
|
|
19
|
-
"type": "number",
|
|
20
|
-
"description": "Max number of parallel jobs."
|
|
21
|
-
},
|
|
22
|
-
"port": {
|
|
23
|
-
"type": "number",
|
|
24
|
-
"description": "Port to listen on.",
|
|
25
|
-
"default": 4200
|
|
26
|
-
},
|
|
27
|
-
"host": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"description": "Host to listen on.",
|
|
30
|
-
"default": "localhost"
|
|
31
|
-
},
|
|
32
|
-
"ssl": {
|
|
33
|
-
"type": "boolean",
|
|
34
|
-
"description": "Serve using `HTTPS`.",
|
|
35
|
-
"default": false
|
|
36
|
-
},
|
|
37
|
-
"sslKey": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"description": "SSL key to use for serving `HTTPS`."
|
|
40
|
-
},
|
|
41
|
-
"sslCert": {
|
|
42
|
-
"type": "string",
|
|
43
|
-
"description": "SSL certificate to use for serving `HTTPS`."
|
|
44
|
-
},
|
|
45
|
-
"proxyUrl": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"description": "URL to proxy unhandled requests to."
|
|
48
|
-
},
|
|
49
|
-
"proxyOptions": {
|
|
50
|
-
"type": "object",
|
|
51
|
-
"description": "Options for the proxy used by `http-server`.",
|
|
52
|
-
"default": {},
|
|
53
|
-
"properties": {
|
|
54
|
-
"secure": {
|
|
55
|
-
"type": "boolean",
|
|
56
|
-
"default": false
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"additionalProperties": true
|
|
60
|
-
},
|
|
61
|
-
"watch": {
|
|
62
|
-
"type": "boolean",
|
|
63
|
-
"description": "Watch for file changes.",
|
|
64
|
-
"default": false
|
|
65
|
-
},
|
|
66
|
-
"spa": {
|
|
67
|
-
"type": "boolean",
|
|
68
|
-
"description": "Redirect 404 errors to index.html (useful for SPA's).",
|
|
69
|
-
"default": false
|
|
70
|
-
},
|
|
71
|
-
"cors": {
|
|
72
|
-
"type": "boolean",
|
|
73
|
-
"description": "Enable CORS",
|
|
74
|
-
"default": true
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"additionalProperties": false,
|
|
78
|
-
"required": ["buildTarget"],
|
|
79
|
-
"examplesFile": "../../../docs/file-server-examples.md"
|
|
80
|
-
}
|