@abgov/nx-adsp 3.2.0-beta.1 → 3.2.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/README.md +1 -1
- package/package.json +9 -10
- package/src/generators/angular-app/angular-app.spec.ts +42 -52
- package/src/generators/dotnet-service/dotnet-service.spec.ts +8 -9
- package/src/generators/express-service/express-service.js +2 -1
- package/src/generators/express-service/express-service.js.map +1 -1
- package/src/generators/express-service/express-service.spec.ts +2 -2
- package/src/generators/mern/mern.spec.ts +2 -2
- package/src/generators/react-app/react-app.js +3 -2
- package/src/generators/react-app/react-app.js.map +1 -1
- package/src/generators/react-app/react-app.spec.ts +42 -60
- package/src/generators/react-dotnet/react-dotnet.spec.ts +9 -10
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# About this project
|
|
2
|
-
This is the Government of Alberta -
|
|
2
|
+
This is the Government of Alberta - Nx plugin for ADSP apps.
|
|
3
3
|
|
|
4
4
|
The plugin includes generators for application, service, and fullstack solution quick starts. If the peer dependency `@abgov/nx-oc` is found, then OpenShift yml files are also included in the quickstarts. Application stack peer dependencies are required for the associated ADSP application type; for example, `@nrwl/angular` is required for the angular-app, and `@abgov/nx-dotnet` is required for dotnet-service.
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/nx-adsp",
|
|
3
|
-
"version": "3.2.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
-
"description": "Government of Alberta -
|
|
6
|
+
"description": "Government of Alberta - Nx plugin for ADSP apps.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/abgov/nx-tools.git",
|
|
10
10
|
"directory": "packages/nx-adsp"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@
|
|
14
|
-
"@nrwl/
|
|
15
|
-
"@nrwl/
|
|
16
|
-
"@nrwl/
|
|
17
|
-
"@nrwl/react": "^13.4.3"
|
|
13
|
+
"@nrwl/angular": "^14.0.0",
|
|
14
|
+
"@nrwl/devkit": "^14.0.0",
|
|
15
|
+
"@nrwl/express": "^14.0.0",
|
|
16
|
+
"@nrwl/react": "^14.0.0"
|
|
18
17
|
},
|
|
19
18
|
"dependencies": {
|
|
20
|
-
"@angular-devkit/core": "^
|
|
21
|
-
"@angular-devkit/schematics": "^
|
|
19
|
+
"@angular-devkit/core": "^14.0.0",
|
|
20
|
+
"@angular-devkit/schematics": "^14.0.0",
|
|
22
21
|
"camelcase": "^5.3.1"
|
|
23
22
|
},
|
|
24
23
|
"generators": "./generators.json",
|
|
25
|
-
"
|
|
24
|
+
"types": "./src/index.d.ts"
|
|
26
25
|
}
|
|
@@ -6,15 +6,14 @@ import { AngularAppGeneratorSchema } from './schema';
|
|
|
6
6
|
|
|
7
7
|
describe('angular app generator', () => {
|
|
8
8
|
let appTree: Tree;
|
|
9
|
-
const options: AngularAppGeneratorSchema = {
|
|
9
|
+
const options: AngularAppGeneratorSchema = {
|
|
10
|
+
name: 'test',
|
|
11
|
+
tenant: 'testtenant',
|
|
12
|
+
};
|
|
10
13
|
|
|
11
14
|
beforeEach(() => {
|
|
12
|
-
appTree = createTreeWithEmptyWorkspace(
|
|
13
|
-
jest.setTimeout(28000)
|
|
15
|
+
appTree = createTreeWithEmptyWorkspace();
|
|
14
16
|
});
|
|
15
|
-
afterAll(() => {
|
|
16
|
-
jest.clearAllTimers()
|
|
17
|
-
})
|
|
18
17
|
|
|
19
18
|
it('should run successfully', async () => {
|
|
20
19
|
await angularApp(appTree, options);
|
|
@@ -22,48 +21,42 @@ describe('angular app generator', () => {
|
|
|
22
21
|
expect(config).toBeDefined();
|
|
23
22
|
expect(config.root).toBe('apps/test');
|
|
24
23
|
expect(appTree.exists('apps/test/nginx.conf')).toBeTruthy();
|
|
25
|
-
},
|
|
24
|
+
}, 30000);
|
|
26
25
|
|
|
27
|
-
it
|
|
28
|
-
const host = createTreeWithEmptyWorkspace(
|
|
29
|
-
await angularApp(
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
);
|
|
26
|
+
it('can add nginx proxy', async () => {
|
|
27
|
+
const host = createTreeWithEmptyWorkspace();
|
|
28
|
+
await angularApp(host, {
|
|
29
|
+
...options,
|
|
30
|
+
proxy: {
|
|
31
|
+
location: '/test/',
|
|
32
|
+
proxyPass: 'http://test-service:3333/',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
39
35
|
|
|
40
36
|
const config = readProjectConfiguration(host, 'test');
|
|
41
37
|
expect(config.root).toBe('apps/test');
|
|
42
38
|
|
|
43
39
|
expect(host.exists('apps/test/nginx.conf')).toBeTruthy();
|
|
44
|
-
expect(
|
|
45
|
-
|
|
46
|
-
)
|
|
40
|
+
expect(host.read('apps/test/nginx.conf').toString()).toContain(
|
|
41
|
+
'http://test-service:3333/'
|
|
42
|
+
);
|
|
47
43
|
});
|
|
48
44
|
|
|
49
|
-
it
|
|
50
|
-
const host = createTreeWithEmptyWorkspace(
|
|
51
|
-
await angularApp(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
);
|
|
45
|
+
it('can add multiple nginx proxy', async () => {
|
|
46
|
+
const host = createTreeWithEmptyWorkspace();
|
|
47
|
+
await angularApp(host, {
|
|
48
|
+
...options,
|
|
49
|
+
proxy: [
|
|
50
|
+
{
|
|
51
|
+
location: '/test/',
|
|
52
|
+
proxyPass: 'http://test-service:3333/',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
location: '/test2/',
|
|
56
|
+
proxyPass: 'http://test-service2:3333/',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
67
60
|
|
|
68
61
|
const config = readProjectConfiguration(host, 'test');
|
|
69
62
|
expect(config.root).toBe('apps/test');
|
|
@@ -74,18 +67,15 @@ describe('angular app generator', () => {
|
|
|
74
67
|
expect(nginxConf).toContain('http://test-service2:3333/');
|
|
75
68
|
});
|
|
76
69
|
|
|
77
|
-
it
|
|
78
|
-
const host = createTreeWithEmptyWorkspace(
|
|
79
|
-
await angularApp(
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
);
|
|
70
|
+
it('can add webpack dev server proxy', async () => {
|
|
71
|
+
const host = createTreeWithEmptyWorkspace();
|
|
72
|
+
await angularApp(host, {
|
|
73
|
+
...options,
|
|
74
|
+
proxy: {
|
|
75
|
+
location: '/test/',
|
|
76
|
+
proxyPass: 'http://test-service:3333/api/',
|
|
77
|
+
},
|
|
78
|
+
});
|
|
89
79
|
|
|
90
80
|
const config = readProjectConfiguration(host, 'test');
|
|
91
81
|
expect(config.root).toBe('apps/test');
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { readProjectConfiguration } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
2
|
+
import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';
|
|
3
3
|
import { Schema } from './schema';
|
|
4
4
|
import generator from './dotnet-service';
|
|
5
5
|
|
|
6
6
|
describe('Dotnet Service Generator', () => {
|
|
7
|
-
|
|
8
|
-
const options: Schema = {
|
|
7
|
+
const options: Schema = {
|
|
9
8
|
name: 'test',
|
|
10
|
-
tenant: 'test'
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
it
|
|
14
|
-
const host =
|
|
9
|
+
tenant: 'test',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
it('can run', async () => {
|
|
13
|
+
const host = createTreeWithEmptyV1Workspace();
|
|
15
14
|
await generator(host, options);
|
|
16
15
|
|
|
17
16
|
const config = readProjectConfiguration(host, 'test');
|
|
@@ -19,4 +18,4 @@ describe('Dotnet Service Generator', () => {
|
|
|
19
18
|
|
|
20
19
|
expect(host.exists('apps/test/test.csproj')).toBeTruthy();
|
|
21
20
|
});
|
|
22
|
-
});
|
|
21
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const test_runners_1 = require("@nrwl/angular/src/utils/test-runners");
|
|
4
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
6
|
const linter_1 = require("@nrwl/linter");
|
|
6
7
|
const path = require("path");
|
|
@@ -21,7 +22,7 @@ function default_1(host, options) {
|
|
|
21
22
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
23
|
const normalizedOptions = normalizeOptions(host, options);
|
|
23
24
|
const { applicationGenerator: initExpress } = yield Promise.resolve().then(() => require('@nrwl/express'));
|
|
24
|
-
yield initExpress(host, Object.assign(Object.assign({}, options), { skipFormat: true, skipPackageJson: false, linter: linter_1.Linter.EsLint, unitTestRunner:
|
|
25
|
+
yield initExpress(host, Object.assign(Object.assign({}, options), { skipFormat: true, skipPackageJson: false, linter: linter_1.Linter.EsLint, unitTestRunner: test_runners_1.UnitTestRunner.Jest, pascalCaseFiles: false, js: false }));
|
|
25
26
|
(0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
26
27
|
'@abgov/adsp-service-sdk': '^1.18.0',
|
|
27
28
|
'dotenv': '^16.0.0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express-service.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/generators/express-service/express-service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"express-service.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/generators/express-service/express-service.ts"],"names":[],"mappings":";;;AAAA,uEAAsE;AACtE,yCAQsB;AACtB,yCAAsC;AACtC,6BAA6B;AAC7B,uDAA6E;AAG7E,SAAS,gBAAgB,CACvB,IAAU,EACV,OAAe;IAEf,MAAM,WAAW,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IACjD,MAAM,WAAW,GAAG,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC,OAAO,IAAI,WAAW,EAAE,CAAC;IAEzE,MAAM,IAAI,GAAG,IAAA,iCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEjD,uCACK,OAAO,KACV,WAAW;QACX,WAAW;QACX,IAAI,IACJ;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,IAAU,EAAE,OAAyB;IACrD,MAAM,eAAe,iDAChB,OAAO,GACP,OAAO,CAAC,IAAI,KACf,IAAI,EAAE,EAAE,GACT,CAAC;IACF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,WAAW,EACnB,eAAe,CAChB,CAAC;AACJ,CAAC;AAED,mBAA+B,IAAU,EAAE,OAAe;;QACxD,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1D,MAAM,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAG,2CAAa,eAAe,EAAC,CAAC;QAC5E,MAAM,WAAW,CACf,IAAI,kCAEC,OAAO,KACV,UAAU,EAAE,IAAI,EAChB,eAAe,EAAE,KAAK,EACtB,MAAM,EAAE,eAAM,CAAC,MAAM,EACrB,cAAc,EAAE,6BAAc,CAAC,IAAI,EACnC,eAAe,EAAE,KAAK,EACtB,EAAE,EAAE,KAAK,IAEZ,CAAC;QAEF,IAAA,qCAA4B,EAC1B,IAAI,EACJ;YACE,yBAAyB,EAAE,SAAS;YACpC,QAAQ,EAAE,SAAS;YACnB,UAAU,EAAE,QAAQ;YACpB,oBAAoB,EAAE,QAAQ;SAC/B,EACD;YACE,iBAAiB,EAAE,QAAQ;YAC3B,2BAA2B,EAAE,QAAQ;SACtC,CACF,CAAC;QAEF,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAClC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,IAAI,IAAA,0BAAa,EAAC,IAAI,EAAE,cAAc,CAAC,EAAE;YACvC,MAAM,EAAE,mBAAmB,EAAE,GAAG,2CAAa,GAAG,cAAc,EAAE,EAAC,CAAC;YAClE,MAAM,mBAAmB,CACvB,IAAI,kCAEC,OAAO,KACV,OAAO,EAAE,iBAAiB,CAAC,WAAW,IAEzC,CAAC;SACH;QAED,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAA;IACH,CAAC;CAAA;AAhDD,4BAgDC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readProjectConfiguration } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
2
|
+
import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';
|
|
3
3
|
import { Schema } from './schema';
|
|
4
4
|
import generator from './express-service';
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ describe('Express Service Generator', () => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
it('can run', async () => {
|
|
14
|
-
const host =
|
|
14
|
+
const host = createTreeWithEmptyV1Workspace();
|
|
15
15
|
await generator(host, options);
|
|
16
16
|
|
|
17
17
|
const config = readProjectConfiguration(host, 'test');
|
|
@@ -11,7 +11,7 @@ describe('React App Generator', () => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
it('can run', async () => {
|
|
14
|
-
const host = createTreeWithEmptyWorkspace(
|
|
14
|
+
const host = createTreeWithEmptyWorkspace();
|
|
15
15
|
await generator(host, options);
|
|
16
16
|
|
|
17
17
|
const appConfig = readProjectConfiguration(host, 'test-app');
|
|
@@ -23,5 +23,5 @@ describe('React App Generator', () => {
|
|
|
23
23
|
expect(host.exists('apps/test-app/nginx.conf')).toBeTruthy();
|
|
24
24
|
const nginxConf = host.read('apps/test-app/nginx.conf').toString();
|
|
25
25
|
expect(nginxConf).toContain('http://test-service:3333/');
|
|
26
|
-
});
|
|
26
|
+
}, 30000);
|
|
27
27
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const test_runners_1 = require("@nrwl/angular/src/utils/test-runners");
|
|
4
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
6
|
const linter_1 = require("@nrwl/linter");
|
|
6
7
|
const path = require("path");
|
|
@@ -63,8 +64,8 @@ function default_1(host, options) {
|
|
|
63
64
|
style: 'styled-components',
|
|
64
65
|
skipFormat: true,
|
|
65
66
|
linter: linter_1.Linter.EsLint,
|
|
66
|
-
unitTestRunner:
|
|
67
|
-
e2eTestRunner:
|
|
67
|
+
unitTestRunner: test_runners_1.UnitTestRunner.Jest,
|
|
68
|
+
e2eTestRunner: test_runners_1.E2eTestRunner.Cypress,
|
|
68
69
|
babelJest: false,
|
|
69
70
|
strict: false,
|
|
70
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-app.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/generators/react-app/react-app.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"react-app.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/generators/react-app/react-app.ts"],"names":[],"mappings":";;;AAAA,uEAAqF;AACrF,yCAWsB;AACtB,yCAAsC;AACtC,6BAA6B;AAC7B,uDAA6E;AAG7E,SAAS,gBAAgB,CACvB,IAAU,EACV,OA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,EAAE;oBAC5C,QAAQ,EAAE,IAAI;iBACf;aACF,EACD,aAAa,EAAE,GAAG,iBAAiB,CAAC,WAAW,kBAAkB,GAClE,CAAA;QAED,IAAI,UAAU,EAAE;YACd,oEAAoE;YACpE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,mCACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,KAC/B,WAAW,EAAE,GAAG,iBAAiB,CAAC,WAAW,kBAAkB,GAChE,CAAA;SACF;QAED,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEvD,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,IAAI,IAAA,0BAAa,EAAC,IAAI,EAAE,cAAc,CAAC,EAAE;YACvC,MAAM,EAAE,mBAAmB,EAAE,GAAG,2CAAa,GAAG,cAAc,EAAE,EAAC,CAAC;YAClE,MAAM,mBAAmB,CACvB,IAAI,kCAEC,OAAO,KACV,OAAO,EAAE,iBAAiB,CAAC,WAAW,IAEzC,CAAC;SACH;QAED,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAA;IACH,CAAC;CAAA;AAnFD,4BAmFC"}
|
|
@@ -1,73 +1,58 @@
|
|
|
1
1
|
import { readProjectConfiguration } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
2
|
+
import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';
|
|
3
3
|
import { Schema } from './schema';
|
|
4
4
|
import generator from './react-app';
|
|
5
5
|
|
|
6
6
|
describe('React App Generator', () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
jest.setTimeout(28000)
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
afterAll(() => {
|
|
12
|
-
jest.clearAllTimers()
|
|
13
|
-
})
|
|
14
|
-
|
|
15
7
|
const options: Schema = {
|
|
16
8
|
name: 'test',
|
|
17
9
|
tenant: 'test',
|
|
18
|
-
}
|
|
10
|
+
};
|
|
19
11
|
|
|
20
|
-
it
|
|
21
|
-
|
|
22
|
-
const host = createTreeWithEmptyWorkspace();
|
|
12
|
+
it('can run', async () => {
|
|
13
|
+
const host = createTreeWithEmptyV1Workspace();
|
|
23
14
|
await generator(host, options);
|
|
24
15
|
|
|
25
16
|
const config = readProjectConfiguration(host, 'test');
|
|
26
17
|
expect(config.root).toBe('apps/test');
|
|
27
18
|
|
|
28
19
|
expect(host.exists('apps/test/nginx.conf')).toBeTruthy();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it
|
|
32
|
-
const host =
|
|
33
|
-
await generator(
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
);
|
|
20
|
+
}, 30000);
|
|
21
|
+
|
|
22
|
+
it('can add nginx proxy', async () => {
|
|
23
|
+
const host = createTreeWithEmptyV1Workspace();
|
|
24
|
+
await generator(host, {
|
|
25
|
+
...options,
|
|
26
|
+
proxy: {
|
|
27
|
+
location: '/test/',
|
|
28
|
+
proxyPass: 'http://test-service:3333/',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
43
31
|
|
|
44
32
|
const config = readProjectConfiguration(host, 'test');
|
|
45
33
|
expect(config.root).toBe('apps/test');
|
|
46
34
|
|
|
47
35
|
expect(host.exists('apps/test/nginx.conf')).toBeTruthy();
|
|
48
|
-
expect(
|
|
49
|
-
|
|
50
|
-
)
|
|
36
|
+
expect(host.read('apps/test/nginx.conf').toString()).toContain(
|
|
37
|
+
'http://test-service:3333/'
|
|
38
|
+
);
|
|
51
39
|
});
|
|
52
40
|
|
|
53
|
-
it
|
|
54
|
-
const host =
|
|
55
|
-
await generator(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
);
|
|
41
|
+
it('can add multiple nginx proxy', async () => {
|
|
42
|
+
const host = createTreeWithEmptyV1Workspace();
|
|
43
|
+
await generator(host, {
|
|
44
|
+
...options,
|
|
45
|
+
proxy: [
|
|
46
|
+
{
|
|
47
|
+
location: '/test/',
|
|
48
|
+
proxyPass: 'http://test-service:3333/',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
location: '/test2/',
|
|
52
|
+
proxyPass: 'http://test-service2:3333/',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
});
|
|
71
56
|
|
|
72
57
|
const config = readProjectConfiguration(host, 'test');
|
|
73
58
|
expect(config.root).toBe('apps/test');
|
|
@@ -78,18 +63,15 @@ describe('React App Generator', () => {
|
|
|
78
63
|
expect(nginxConf).toContain('http://test-service2:3333/');
|
|
79
64
|
});
|
|
80
65
|
|
|
81
|
-
it
|
|
82
|
-
const host =
|
|
83
|
-
await generator(
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
);
|
|
66
|
+
it('can add webpack dev server proxy', async () => {
|
|
67
|
+
const host = createTreeWithEmptyV1Workspace();
|
|
68
|
+
await generator(host, {
|
|
69
|
+
...options,
|
|
70
|
+
proxy: {
|
|
71
|
+
location: '/test/',
|
|
72
|
+
proxyPass: 'http://test-service:3333/api/',
|
|
73
|
+
},
|
|
74
|
+
});
|
|
93
75
|
|
|
94
76
|
const config = readProjectConfiguration(host, 'test');
|
|
95
77
|
expect(config.root).toBe('apps/test');
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { readProjectConfiguration } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
2
|
+
import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';
|
|
3
3
|
import { Schema } from './schema';
|
|
4
4
|
import generator from './react-dotnet';
|
|
5
5
|
|
|
6
6
|
describe('React App Generator', () => {
|
|
7
|
-
|
|
8
|
-
const options: Schema = {
|
|
7
|
+
const options: Schema = {
|
|
9
8
|
name: 'test',
|
|
10
9
|
tenant: 'test',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
it
|
|
14
|
-
const host =
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
it('can run', async () => {
|
|
13
|
+
const host = createTreeWithEmptyV1Workspace();
|
|
15
14
|
await generator(host, options);
|
|
16
15
|
|
|
17
16
|
const appConfig = readProjectConfiguration(host, 'test-app');
|
|
@@ -19,9 +18,9 @@ describe('React App Generator', () => {
|
|
|
19
18
|
|
|
20
19
|
const serviceConfig = readProjectConfiguration(host, 'test-service');
|
|
21
20
|
expect(serviceConfig.root).toBe('apps/test-service');
|
|
22
|
-
|
|
21
|
+
|
|
23
22
|
expect(host.exists('apps/test-app/nginx.conf')).toBeTruthy();
|
|
24
23
|
const nginxConf = host.read('apps/test-app/nginx.conf').toString();
|
|
25
24
|
expect(nginxConf).toContain('http://test-service:5000/');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
25
|
+
}, 30000);
|
|
26
|
+
});
|