@o3r/amaterasu-otter 0.0.44 → 8.0.0-alpha.10

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/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright Amadeus SAS
2
+
3
+ Redistribution and use in source and binary forms, with or without modification,
4
+ are permitted provided that the following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice, this
7
+ list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation and/or
11
+ other materials provided with the distribution.
12
+
13
+ 3. Neither the name of the copyright holder nor the names of its contributors
14
+ may be used to endorse or promote products derived from this software without
15
+ specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/package.json CHANGED
@@ -1,31 +1,112 @@
1
1
  {
2
2
  "name": "@o3r/amaterasu-otter",
3
- "version": "0.0.44",
3
+ "version": "8.0.0-alpha.10",
4
+ "main": "./src/index.js",
5
+ "typings": "./src/index.d.ts",
4
6
  "description": "Command Line Interface to administrate a DES project",
5
- "main": "dist/index.js",
6
- "license": "MIT",
7
- "packageManager": "yarn@3.0.1",
8
7
  "scripts": {
9
- "build": "tsc"
8
+ "nx": "nx",
9
+ "ng": "yarn nx",
10
+ "build": "yarn nx build amaterasu-otter",
11
+ "postbuild": "patch-package-json-main",
12
+ "prepare:publish": "prepare-publish ./dist"
10
13
  },
11
- "files": [
12
- "dist/"
14
+ "keywords": [
15
+ "amaterasu-module",
16
+ "otter",
17
+ "des"
13
18
  ],
14
19
  "dependencies": {
15
20
  "js-yaml": "^4.1.0",
16
- "tslib": "^2.3.1"
21
+ "tslib": "^2.4.1"
22
+ },
23
+ "peerDependenciesMeta": {
24
+ "@angular/cli": {
25
+ "optional": true
26
+ }
17
27
  },
18
28
  "devDependencies": {
19
- "@ama-terasu/core": "^0.0.44",
29
+ "@ama-terasu/core": "^8.0.0-alpha.10",
30
+ "@angular-eslint/eslint-plugin": "~15.1.0",
31
+ "@nrwl/jest": "^15.6.3",
32
+ "@o3r/build-helpers": "^8.0.0-alpha.10",
33
+ "@o3r/dev-tools": "^8.0.0-alpha.10",
34
+ "@o3r/eslint-plugin": "^8.0.0-alpha.10",
35
+ "@types/jest": "~28.1.2",
20
36
  "@types/js-yaml": "^4.0.5",
21
- "@types/node": "^17.0.23",
22
- "typescript": "^4.6.3"
37
+ "@types/node": "^17.0.45",
38
+ "@typescript-eslint/eslint-plugin": "^5.19.0",
39
+ "@typescript-eslint/parser": "^5.19.0",
40
+ "eslint": "^8.22.0",
41
+ "eslint-import-resolver-node": "^0.3.4",
42
+ "eslint-plugin-jest": "^26.1.4",
43
+ "eslint-plugin-jsdoc": "^39.3.6",
44
+ "eslint-plugin-prefer-arrow": "^1.2.3",
45
+ "jest": "~28.1.1",
46
+ "nx": "^15.6.3",
47
+ "ts-jest": "^28.0.5",
48
+ "typescript": "~4.9.4"
23
49
  },
24
50
  "peerDependencies": {
25
- "@ama-terasu/core": "^0.0.44"
51
+ "@ama-terasu/core": "^8.0.0-alpha.10",
52
+ "@angular/cli": "~15.1.0"
26
53
  },
27
54
  "engines": {
28
55
  "node": ">=14.0.0",
29
56
  "vscode": "^1.22.0"
30
- }
31
- }
57
+ },
58
+ "types": "./src/index.d.ts",
59
+ "contributors": [
60
+ {
61
+ "name": "Yannick Adam",
62
+ "email": "yannickadam@users.noreply.github.com"
63
+ },
64
+ {
65
+ "name": "Kilian Panot",
66
+ "email": "kpanot@users.noreply.github.com"
67
+ },
68
+ {
69
+ "name": "Jeremy Bourgeois",
70
+ "email": "jbourgeois-1A@users.noreply.github.com"
71
+ },
72
+ {
73
+ "name": "Pierre Henri Ginoux",
74
+ "email": "pginoux-1A@users.noreply.github.com"
75
+ },
76
+ {
77
+ "name": "Mircea Vasile Rednic",
78
+ "email": "mrednic-1A@users.noreply.github.com"
79
+ },
80
+ {
81
+ "name": "Stephane Dalle",
82
+ "email": "sdalle-1A@users.noreply.github.com"
83
+ },
84
+ {
85
+ "name": "Nicolas Hoffmann",
86
+ "email": "nhoffmann-1A@users.noreply.github.com"
87
+ },
88
+ {
89
+ "name": "Victor Scaiceanu",
90
+ "email": "vscaiceanu-1A@users.noreply.github.com"
91
+ },
92
+ {
93
+ "name": "Florian Paul",
94
+ "email": "fpaul-1A@users.noreply.github.com"
95
+ },
96
+ {
97
+ "name": "Corinne Paulve",
98
+ "email": "cpaulve-1A@users.noreply.github.com"
99
+ },
100
+ {
101
+ "name": "Matthieu Crouzet",
102
+ "email": "matthieu-crouzet@users.noreply.github.com"
103
+ },
104
+ {
105
+ "name": "Salome Do",
106
+ "email": "sdo-1A@users.noreply.github.com"
107
+ }
108
+ ],
109
+ "bugs": "https://github.com/AmadeusITGroup/otter/issues",
110
+ "repository": "https://github.com/AmadeusITGroup/otter",
111
+ "license": "BSD-3-Clause"
112
+ }
@@ -1,40 +1,36 @@
1
- import { Context } from '@ama-terasu/core';
2
- /** Option to create an application */
3
- export interface CreateApplicationOptions {
4
- /** Application Name */
5
- name: string;
6
- /** Path of the folder to create the application */
7
- path: string;
8
- /**
9
- * Set default options instead of requiring input
10
- *
11
- * @default false
12
- */
13
- yes?: boolean;
14
- /** Registry Token */
15
- 'registry-token': string;
16
- /** Azure PAT */
17
- 'azure-token': string;
18
- /** Otter generator version to use */
19
- 'otter-version': string;
20
- /**
21
- * use yarn instead of npm
22
- *
23
- * @default false
24
- */
25
- yarn?: boolean;
26
- /**
27
- * install material with Otter
28
- *
29
- * @default false
30
- */
31
- material?: boolean;
32
- }
33
- /**
34
- * Create an Otter Application
35
- *
36
- * @param context Context of the command
37
- * @param options Options
38
- */
39
- export declare const createApplication: (context: Context, options: CreateApplicationOptions) => Promise<void>;
1
+ import { Context } from '@ama-terasu/core';
2
+ /** Option to create an application */
3
+ export interface CreateApplicationOptions {
4
+ /** Application Name */
5
+ name: string;
6
+ /** Path of the folder to create the application */
7
+ path: string;
8
+ /**
9
+ * Set default options instead of requiring input
10
+ *
11
+ * @default false
12
+ */
13
+ yes?: boolean;
14
+ /** Otter generator version to use */
15
+ 'otter-version': string;
16
+ /**
17
+ * use yarn instead of npm
18
+ *
19
+ * @default false
20
+ */
21
+ yarn?: boolean;
22
+ /**
23
+ * install material with Otter
24
+ *
25
+ * @default false
26
+ */
27
+ material?: boolean;
28
+ }
29
+ /**
30
+ * Create an Otter Application
31
+ *
32
+ * @param context Context of the command
33
+ * @param options Options
34
+ */
35
+ export declare const createApplication: (context: Context, options: CreateApplicationOptions) => Promise<void>;
40
36
  //# sourceMappingURL=create-application.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-application.command.d.ts","sourceRoot":"","sources":["../../src/create-application.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAC;AAMzD,sCAAsC;AACtC,MAAM,WAAW,wBAAwB;IACvC,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qCAAqC;IAErC,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,YAAmB,OAAO,WAAW,wBAAwB,kBAuD1F,CAAC"}
@@ -1,49 +1,52 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createApplication = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@ama-terasu/core");
6
- const fs_1 = require("fs");
7
- const path = tslib_1.__importStar(require("path"));
8
- const commands_helpers_1 = require("./commands.helpers");
9
- /**
10
- * Create an Otter Application
11
- *
12
- * @param context Context of the command
13
- * @param options Options
14
- */
15
- const createApplication = async (context, options) => {
16
- const { logger } = context;
17
- let cwd = path.resolve(process.cwd(), options.path);
18
- const directory = options.name.replace(/ /g, '-');
19
- const npmClient = options.yarn ? 'yarn' : 'npm';
20
- const npmRunner = options.yarn ? 'yarn' : 'npx';
21
- if (!(0, fs_1.existsSync)(cwd)) {
22
- await fs_1.promises.mkdir(cwd, { recursive: true });
23
- }
24
- await context.getSpinner('Creating a new Angular application...').fromPromise((0, core_1.promiseSpawn)(`npx -p @angular/cli@12 ng new "${options.name}" --style=scss --interactive=${!options.yes} --directory=${directory} --package-manager=${options.yarn ? 'yarn' : 'npm'} --routing`, { cwd, logger, stderrLogger: logger.debug }), `Application created (in ${path.resolve(cwd, directory)})`);
25
- cwd = path.resolve(cwd, directory);
26
- await context.getSpinner('Adding Otter registry...').fromPromise(fs_1.promises.writeFile(path.resolve(cwd, '.npmrc'), (0, commands_helpers_1.generateBasicNpmrc)(options['registry-token'], options['azure-token'])), 'Registry file created');
27
- await context.getSpinner('Installing NPM dependencies...').fromPromise((0, core_1.promiseSpawn)(`${npmClient} install`, { cwd, logger, stderrLogger: logger.debug }), `NPM dependencies installed (with ${npmClient})`);
28
- await context.getSpinner('Adding Otter dependencies...').fromPromise((0, core_1.promiseSpawn)(`${npmRunner} ng add @otter/ng-tools@${options['otter-version']} --interactive=${!options.yes} --skip-confirmation`, { cwd, logger, stderrLogger: logger.debug }), 'Otter dependencies registered');
29
- if (options.material) {
30
- await context.getSpinner('Adding Material Dependency...').fromPromise((0, core_1.promiseSpawn)(`${npmRunner} ng add @angular/material --interactive=${!options.yes} --skip-confirmation`, { cwd, logger, stderrLogger: logger.debug }), 'Material Design library registered');
31
- const updateStyleTask = context.getSpinner('Updating styles...');
32
- updateStyleTask.start();
33
- const stylingFile = path.resolve(cwd, 'src/styles.scss');
34
- if ((0, fs_1.existsSync)(stylingFile)) {
35
- const style = (await fs_1.promises.readFile(stylingFile, { encoding: 'utf-8' }))
36
- .replace('// @include mat-core', '@include mat-core')
37
- .replace('// @include angular-material-typography', '@include angular-material-typography')
38
- .replace('// @include angular-material-theme', '@include angular-material-theme');
39
- await fs_1.promises.writeFile(stylingFile, style);
40
- }
41
- else {
42
- context.logger.error(`File ${stylingFile} not found`);
43
- }
44
- updateStyleTask.succeed('Style updated');
45
- }
46
- logger.info(`Application created in ${cwd}`);
47
- };
48
- exports.createApplication = createApplication;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createApplication = void 0;
4
+ const core_1 = require("@ama-terasu/core");
5
+ const node_fs_1 = require("node:fs");
6
+ const path = require("node:path");
7
+ const { peerDependencies } = require(path.resolve(__dirname, '..', 'package.json'));
8
+ /**
9
+ * Create an Otter Application
10
+ *
11
+ * @param context Context of the command
12
+ * @param options Options
13
+ */
14
+ const createApplication = async (context, options) => {
15
+ const { logger } = context;
16
+ let cwd = path.resolve(process.cwd(), options.path);
17
+ const directory = options.name.replace(/ /g, '-');
18
+ const npmClient = options.yarn ? 'yarn' : 'npm';
19
+ const npmRunner = options.yarn ? 'yarn' : 'npx';
20
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
21
+ const interactive = `${!options.yes}`;
22
+ const ngVersion = peerDependencies?.['@angular/cli'] || 'latest';
23
+ if (!(0, node_fs_1.existsSync)(cwd)) {
24
+ await node_fs_1.promises.mkdir(cwd, { recursive: true });
25
+ }
26
+ await context.getSpinner('Creating a new Angular application...').fromPromise(
27
+ // eslint-disable-next-line max-len
28
+ (0, core_1.promiseSpawn)(`npx -p @angular/cli@${ngVersion} ng new "${options.name}" --style=scss --interactive=${interactive} --directory=${directory} --package-manager=${options.yarn ? 'yarn' : 'npm'} --routing`, { cwd, logger, stderrLogger: logger.debug }), `Application created (in ${path.resolve(cwd, directory)})`);
29
+ cwd = path.resolve(cwd, directory);
30
+ await context.getSpinner('Installing NPM dependencies...').fromPromise((0, core_1.promiseSpawn)(`${npmClient} install`, { cwd, logger, stderrLogger: logger.debug }), `NPM dependencies installed (with ${npmClient})`);
31
+ await context.getSpinner('Adding Otter dependencies...').fromPromise((0, core_1.promiseSpawn)(`${npmRunner} ng add @o3r/core@${options['otter-version']} --interactive=${interactive} --skip-confirmation`, { cwd, logger, stderrLogger: logger.debug }), 'Otter dependencies registered');
32
+ if (options.material) {
33
+ await context.getSpinner('Adding Material Dependency...').fromPromise((0, core_1.promiseSpawn)(`${npmRunner} ng add @angular/material --interactive=${interactive} --skip-confirmation`, { cwd, logger, stderrLogger: logger.debug }), 'Material Design library registered');
34
+ const updateStyleTask = context.getSpinner('Updating styles...');
35
+ updateStyleTask.start();
36
+ const stylingFile = path.resolve(cwd, 'src/styles.scss');
37
+ if ((0, node_fs_1.existsSync)(stylingFile)) {
38
+ const style = (await node_fs_1.promises.readFile(stylingFile, { encoding: 'utf-8' }))
39
+ .replace('// @include mat-core', '@include mat-core')
40
+ .replace('// @include angular-material-typography', '@include angular-material-typography')
41
+ .replace('// @include angular-material-theme', '@include angular-material-theme');
42
+ await node_fs_1.promises.writeFile(stylingFile, style);
43
+ }
44
+ else {
45
+ context.logger.error(`File ${stylingFile} not found`);
46
+ }
47
+ updateStyleTask.succeed('Style updated');
48
+ }
49
+ logger.info(`Application created in ${cwd}`);
50
+ };
51
+ exports.createApplication = createApplication;
49
52
  //# sourceMappingURL=create-application.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-application.command.js","sourceRoot":"","sources":["../../src/create-application.command.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,qCAAqD;AACrD,kCAAkC;AAElC,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;AA+BpF;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAgB,EAAE,OAAiC,EAAE,EAAE;IAC7F,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAChD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAChD,4EAA4E;IAC5E,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAEtC,MAAM,SAAS,GAAW,gBAAgB,EAAE,CAAC,cAAc,CAAC,IAAI,QAAQ,CAAC;IAEzE,IAAI,CAAC,IAAA,oBAAU,EAAC,GAAG,CAAC,EAAE;QACpB,MAAM,kBAAE,C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,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,EACnJ,oCAAoC,CACrC,CAAC;QAEF,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QACjE,eAAe,CAAC,KAAK,EAAE,CAAC;QACxB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QACzD,IAAI,IAAA,oBAAU,EAAC,WAAW,CAAC,EAAE;YAC3B,MAAM,KAAK,GAAG,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;iBAClE,OAAO,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;iBACpD,OAAO,CAAC,yCAAyC,EAAE,sCAAsC,CAAC;iBAC1F,OAAO,CAAC,oCAAoC,EAAE,iCAAiC,CAAC,CAAC;YACpF,MAAM,kBAAE,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;SACxC;aAAM;YACL,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,WAAW,YAAY,CAAC,CAAC;SACvD;QACD,eAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;KAC1C;IAED,MAAM,CAAC,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAvDW,QAAA,iBAAiB,qBAuD5B"}
@@ -1,32 +1,28 @@
1
- import { Context } from '@ama-terasu/core';
2
- /** Option to create a Custom Application */
3
- export interface CreateCustomAppOptions {
4
- /** Airline code */
5
- airline: string;
6
- /** Path of the folder to create the application */
7
- path: string;
8
- /**
9
- * Set default options instead of requiring input
10
- *
11
- * @default false
12
- */
13
- yes?: boolean;
14
- /** Azure PAT */
15
- 'azure-token': string;
16
- /** Registry Token */
17
- 'registry-token': string;
18
- /** Otter generator version to use */
19
- 'otter-version': string;
20
- /** RefX Flavour */
21
- flavour: string;
22
- /** RefX Tag version */
23
- tag: string;
24
- }
25
- /**
26
- * Create a custom application
27
- *
28
- * @param context Context of the command
29
- * @param options Options
30
- */
31
- export declare const createCustomApplication: (context: Context, options: CreateCustomAppOptions) => Promise<void>;
1
+ import { Context } from '@ama-terasu/core';
2
+ /** Option to create a Custom Application */
3
+ export interface CreateCustomAppOptions {
4
+ /** Airline code */
5
+ airline: string;
6
+ /** Path of the folder to create the application */
7
+ path: string;
8
+ /**
9
+ * Set default options instead of requiring input
10
+ *
11
+ * @default false
12
+ */
13
+ yes?: boolean;
14
+ /** Otter generator version to use */
15
+ 'otter-version': string;
16
+ /** RefX Flavour */
17
+ flavour: string;
18
+ /** RefX Tag version */
19
+ tag: string;
20
+ }
21
+ /**
22
+ * Create a custom application
23
+ *
24
+ * @param context Context of the command
25
+ * @param options Options
26
+ */
27
+ export declare const createCustomApplication: (context: Context, options: CreateCustomAppOptions) => Promise<void>;
32
28
  //# sourceMappingURL=create-custom-application.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-custom-application.command.d.ts","sourceRoot":"","sources":["../../src/create-custom-application.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAC;AAIzD,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qCAAqC;IAErC,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,YAAmB,OAAO,WAAW,sBAAsB,kBAY9F,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCustomApplication = void 0;
4
+ const core_1 = require("@ama-terasu/core");
5
+ const node_path_1 = require("node:path");
6
+ /**
7
+ * Create a custom application
8
+ *
9
+ * @param context Context of the command
10
+ * @param options Options
11
+ */
12
+ const createCustomApplication = async (context, options) => {
13
+ const { logger } = context;
14
+ const cwd = (0, node_path_1.resolve)(process.cwd(), options.path);
15
+ await context.getSpinner('Generating a new custom application...').fromPromise(
16
+ // eslint-disable-next-line max-len
17
+ (0, core_1.promiseSpawn)(`npx -p @o3r/customization@${options['otter-version']} -p @angular-devkit/schematics-cli schematics @o3r/customization:generate --airlineCode ${options.airline} --checkoutTag ${options.tag} --refxFlavour ${options.flavour}`, { cwd, stderrLogger: logger.debug, logger }), `Application generated (in ${cwd})`);
18
+ logger.info(`Application created in ${(0, node_path_1.resolve)(cwd, `${options.airline}-${options.flavour}`)}`);
19
+ };
20
+ exports.createCustomApplication = createCustomApplication;
21
+ //# sourceMappingURL=create-custom-application.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-custom-application.command.js","sourceRoot":"","sources":["../../src/create-custom-application.command.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,yCAAoC;AAwBpC;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAAE,OAAgB,EAAE,OAA+B,EAAE,EAAE;IACjG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,MAAM,GAAG,GAAG,IAAA,mBAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,OAAO,CAAC,UAAU,CAAC,wCAAwC,CAAC,CAAC,WAAW;IAC5E,mCAAmC;IACnC,IAAA,mBAAY,EAAC,6BAA6B,OAAO,CAAC,eAAe,CAAC,2FAA2F,OAAO,CAAC,OAAO,kBAAkB,OAAO,CAAC,GAAG,kBAAkB,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAC1R,6BAA6B,GAAG,GAAG,CACpC,CAAC;IAEF,MAAM,CAAC,IAAI,CAAC,0BAA0B,IAAA,mBAAO,EAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AACjG,CAAC,CAAC;AAZW,QAAA,uBAAuB,2BAYlC"}
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
@@ -1,76 +1,64 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /* eslint-disable no-shadow */
4
- const core_1 = require("@ama-terasu/core");
5
- const create_application_command_1 = require("./create-application.command");
6
- const create_custom_application_command_1 = require("./create-custom-application.command");
7
- const name = 'otter';
8
- module.exports = {
9
- name,
10
- description: 'Commands relative to Otter framework',
11
- init: (yargs, baseContext) => {
12
- return yargs
13
- .option(core_1.EXTRA_COMMON_OPTIONS.yarn, {
14
- ...core_1.MODULE_OPTIONS.yarn,
15
- type: 'boolean'
16
- })
17
- .demandCommand()
18
- .command('create', 'Generate a new Otter based project', (yargs) => yargs
19
- .usage(baseContext.generateUsageMessage(name, 'create <command>'))
20
- .demandCommand()
21
- .option(core_1.EXTRA_COMMON_OPTIONS.path, {
22
- ...core_1.MODULE_OPTIONS.path,
23
- type: 'string',
24
- default: '.',
25
- description: 'Path to the generated application'
26
- })
27
- .option(core_1.EXTRA_COMMON_OPTIONS.registryToken, {
28
- ...core_1.MODULE_OPTIONS.registryToken,
29
- type: 'string',
30
- description: 'Token used for Amadeus NPM registries',
31
- demandOption: 'Amadeus NPM registries token is mandatory'
32
- })
33
- .option(core_1.EXTRA_COMMON_OPTIONS.azureToken, {
34
- ...core_1.MODULE_OPTIONS.azureToken,
35
- type: 'string',
36
- description: 'Azure registry Personal Access Token',
37
- demandOption: 'Azure registry PAT is mandatory'
38
- })
39
- .option('otter-version', {
40
- alias: ['O'],
41
- type: 'string',
42
- default: 'latest',
43
- description: 'Version of the Otter generators to use',
44
- demandOption: 'Amadeus NPM registries token is mandatory'
45
- })
46
- .command('application <name>', 'Generate a new Otter based application', (yargs) => yargs
47
- .positional('name', {
48
- type: 'string',
49
- description: 'Application name',
50
- demandOption: 'Application name is mandatory'
51
- })
52
- .option('material', {
53
- type: 'boolean',
54
- default: true,
55
- description: 'Add material dependency'
56
- }), (options) => (0, create_application_command_1.createApplication)(baseContext.getContext(options), options))
57
- .command('custom-application <airline>', 'Generate Otter custom application', (yargs) => yargs
58
- .positional('airline', {
59
- type: 'string',
60
- description: 'Airline code for the application',
61
- demandOption: 'Airline code is mandatory'
62
- })
63
- .option('flavour', {
64
- type: 'string',
65
- choices: ['booking', 'ssci', 'servicing', 'ndc'],
66
- description: 'RefX flavour',
67
- demandOption: 'RefX flavour selection is mandatory'
68
- })
69
- .option('tag', {
70
- type: 'string',
71
- default: '5.4.0',
72
- description: 'The git tag of the white label that is to be customized.'
73
- }), (options) => (0, create_custom_application_command_1.createCustomApplication)(baseContext.getContext(options), options)));
74
- }
75
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable no-shadow */
4
+ const core_1 = require("@ama-terasu/core");
5
+ const create_application_command_1 = require("./create-application.command");
6
+ const create_custom_application_command_1 = require("./create-custom-application.command");
7
+ const name = 'otter';
8
+ module.exports = {
9
+ name,
10
+ description: 'Commands relative to Otter framework',
11
+ init: (yargs, baseContext) => {
12
+ return yargs
13
+ .option(core_1.EXTRA_COMMON_OPTIONS.yarn, {
14
+ ...core_1.MODULE_OPTIONS.yarn,
15
+ type: 'boolean'
16
+ })
17
+ .demandCommand()
18
+ .command('create', 'Generate a new Otter based project', (yargsInstance) => yargsInstance
19
+ .usage(baseContext.generateUsageMessage(name, 'create <command>'))
20
+ .demandCommand()
21
+ .option(core_1.EXTRA_COMMON_OPTIONS.path, {
22
+ ...core_1.MODULE_OPTIONS.path,
23
+ type: 'string',
24
+ default: '.',
25
+ description: 'Path to the generated application'
26
+ })
27
+ .option('otter-version', {
28
+ alias: ['O'],
29
+ type: 'string',
30
+ default: 'latest',
31
+ description: 'Version of the Otter generators to use',
32
+ demandOption: 'Amadeus NPM registries token is mandatory'
33
+ })
34
+ .command('application <name>', 'Generate a new Otter based application', (yargsInstanceApp) => yargsInstanceApp
35
+ .positional('name', {
36
+ type: 'string',
37
+ description: 'Application name',
38
+ demandOption: 'Application name is mandatory'
39
+ })
40
+ .option('material', {
41
+ type: 'boolean',
42
+ default: true,
43
+ description: 'Add material dependency'
44
+ }), (options) => (0, create_application_command_1.createApplication)(baseContext.getContext(options), options))
45
+ .command('custom-application <airline>', 'Generate Otter custom application', (yargsInstanceCustomApp) => yargsInstanceCustomApp
46
+ .positional('airline', {
47
+ type: 'string',
48
+ description: 'Airline code for the application',
49
+ demandOption: 'Airline code is mandatory'
50
+ })
51
+ .option('flavour', {
52
+ type: 'string',
53
+ choices: ['booking', 'ssci', 'servicing', 'ndc'],
54
+ description: 'RefX flavour',
55
+ demandOption: 'RefX flavour selection is mandatory'
56
+ })
57
+ .option('tag', {
58
+ type: 'string',
59
+ default: '5.4.0',
60
+ description: 'The git tag of the white label that is to be customized.'
61
+ }), (options) => (0, create_custom_application_command_1.createCustomApplication)(baseContext.getContext(options), options)));
62
+ }
63
+ };
76
64
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,8BAA8B;AAC9B,2CAAsF;AACtF,6EAAiE;AACjE,2FAA8E;AAE9E,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB,MAAM,CA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8B,EAAE,mCAAmC,EAAE,CAAC,sBAAsB,EAAE,EAAE,CAAC,sBAAsB;aAC7H,UAAU,CAAC,SAAS,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kCAAkC;YAC/C,YAAY,EAAE,2BAA2B;SAC1C,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC;YAChD,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,qCAAqC;SACpD,CAAC;aACD,MAAM,CAAC,KAAK,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,0DAA0D;SACxE,CAAC,EACJ,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,2DAAuB,EAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAC7E,CACF,CAAC;IACN,CAAC;CACc,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Generate an NpmRc minimal to use Otter package
3
- *
4
- * @param token Digital For Airlines registry token
5
- * @param azureToken Azure DevOpts PAT
6
- * @returns Content of the .npmrc file
7
- */
8
- export declare const generateBasicNpmrc: (token: string, azureToken: string) => string;
9
- //# sourceMappingURL=commands.helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.helpers.d.ts","sourceRoot":"","sources":["../src/commands.helpers.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,UAAW,MAAM,cAAc,MAAM,WAiBnE,CAAC"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateBasicNpmrc = void 0;
4
- const node_buffer_1 = require("node:buffer");
5
- const os_1 = require("os");
6
- /**
7
- * Generate an NpmRc minimal to use Otter package
8
- *
9
- * @param token Digital For Airlines registry token
10
- * @param azureToken Azure DevOpts PAT
11
- * @returns Content of the .npmrc file
12
- */
13
- const generateBasicNpmrc = (token, azureToken) => {
14
- const azurePatBase64 = node_buffer_1.Buffer.from(azureToken).toString('base64');
15
- return [
16
- '@otter:registry=https://pkgs.dev.azure.com/AmadeusDigitalAirline/Otter/_packaging/otter/npm/registry/',
17
- '@dapi:registry=https://pkgs.dev.azure.com/AmadeusDigitalAirline/DES-SDKs/_packaging/des-sdks/npm/registry/',
18
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/Otter/_packaging/otter/npm/registry/:username=AmadeusDigitalAirline',
19
- `//pkgs.dev.azure.com/AmadeusDigitalAirline/Otter/_packaging/otter/npm/registry/:_password=${azurePatBase64}`,
20
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/Otter/_packaging/otter/npm/registry/:email=noreply@amadeus.com',
21
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/Otter/_packaging/otter/npm/registry/:always-auth=true',
22
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/DES-SDKs/_packaging/des-sdks/npm/registry/:username=AmadeusDigitalAirline',
23
- `//pkgs.dev.azure.com/AmadeusDigitalAirline/DES-SDKs/_packaging/des-sdks/npm/registry/:_password=${azurePatBase64}`,
24
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/DES-SDKs/_packaging/des-sdks/npm/registry/:email=noreply@amadeus.com',
25
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/DES-SDKs/_packaging/des-sdks/npm/registry/:always-auth=true',
26
- `//digitalforairlines.jfrog.io/digitalforairlines/api/npm/npm-otter/:_authToken=${token}`,
27
- '//digitalforairlines.jfrog.io/digitalforairlines/api/npm/npm-otter/:email=noreply@amadeus.com',
28
- '//digitalforairlines.jfrog.io/digitalforairlines/api/npm/npm-otter/:always-auth=true',
29
- 'always-auth=true'
30
- ].join(os_1.EOL);
31
- };
32
- exports.generateBasicNpmrc = generateBasicNpmrc;
33
- //# sourceMappingURL=commands.helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.helpers.js","sourceRoot":"","sources":["../src/commands.helpers.ts"],"names":[],"mappings":";;;AAAA,6CAAqC;AACrC,2BAAyB;AAEzB;;;;;;GAMG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,UAAkB,EAAE,EAAE;IACtE,MAAM,cAAc,GAAG,oBAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClE,OAAO;QACL,uGAAuG;QACvG,4GAA4G;QAC5G,gHAAgH;QAChH,6FAA6F,cAAc,EAAE;QAC7G,2GAA2G;QAC3G,kGAAkG;QAClG,sHAAsH;QACtH,mGAAmG,cAAc,EAAE;QACnH,iHAAiH;QACjH,wGAAwG;QACxG,kFAAkF,KAAK,EAAE;QACzF,+FAA+F;QAC/F,sFAAsF;QACtF,kBAAkB;KAAC,CAAC,IAAI,CAAC,QAAG,CAAC,CAAC;AAClC,CAAC,CAAC;AAjBW,QAAA,kBAAkB,sBAiB7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-application.command.d.ts","sourceRoot":"","sources":["../src/create-application.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAC;AAKzD,sCAAsC;AACtC,MAAM,WAAW,wBAAwB;IACvC,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qBAAqB;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAA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BAAoB,CAAC,CAAC;QACjE,eAAe,CAAC,KAAK,EAAE,CAAC;QACxB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QACzD,IAAI,IAAA,eAAU,EAAC,WAAW,CAAC,EAAE;YAC3B,MAAM,KAAK,GAAG,CAAC,MAAM,aAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;iBAClE,OAAO,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;iBACpD,OAAO,CAAC,yCAAyC,EAAE,sCAAsC,CAAC;iBAC1F,OAAO,CAAC,oCAAoC,EAAE,iCAAiC,CAAC,CAAC;YACpF,MAAM,aAAE,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;SACxC;aAAM;YACL,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,WAAW,YAAY,CAAC,CAAA;SACtD;QACD,eAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;KAC1C;IAED,MAAM,CAAC,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAvDW,QAAA,iBAAiB,qBAuD5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-custom-application.command.d.ts","sourceRoot":"","sources":["../src/create-custom-application.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAC;AAQzD,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,YAAmB,OAAO,WAAW,sBAAsB,kBAgE9F,CAAC"}
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCustomApplication = void 0;
4
- const core_1 = require("@ama-terasu/core");
5
- const fs_1 = require("fs");
6
- const js_yaml_1 = require("js-yaml");
7
- const node_buffer_1 = require("node:buffer");
8
- const path_1 = require("path");
9
- const commands_helpers_1 = require("./commands.helpers");
10
- /**
11
- * Create a custom application
12
- *
13
- * @param context Context of the command
14
- * @param options Options
15
- */
16
- const createCustomApplication = async (context, options) => {
17
- var _a;
18
- const { logger } = context;
19
- const cwd = (0, path_1.resolve)(process.cwd(), options.path);
20
- const inPackageCwd = cwd;
21
- const npmrcFile = 'tmp.npmrc';
22
- const authTokenRegExp = /^(\/\/digitalforairlines.jfrog.io\/digitalforairlines\/api\/npm\/npm-otter\/:_authToken).*$/gm;
23
- const registryUrl = '//digitalforairlines.jfrog.io/digitalforairlines/api/npm/npm-otter/';
24
- const azureRegistryUrls = [
25
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/DES-SDKs/_packaging/des-sdks/npm/registry/',
26
- '//pkgs.dev.azure.com/AmadeusDigitalAirline/Otter/_packaging/otter/npm/registry/'
27
- ];
28
- await context.getSpinner('Adding Otter registry...').fromPromise(fs_1.promises.writeFile((0, path_1.resolve)(cwd, npmrcFile), (0, commands_helpers_1.generateBasicNpmrc)(options['registry-token'], options['azure-token'])), 'Registry file created');
29
- await context.getSpinner('Generating a new custom application...').fromPromise((0, core_1.promiseSpawn)(`npx --userconfig ${npmrcFile} -p @otter/customization@${options['otter-version']} -p @angular-devkit/schematics-cli schematics @otter/customization:generate --airlineCode ${options.airline} --checkoutTag ${options.tag} --refxFlavour ${options.flavour}`, { cwd, stderrLogger: logger.debug, logger }), `Application generated (in ${cwd})`);
30
- const npmrcFilePath = (0, path_1.resolve)(inPackageCwd, '.npmrc');
31
- if ((0, fs_1.existsSync)(npmrcFilePath)) {
32
- const updateNpmrcTask = context.getSpinner('Updating generated .npmrc file...');
33
- updateNpmrcTask.start();
34
- const generatedNpmrc = await fs_1.promises.readFile(npmrcFilePath, { encoding: 'utf-8' });
35
- const azurePatBase64 = node_buffer_1.Buffer.from(options['azure-token']).toString('base64');
36
- const newNpmrcContent = generatedNpmrc
37
- .replace(authTokenRegExp, `$1=${options['registry-token']}`)
38
- .replace(/_password=.*/gm, `$1=${azurePatBase64}`);
39
- await fs_1.promises.writeFile(npmrcFilePath, newNpmrcContent);
40
- updateNpmrcTask.succeed('.npmrc file updated');
41
- }
42
- const yarnrcFilePath = (0, path_1.resolve)(inPackageCwd, '.yarnrc.yml');
43
- if ((0, fs_1.existsSync)(yarnrcFilePath)) {
44
- const updateYarnrcTask = context.getSpinner('Updating generated .yarn.yml file...');
45
- updateYarnrcTask.start();
46
- const yarnrc = (0, js_yaml_1.load)(await fs_1.promises.readFile(yarnrcFilePath, { encoding: 'utf8' }));
47
- if (yarnrc) {
48
- const azurePatIdentBase64 = node_buffer_1.Buffer.from(`AmadeusDigitalAirline:${options['azure-token']}`).toString('base64');
49
- yarnrc.npmRegistries || (yarnrc.npmRegistries = {});
50
- (_a = yarnrc.npmRegistries)[registryUrl] || (_a[registryUrl] = {});
51
- yarnrc.npmRegistries[registryUrl].npmAuthToken = options['registry-token'];
52
- yarnrc.npmRegistries[registryUrl].npmAlwaysAuth = true;
53
- azureRegistryUrls.forEach((url) => {
54
- var _a;
55
- (_a = yarnrc.npmRegistries)[url] || (_a[url] = {});
56
- yarnrc.npmRegistries[url].npmAuthIdent = azurePatIdentBase64;
57
- yarnrc.npmRegistries[url].npmAlwaysAuth = true;
58
- });
59
- await fs_1.promises.writeFile(yarnrcFilePath, (0, js_yaml_1.dump)(yarnrc));
60
- }
61
- updateYarnrcTask.succeed('.yarnrc.yml file updated');
62
- }
63
- await context.getSpinner('Clean up setup materials').fromPromise(fs_1.promises.unlink((0, path_1.resolve)(cwd, npmrcFile)));
64
- logger.info(`Application created in ${(0, path_1.resolve)(cwd, `${options.airline}-${options.flavour}`)}`);
65
- };
66
- exports.createCustomApplication = createCustomApplication;
67
- //# sourceMappingURL=create-custom-application.command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-custom-application.command.js","sourceRoot":"","sources":["../src/create-custom-application.command.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,2BAAgD;AAChD,qCAAqC;AACrC,6CAAqC;AACrC,+BAA+B;AAC/B,yDAAwD;AA2BxD;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAAE,OAAgB,EAAE,OAA+B,EAAE,EAAE;;IACjG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,MAAM,GAAG,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,YAAY,GAAG,GAAG,CAAC;IAEzB,MAAM,SAAS,GAAG,WAAW,CAAC;IAC9B,MAAM,eAAe,GAAG,+FAA+F,CAAC;IACxH,MAAM,WAAW,GAAG,qEAAqE,CAAC;IAC1F,MAAM,iBAAiB,GAAG;QACxB,uFAAuF;QACvF,iFAAiF;KAClF,CAAC;IAEF,MAAM,OAAO,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,WAAW,CAC9D,aAAE,CAAC,SAAS,CAAC,IAAA,cAAO,EAAC,GAAG,EAAE,SAAS,CAAC,EAAE,IAAA,qCAAkB,EAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAC5G,uBAAuB,CACxB,CAAC;IAEF,MAAM,OAAO,CAAC,UAAU,CAAC,wCAAwC,CAAC,CAAC,WAAW,CAC5E,IAAA,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AM,CAAC,IAAI,CAAC,0BAA0B,IAAA,cAAO,EAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AACjG,CAAC,CAAC;AAhEW,QAAA,uBAAuB,2BAgElC"}
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,8BAA8B;AAC9B,2CAAsF;AACtF,6EAAiE;AACjE,2FAA8E;AAE9E,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB,MAAM,CAAC,OAAO,GAAG;IACf,IAAI;IACJ,WAAW,EAAE,sCAAsC;IACnD,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QAC3B,OAAO,KAAK;aACT,MAAM,CAAC,2BAAoB,CAAC,IAAI,EAAE;YACjC,GAAG,qBAAc,CAAC,IAAI;YACtB,IAAI,EAAE,SAAS;SAChB,CAAC;aACD,aAAa,EAAE;aACf,OAAO,CAAC,QAAQ,EAAE,oCAAoC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;aACtE,KAAK,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;aACjE,aAAa,EAAE;aACf,MAAM,CAAC,2BAAoB,CAAC,IAAI,EAAE;YACjC,GAAG,qBAAc,CAAC,IAAI;YACtB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,GAAG;YACZ,WAAW,EAAE,mCAAmC;SACjD,CAAC;aACD,MAAM,CAAC,2BAAoB,CAAC,aAAa,EAAE;YAC1C,GAAG,qBAAc,CAAC,aAAa;YAC/B,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,YAAY,EAAE,2CAA2C;SAC1D,CAAC;aACD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AAE,OAAO;YAChB,WAAW,EAAE,0DAA0D;SACxE,CAAC,EACF,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,2DAAuB,EAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAC/E,CACF,CAAC;IACN,CAAC;CACc,CAAC"}
package/readme.md DELETED
@@ -1,17 +0,0 @@
1
- # Ama-terasu Otter
2
-
3
- This is a module for **Ama-terasu** CLI to execute action relative to the Otter Framework.
4
-
5
- ## Available commands
6
-
7
- List of available command exposed by this module:
8
-
9
- * **create application**: Create an empty Otter application
10
-
11
- ### create application
12
-
13
- Generate a new Otter based application
14
-
15
- ### create sdk
16
-
17
- Generate a Typescript SDK based on Digital Amadeus compatible specification