node-cli-tester 21.0.34 → 21.0.36
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/VERIFIED-BUILD-DATA.jsonc +3 -3
- package/bin/node-cli-tester +5 -11
- package/bin/node-cli-tester-debug +5 -11
- package/bin/node-cli-tester-debug-brk +4 -0
- package/browser/package.json +1 -1
- package/browser-prod/package.json +1 -1
- package/html/assets/generated/pwa/html-pwa.html +60 -0
- package/html/tests/extract-from-md-files/htmlfile.html +4 -0
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/package.json +1 -1
- package/lib-esm/app.d.ts +3 -0
- package/lib-esm/app.electron.d.ts +2 -0
- package/lib-esm/app.electron.js +83 -0
- package/lib-esm/app.electron.js.map +1 -0
- package/lib-esm/app.hosts.d.ts +95 -0
- package/lib-esm/app.hosts.js +157 -0
- package/lib-esm/app.hosts.js.map +1 -0
- package/lib-esm/app.js +200 -0
- package/lib-esm/app.js.map +1 -0
- package/lib-esm/app.vscode.d.ts +9 -0
- package/lib-esm/app.vscode.js +31 -0
- package/lib-esm/app.vscode.js.map +1 -0
- package/lib-esm/index.d.ts +1 -0
- package/lib-esm/index.js +2 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/lib/base-project-structure.backend.d.ts +13 -0
- package/lib-esm/lib/base-project-structure.backend.js +75 -0
- package/lib-esm/lib/base-project-structure.backend.js.map +1 -0
- package/lib-esm/lib/build-info._auto-generated_.d.ts +24 -0
- package/lib-esm/lib/build-info._auto-generated_.js +27 -0
- package/lib-esm/lib/build-info._auto-generated_.js.map +1 -0
- package/lib-esm/lib/cli-test.backend.d.ts +24 -0
- package/lib-esm/lib/cli-test.backend.js +141 -0
- package/lib-esm/lib/cli-test.backend.js.map +1 -0
- package/lib-esm/lib/env/env.angular-node-app.d.ts +66 -0
- package/lib-esm/lib/env/env.angular-node-app.js +135 -0
- package/lib-esm/lib/env/env.angular-node-app.js.map +1 -0
- package/lib-esm/lib/env/env.docs-webapp.d.ts +66 -0
- package/lib-esm/lib/env/env.docs-webapp.js +135 -0
- package/lib-esm/lib/env/env.docs-webapp.js.map +1 -0
- package/lib-esm/lib/env/env.electron-app.d.ts +66 -0
- package/lib-esm/lib/env/env.electron-app.js +135 -0
- package/lib-esm/lib/env/env.electron-app.js.map +1 -0
- package/lib-esm/lib/env/env.mobile-app.d.ts +66 -0
- package/lib-esm/lib/env/env.mobile-app.js +135 -0
- package/lib-esm/lib/env/env.mobile-app.js.map +1 -0
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.d.ts +66 -0
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js +135 -0
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js.map +1 -0
- package/lib-esm/lib/env/env.vscode-plugin.d.ts +66 -0
- package/lib-esm/lib/env/env.vscode-plugin.js +135 -0
- package/lib-esm/lib/env/env.vscode-plugin.js.map +1 -0
- package/lib-esm/lib/env/index.d.ts +6 -0
- package/lib-esm/lib/env/index.js +7 -0
- package/lib-esm/lib/env/index.js.map +1 -0
- package/lib-esm/lib/index._auto-generated_.d.ts +0 -0
- package/lib-esm/lib/index._auto-generated_.js +6 -0
- package/lib-esm/lib/index._auto-generated_.js.map +1 -0
- package/lib-esm/lib/index.d.ts +4 -0
- package/lib-esm/lib/index.js +7 -0
- package/lib-esm/lib/index.js.map +1 -0
- package/lib-esm/lib/meta-content-md.backend.d.ts +42 -0
- package/lib-esm/lib/meta-content-md.backend.js +245 -0
- package/lib-esm/lib/meta-content-md.backend.js.map +1 -0
- package/lib-esm/lib/migrations/index.d.ts +1 -0
- package/lib-esm/lib/migrations/index.js +3 -0
- package/lib-esm/lib/migrations/index.js.map +1 -0
- package/lib-esm/lib/migrations/migrations_index._auto-generated_.d.ts +0 -0
- package/lib-esm/lib/migrations/migrations_index._auto-generated_.js +4 -0
- package/lib-esm/lib/migrations/migrations_index._auto-generated_.js.map +1 -0
- package/lib-esm/lib/node-cli-tester.d.ts +25 -0
- package/lib-esm/lib/node-cli-tester.js +199 -0
- package/lib-esm/lib/node-cli-tester.js.map +1 -0
- package/lib-esm/lib/spec-templates.backend.d.ts +6 -0
- package/lib-esm/lib/spec-templates.backend.js +101 -0
- package/lib-esm/lib/spec-templates.backend.js.map +1 -0
- package/lib-esm/lib/start.backend.d.ts +2 -0
- package/lib-esm/lib/start.backend.js +26 -0
- package/lib-esm/lib/start.backend.js.map +1 -0
- package/lib-prod/base-project-structure.backend.js.map +1 -1
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/cli-test.backend.js.map +1 -1
- package/lib-prod/meta-content-md.backend.js.map +1 -1
- package/lib-prod/node-cli-tester.js.map +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/spec-templates.backend.js.map +1 -1
- package/package.json +3 -2
- package/src.js +4 -20
- package/websql/package.json +1 -1
- package/websql-prod/package.json +1 -1
package/lib-esm/app.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
//#region imports
|
|
3
|
+
import * as os from 'os'; // @backend
|
|
4
|
+
import { Taon, TaonBaseContext } from 'taon/lib';
|
|
5
|
+
import { UtilsOs } from 'tnp-core/lib';
|
|
6
|
+
import { HOST_CONFIG } from './app.hosts';
|
|
7
|
+
//#endregion
|
|
8
|
+
console.log('hello world');
|
|
9
|
+
console.log('Your backend host ' + HOST_CONFIG['MainContext'].host);
|
|
10
|
+
console.log('Your frontend host ' + HOST_CONFIG['MainContext'].frontendHost);
|
|
11
|
+
//#region node-cli-tester component
|
|
12
|
+
/* */
|
|
13
|
+
/* */
|
|
14
|
+
/* */
|
|
15
|
+
/* */
|
|
16
|
+
/* */
|
|
17
|
+
/* */
|
|
18
|
+
/* */
|
|
19
|
+
/* */
|
|
20
|
+
/* */
|
|
21
|
+
/* */
|
|
22
|
+
/* */
|
|
23
|
+
/* */
|
|
24
|
+
/* */
|
|
25
|
+
/* */
|
|
26
|
+
/* */
|
|
27
|
+
/* */
|
|
28
|
+
/* */
|
|
29
|
+
/* */
|
|
30
|
+
/* */
|
|
31
|
+
/* */
|
|
32
|
+
/* */
|
|
33
|
+
/* */
|
|
34
|
+
/* */
|
|
35
|
+
/* */
|
|
36
|
+
/* */
|
|
37
|
+
/* */
|
|
38
|
+
/* */
|
|
39
|
+
/* */
|
|
40
|
+
/* */
|
|
41
|
+
/* */
|
|
42
|
+
/* */
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region node-cli-tester api service
|
|
45
|
+
/* */
|
|
46
|
+
/* */
|
|
47
|
+
/* */
|
|
48
|
+
/* */
|
|
49
|
+
/* */
|
|
50
|
+
/* */
|
|
51
|
+
/* */
|
|
52
|
+
/* */
|
|
53
|
+
/* */
|
|
54
|
+
/* */
|
|
55
|
+
/* */
|
|
56
|
+
/* */
|
|
57
|
+
/* */
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region node-cli-tester module
|
|
60
|
+
/* */
|
|
61
|
+
/* */
|
|
62
|
+
/* */
|
|
63
|
+
/* */
|
|
64
|
+
/* */
|
|
65
|
+
/* */
|
|
66
|
+
/* */
|
|
67
|
+
/* */
|
|
68
|
+
/* */
|
|
69
|
+
/* */
|
|
70
|
+
/* */
|
|
71
|
+
/* */
|
|
72
|
+
/* */
|
|
73
|
+
/* */
|
|
74
|
+
/* */
|
|
75
|
+
/* */
|
|
76
|
+
/* */
|
|
77
|
+
/* */
|
|
78
|
+
/* */
|
|
79
|
+
/* */
|
|
80
|
+
/* */
|
|
81
|
+
/* */
|
|
82
|
+
/* */
|
|
83
|
+
/* */
|
|
84
|
+
/* */
|
|
85
|
+
/* */
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region node-cli-tester entity
|
|
88
|
+
let User = class User extends Taon.Base.AbstractEntity {
|
|
89
|
+
//#region @websql
|
|
90
|
+
//#endregion
|
|
91
|
+
name;
|
|
92
|
+
};
|
|
93
|
+
__decorate([
|
|
94
|
+
Taon.Orm.Column.String()
|
|
95
|
+
//#endregion
|
|
96
|
+
,
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], User.prototype, "name", void 0);
|
|
99
|
+
User = __decorate([
|
|
100
|
+
Taon.Entity({ className: 'User' })
|
|
101
|
+
], User);
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region node-cli-tester controller
|
|
104
|
+
let UserController = class UserController extends Taon.Base.CrudController {
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
106
|
+
entityClassResolveFn = () => User;
|
|
107
|
+
helloWorld() {
|
|
108
|
+
//#region @websqlFunc
|
|
109
|
+
return async (req, res) => 'hello world';
|
|
110
|
+
//#endregion
|
|
111
|
+
}
|
|
112
|
+
getOsPlatform() {
|
|
113
|
+
//#region @websqlFunc
|
|
114
|
+
return async (req, res) => {
|
|
115
|
+
//#region @backend
|
|
116
|
+
return os.platform(); // for normal nodejs backend return real value
|
|
117
|
+
//#endregion
|
|
118
|
+
return 'no-platform-inside-browser-and-websql-mode';
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
__decorate([
|
|
124
|
+
Taon.Http.GET(),
|
|
125
|
+
__metadata("design:type", Function),
|
|
126
|
+
__metadata("design:paramtypes", []),
|
|
127
|
+
__metadata("design:returntype", Object)
|
|
128
|
+
], UserController.prototype, "helloWorld", null);
|
|
129
|
+
__decorate([
|
|
130
|
+
Taon.Http.GET(),
|
|
131
|
+
__metadata("design:type", Function),
|
|
132
|
+
__metadata("design:paramtypes", []),
|
|
133
|
+
__metadata("design:returntype", Object)
|
|
134
|
+
], UserController.prototype, "getOsPlatform", null);
|
|
135
|
+
UserController = __decorate([
|
|
136
|
+
Taon.Controller({ className: 'UserController' })
|
|
137
|
+
], UserController);
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region node-cli-tester migration
|
|
140
|
+
//#region @websql
|
|
141
|
+
let UserMigration = class UserMigration extends Taon.Base.Migration {
|
|
142
|
+
userController = this.injectRepo(User);
|
|
143
|
+
async up() {
|
|
144
|
+
const superAdmin = new User();
|
|
145
|
+
superAdmin.name = 'super-admin';
|
|
146
|
+
await this.userController.save(superAdmin);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
UserMigration = __decorate([
|
|
150
|
+
Taon.Migration({
|
|
151
|
+
className: 'UserMigration',
|
|
152
|
+
})
|
|
153
|
+
], UserMigration);
|
|
154
|
+
//#endregion
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region node-cli-tester context
|
|
157
|
+
var MainContext = Taon.createContext(() => ({
|
|
158
|
+
...HOST_CONFIG['MainContext'],
|
|
159
|
+
contexts: { TaonBaseContext },
|
|
160
|
+
//#region @websql
|
|
161
|
+
/**
|
|
162
|
+
* This is dummy migration - you DO NOT NEED need this migrations object
|
|
163
|
+
* if you are using HOST_CONFIG['MainContext'] that contains 'migrations' object.
|
|
164
|
+
* DELETE THIS 'migrations' object if you use taon CLI that generates
|
|
165
|
+
* migrations automatically inside /src/migrations folder.
|
|
166
|
+
*/
|
|
167
|
+
migrations: {
|
|
168
|
+
UserMigration,
|
|
169
|
+
},
|
|
170
|
+
//#endregion
|
|
171
|
+
controllers: {
|
|
172
|
+
UserController,
|
|
173
|
+
},
|
|
174
|
+
entities: {
|
|
175
|
+
User,
|
|
176
|
+
},
|
|
177
|
+
database: true,
|
|
178
|
+
// disabledRealtime: true,
|
|
179
|
+
}));
|
|
180
|
+
//#endregion
|
|
181
|
+
async function start(startParams) {
|
|
182
|
+
await MainContext.initialize();
|
|
183
|
+
//#region @backend
|
|
184
|
+
if (startParams.onlyMigrationRun ||
|
|
185
|
+
startParams.onlyMigrationRevertToTimestamp) {
|
|
186
|
+
process.exit(0);
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region @backend
|
|
190
|
+
console.log(`Hello in NodeJs backend! os=${os.platform()}`);
|
|
191
|
+
//#endregion
|
|
192
|
+
if (UtilsOs.isBrowser) {
|
|
193
|
+
const users = (await MainContext.getClassInstance(UserController).getAll().request()).body?.json;
|
|
194
|
+
console.log({
|
|
195
|
+
'users from backend': users,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export default start;
|
|
200
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc;AACd,iBAAiB;AACjB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,WAAW;AAUrC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAgB,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY;AAEZ,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC3B,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC;AACpE,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,CAAC;AAE7E,mCAAmC;AACnC,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AAEL,YAAY;AAEZ,sCAAsC;AACtC,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AAC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AClB,IACE,WAAW,CAAC,gBAAgB;QAC5B,WAAW,CAAC,8BAA8B,EAC1C,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,YAAY;IAEZ,kBAAkB;IAClB,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC5D,YAAY;IAEZ,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,CACZ,MAAM,WAAW,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CACtE,CAAC,IAAI,EAAE,IAAI,CAAC;QACb,OAAO,CAAC,GAAG,CAAC;YACV,oBAAoB,EAAE,KAAK;SAC5B,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CommandType } from 'tnp-helpers/lib';
|
|
2
|
+
import type { ExtensionContext } from 'vscode';
|
|
3
|
+
export declare const commands: CommandType[];
|
|
4
|
+
export declare function activate(context: ExtensionContext): void;
|
|
5
|
+
export declare function deactivate(): void;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
commands: CommandType[];
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Utils } from 'tnp-core/lib';
|
|
2
|
+
import { executeCommand } from 'tnp-helpers/lib';
|
|
3
|
+
const group = 'Node Cli Tester CLI essentials';
|
|
4
|
+
export const commands = [
|
|
5
|
+
{
|
|
6
|
+
title: 'hello world',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
title: 'hey!',
|
|
10
|
+
},
|
|
11
|
+
].map(c => {
|
|
12
|
+
if (!c.command) {
|
|
13
|
+
c.command = `extension.${Utils.camelize(c.title)}`;
|
|
14
|
+
}
|
|
15
|
+
if (!c.group) {
|
|
16
|
+
c.group = group;
|
|
17
|
+
}
|
|
18
|
+
return c;
|
|
19
|
+
});
|
|
20
|
+
export function activate(context) {
|
|
21
|
+
for (let index = 0; index < commands.length; index++) {
|
|
22
|
+
const { title = '', command = '', exec = '', options, isDefaultBuildCommand, } = commands[index];
|
|
23
|
+
const sub = executeCommand(title, command, exec, options, isDefaultBuildCommand, context);
|
|
24
|
+
if (sub) {
|
|
25
|
+
context.subscriptions.push(sub);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function deactivate() { }
|
|
30
|
+
export default { commands };
|
|
31
|
+
//# sourceMappingURL=app.vscode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.vscode.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAe,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,KAAK,GAAG,gCAAgC,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GACnB;IACE;QACE,KAAK,EAAE,aAAa;KACrB;IACD;QACE,KAAK,EAAE,MAAM;KACd;CAEJ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;IACR,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,CAAC,CAAC,OAAO,GAAG,aAAa,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;IACrD,CAAC;IACD,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACb,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC;IAClB,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,QAAQ,CAAC,OAAyB;IAChD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACrD,MAAM,EACJ,KAAK,GAAG,EAAE,EACV,OAAO,GAAG,EAAE,EACZ,IAAI,GAAG,EAAE,EACT,OAAO,EACP,qBAAqB,GACtB,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,GAAG,GAAG,cAAc,CACxB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,qBAAqB,EACrB,OAAO,CACR,CAAC;QACF,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,KAAI,CAAC;AAE/B,eAAe,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib';
|
package/lib-esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseProject as Project } from 'tnp-helpers/lib';
|
|
2
|
+
export declare class BaseProjectStructure {
|
|
3
|
+
private cwd;
|
|
4
|
+
static BASE_STRUCTURES_FOLDER: string;
|
|
5
|
+
get baseStructureHash(): string;
|
|
6
|
+
get projectPathBasename(): string;
|
|
7
|
+
constructor(cwd: string);
|
|
8
|
+
copyto(destinationCwd: string, basename?: string): void;
|
|
9
|
+
static allBaseStructures(cwd: any): BaseProjectStructure[];
|
|
10
|
+
static generate<P extends Project = Project>(project: P): {
|
|
11
|
+
insideIfNotExists(destinationCwd: string): string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//#region imports
|
|
2
|
+
import { _, path } from 'tnp-core/lib';
|
|
3
|
+
import { HelpersTaon, Helpers } from 'tnp-helpers/lib';
|
|
4
|
+
//#endregion
|
|
5
|
+
export class BaseProjectStructure {
|
|
6
|
+
cwd;
|
|
7
|
+
static BASE_STRUCTURES_FOLDER = 'base-structures';
|
|
8
|
+
get baseStructureHash() {
|
|
9
|
+
return path.basename(this.cwd);
|
|
10
|
+
}
|
|
11
|
+
get projectPathBasename() {
|
|
12
|
+
return _.first(path.basename(this.cwd).split('__'));
|
|
13
|
+
}
|
|
14
|
+
constructor(cwd) {
|
|
15
|
+
this.cwd = cwd;
|
|
16
|
+
}
|
|
17
|
+
copyto(destinationCwd, basename) {
|
|
18
|
+
HelpersTaon.copy(this.cwd, path.join(destinationCwd, basename ? basename : this.projectPathBasename));
|
|
19
|
+
}
|
|
20
|
+
static allBaseStructures(cwd) {
|
|
21
|
+
const folderPath = path.join(cwd, this.BASE_STRUCTURES_FOLDER);
|
|
22
|
+
return Helpers.foldersFrom(folderPath).map(f => new BaseProjectStructure(f));
|
|
23
|
+
}
|
|
24
|
+
static generate(project) {
|
|
25
|
+
const that = this;
|
|
26
|
+
const orgCwd = path.join(project.location);
|
|
27
|
+
const files = []; //= project.forEmptyStructure();
|
|
28
|
+
const filesWithoutLinks = files.filter(f => !f.relativeLinkFrom);
|
|
29
|
+
let hash = files.length.toString();
|
|
30
|
+
for (let index = 0; index < filesWithoutLinks.length; index++) {
|
|
31
|
+
const file = filesWithoutLinks[index];
|
|
32
|
+
const abasolutePAth = path.join(orgCwd, file.relativePath);
|
|
33
|
+
hash +=
|
|
34
|
+
(file.relativePath.length + 1).toString() +
|
|
35
|
+
(Helpers.isFolder(abasolutePAth)
|
|
36
|
+
? ''
|
|
37
|
+
: (Helpers.readFile(abasolutePAth)?.length + 1).toString());
|
|
38
|
+
}
|
|
39
|
+
hash = `${project.name}__${HelpersTaon.checksum(hash)}`;
|
|
40
|
+
return {
|
|
41
|
+
insideIfNotExists(destinationCwd) {
|
|
42
|
+
const destStruct = path.join(destinationCwd, that.BASE_STRUCTURES_FOLDER, hash);
|
|
43
|
+
if (Helpers.exists(destStruct)) {
|
|
44
|
+
Helpers.log(`Base structure with name: ${hash}`);
|
|
45
|
+
return hash;
|
|
46
|
+
}
|
|
47
|
+
Helpers.removeFolderIfExists(destStruct);
|
|
48
|
+
for (let index = 0; index < filesWithoutLinks.length; index++) {
|
|
49
|
+
const file = filesWithoutLinks[index];
|
|
50
|
+
const orgPath = path.join(orgCwd, file.relativePath);
|
|
51
|
+
const destPath = path.join(destStruct, file.relativePath);
|
|
52
|
+
Helpers.mkdirp(path.dirname(destPath));
|
|
53
|
+
if (Helpers.isFolder(orgPath)) {
|
|
54
|
+
if (file.includeContent) {
|
|
55
|
+
HelpersTaon.copy(orgPath, destPath);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
Helpers.mkdirp(destPath);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
if (file.includeContent) {
|
|
63
|
+
HelpersTaon.copyFile(orgPath, destPath);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
Helpers.writeFile(destPath, '');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return hash;
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=base-project-structure.backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-project-structure.backend.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,iBAAiB;AACjB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,OAAO,EAA0B,MAAM,iBAAiB,CAAC;AAC/E,YAAY;AAEZ,MAAM,OAAO,oBAAoB;IAUX;IATpB,MAAM,CAAC,sBAAsB,GAAG,iBAAiB,CAAC;IAClD,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,CAAC,CAAC,KAAK,CAA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AC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACvC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC9B,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;4BACxB,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;wBACtC,CAAC;6BAAM,CAAC;4BACN,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;wBAC3B,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;4BACxB,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;wBAC1C,CAAC;6BAAM,CAAC;4BACN,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;wBAClC,CAAC;oBACH,CAAC;gBACH,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autogenerated by current cli tool
|
|
3
|
+
*/
|
|
4
|
+
export declare const BUILD_FRAMEWORK_CLI_NAME = "tnp";
|
|
5
|
+
/**
|
|
6
|
+
* This value can be change in taon.jsonc (appId)
|
|
7
|
+
*/
|
|
8
|
+
export declare const APP_ID = "com.domain.example.node-cli-tester";
|
|
9
|
+
/**
|
|
10
|
+
* Autogenerated by current cli tool
|
|
11
|
+
*/
|
|
12
|
+
export declare const BUILD_BASE_HREF = "";
|
|
13
|
+
/**
|
|
14
|
+
* This value can be change in taon.jsonc (overrideNpmName)
|
|
15
|
+
*/
|
|
16
|
+
export declare const PROJECT_NPM_NAME = "node-cli-tester";
|
|
17
|
+
/**
|
|
18
|
+
* Taon version from you project taon.json
|
|
19
|
+
*/
|
|
20
|
+
export declare const CURRENT_PACKAGE_TAON_VERSION = "v21";
|
|
21
|
+
/**
|
|
22
|
+
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CURRENT_PACKAGE_VERSION = "21.0.36";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
2
|
+
/**
|
|
3
|
+
* Autogenerated by current cli tool
|
|
4
|
+
*/
|
|
5
|
+
export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
|
|
6
|
+
/**
|
|
7
|
+
* This value can be change in taon.jsonc (appId)
|
|
8
|
+
*/
|
|
9
|
+
export const APP_ID = 'com.domain.example.node-cli-tester';
|
|
10
|
+
/**
|
|
11
|
+
* Autogenerated by current cli tool
|
|
12
|
+
*/
|
|
13
|
+
export const BUILD_BASE_HREF = '';
|
|
14
|
+
/**
|
|
15
|
+
* This value can be change in taon.jsonc (overrideNpmName)
|
|
16
|
+
*/
|
|
17
|
+
export const PROJECT_NPM_NAME = 'node-cli-tester';
|
|
18
|
+
/**
|
|
19
|
+
* Taon version from you project taon.json
|
|
20
|
+
*/
|
|
21
|
+
export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
|
|
22
|
+
/**
|
|
23
|
+
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
24
|
+
*/
|
|
25
|
+
export const CURRENT_PACKAGE_VERSION = '21.0.36';
|
|
26
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
27
|
+
//# sourceMappingURL=build-info._auto-generated_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-info._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAC9C;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,oCAAoC,CAAC;AAC3D;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAClC;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAClD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC;AAMjD,yCAAyC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MetaMd } from './meta-content-md.backend';
|
|
2
|
+
import type { NodeCliTester } from './node-cli-tester';
|
|
3
|
+
export declare class CliTest {
|
|
4
|
+
cwd: string;
|
|
5
|
+
testName: string;
|
|
6
|
+
static readonly NAME_FOR_CLI_TESTS_FOLDER = "src/tests/tests-cli";
|
|
7
|
+
readonly testDirnamePath: string;
|
|
8
|
+
private static instances;
|
|
9
|
+
static allFrom(cwd: string): CliTest[];
|
|
10
|
+
static getBy(cwd: string, timeHash: string): CliTest;
|
|
11
|
+
static from(cwd: string, testName?: string): CliTest;
|
|
12
|
+
get metaMd(): {
|
|
13
|
+
readonly all: MetaMd[];
|
|
14
|
+
add(originalFilePath: string[], baseCwd: string, NodeCliTestrClass: typeof NodeCliTester): Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
private get firedev_jsonc();
|
|
17
|
+
private get packageJsonPath();
|
|
18
|
+
private get gitignorePath();
|
|
19
|
+
private get specTsPath();
|
|
20
|
+
constructor(cwd: string, testName: string);
|
|
21
|
+
regenerateFiles(): Promise<void>;
|
|
22
|
+
private regeneratePackageJson5;
|
|
23
|
+
private regenerateGitIgnore;
|
|
24
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
//#region imports
|
|
2
|
+
import { _, path } from 'tnp-core/lib';
|
|
3
|
+
import { config } from 'tnp-core/lib';
|
|
4
|
+
import { Helpers } from 'tnp-helpers/lib';
|
|
5
|
+
import { MetaMd } from './meta-content-md.backend';
|
|
6
|
+
import { CLASS } from 'typescript-class-helpers/lib';
|
|
7
|
+
//#endregion
|
|
8
|
+
export class CliTest {
|
|
9
|
+
cwd;
|
|
10
|
+
testName;
|
|
11
|
+
static NAME_FOR_CLI_TESTS_FOLDER = 'src/tests/tests-cli';
|
|
12
|
+
testDirnamePath;
|
|
13
|
+
//#region singleton / static inst
|
|
14
|
+
static instances = {};
|
|
15
|
+
static allFrom(cwd) {
|
|
16
|
+
const folderWithTests = path.join(cwd, this.NAME_FOR_CLI_TESTS_FOLDER);
|
|
17
|
+
const folders = Helpers.foldersFrom(folderWithTests);
|
|
18
|
+
const tests = folders.map(f => CliTest.from(f)).filter(f => !!f);
|
|
19
|
+
return tests;
|
|
20
|
+
}
|
|
21
|
+
static getBy(cwd, timeHash) {
|
|
22
|
+
return this.allFrom(cwd).find(c => !_.isUndefined(c.metaMd.all.find(c => c.readonlyMetaJson.timeHash === timeHash)));
|
|
23
|
+
}
|
|
24
|
+
static from(cwd, testName) {
|
|
25
|
+
if (!testName) {
|
|
26
|
+
testName = path.basename(cwd);
|
|
27
|
+
cwd = path.dirname(cwd);
|
|
28
|
+
}
|
|
29
|
+
if (!CliTest.instances[cwd]) {
|
|
30
|
+
CliTest.instances[cwd] = {};
|
|
31
|
+
}
|
|
32
|
+
if (!CliTest.instances[cwd][testName]) {
|
|
33
|
+
CliTest.instances[cwd][testName] = new CliTest(cwd, testName);
|
|
34
|
+
}
|
|
35
|
+
return CliTest.instances[cwd][testName];
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region getters
|
|
39
|
+
//#region getters / meta md
|
|
40
|
+
get metaMd() {
|
|
41
|
+
const that = this;
|
|
42
|
+
return {
|
|
43
|
+
get all() {
|
|
44
|
+
return MetaMd.allInstancesFrom(that.testDirnamePath);
|
|
45
|
+
},
|
|
46
|
+
async add(originalFilePath, baseCwd, NodeCliTestrClass) {
|
|
47
|
+
await MetaMd.preserveFiles(originalFilePath, that.testDirnamePath, baseCwd, NodeCliTestrClass.foundProjectsFn, that.cwd);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region getters / pathes
|
|
53
|
+
get firedev_jsonc() {
|
|
54
|
+
return path.join(this.testDirnamePath, config.file.firedev_jsonc);
|
|
55
|
+
}
|
|
56
|
+
get packageJsonPath() {
|
|
57
|
+
return path.join(this.testDirnamePath, config.file.package_json);
|
|
58
|
+
}
|
|
59
|
+
get gitignorePath() {
|
|
60
|
+
return path.join(this.testDirnamePath, config.file._gitignore);
|
|
61
|
+
}
|
|
62
|
+
get specTsPath() {
|
|
63
|
+
return path.join(this.testDirnamePath, `${_.kebabCase(this.testName)}.spec.ts`);
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region constructor / init
|
|
68
|
+
constructor(cwd, testName) {
|
|
69
|
+
this.cwd = cwd;
|
|
70
|
+
this.testName = testName;
|
|
71
|
+
cwd = cwd.endsWith(CliTest.NAME_FOR_CLI_TESTS_FOLDER) ? cwd.replace(CliTest.NAME_FOR_CLI_TESTS_FOLDER, '') : cwd;
|
|
72
|
+
this.cwd = cwd;
|
|
73
|
+
this.testDirnamePath = path.join(cwd, CliTest.NAME_FOR_CLI_TESTS_FOLDER, _.kebabCase(this.testName));
|
|
74
|
+
const pathToTempEnvs = path.join(cwd, config.folder.tmpTestsEnvironments);
|
|
75
|
+
const pathToEnvs = path.join(cwd, config.folder.testsEnvironments);
|
|
76
|
+
Helpers.createSymLink(pathToTempEnvs, pathToEnvs, {
|
|
77
|
+
continueWhenExistedFolderDoesntExists: true
|
|
78
|
+
});
|
|
79
|
+
if (Helpers.exists(this.firedev_jsonc)) {
|
|
80
|
+
const testNameFromPJ5 = Helpers.readJson(this.firedev_jsonc, {}, true).description;
|
|
81
|
+
if (testNameFromPJ5) {
|
|
82
|
+
testName = testNameFromPJ5;
|
|
83
|
+
this.testName = testName;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region public api
|
|
89
|
+
//#region regenerate
|
|
90
|
+
async regenerateFiles() {
|
|
91
|
+
if (!Helpers.exists(this.testDirnamePath)) {
|
|
92
|
+
Helpers.mkdirp(this.testDirnamePath);
|
|
93
|
+
}
|
|
94
|
+
this.regeneratePackageJson5();
|
|
95
|
+
let TestTemplatesClass = CLASS.getBy('TestTemplates');
|
|
96
|
+
if (!TestTemplatesClass) {
|
|
97
|
+
TestTemplatesClass = await (await import('./spec-templates.backend')).TestTemplates;
|
|
98
|
+
}
|
|
99
|
+
TestTemplatesClass.regenerateSpecTs(this.specTsPath, this.testName);
|
|
100
|
+
this.regenerateGitIgnore();
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region private methods
|
|
105
|
+
//#region regenerate package json 5
|
|
106
|
+
regeneratePackageJson5() {
|
|
107
|
+
if (!Helpers.exists(this.firedev_jsonc)) {
|
|
108
|
+
Helpers.writeFile(this.firedev_jsonc,
|
|
109
|
+
//#region content of package.json5
|
|
110
|
+
`{
|
|
111
|
+
// generated from basename
|
|
112
|
+
"name": "${_.kebabCase(this.testName)}",
|
|
113
|
+
"description": "${this.testName}",
|
|
114
|
+
"tnp": {
|
|
115
|
+
"type": "cli-test"
|
|
116
|
+
},
|
|
117
|
+
"version": "0.0.0",
|
|
118
|
+
}`
|
|
119
|
+
//#endregion
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region regenerate gitignore
|
|
125
|
+
regenerateGitIgnore() {
|
|
126
|
+
Helpers.writeFile(this.gitignorePath,
|
|
127
|
+
//#region content of .gitignore
|
|
128
|
+
`
|
|
129
|
+
/**/*.*
|
|
130
|
+
!/.gitignore
|
|
131
|
+
!/${path.basename(this.specTsPath)}
|
|
132
|
+
!/package.json
|
|
133
|
+
!/package.json5
|
|
134
|
+
!/*.md
|
|
135
|
+
|
|
136
|
+
`
|
|
137
|
+
//#endregion
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceM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,CAAC,IAAI,CAAC,aAAa;YAClC,kCAAkC;YAClC;;aAEK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;oBACnB,IAAI,CAAC,QAAQ;;;;;IAK7B;YACI,YAAY;aACb,CAAC;QACJ,CAAC;IACH,CAAC;IACD,YAAY;IAEZ,8BAA8B;IACtB,mBAAmB;QAEzB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa;QAClC,+BAA+B;QAC/B;;;IAGF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC;;;;;OAK3B;QACD,YAAY;SACb,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const ENV_ANGULAR_NODE_APP_WEBSITE_DOMAIN = "node-cli-tester.example.domain.com";
|
|
2
|
+
export declare const ENV_ANGULAR_NODE_APP_WEBSITE_TITLE = "Node Cli Tester";
|
|
3
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_TARGET_ARTIFACT = "angular-node-app";
|
|
4
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_ENV_NAME = "__";
|
|
5
|
+
export declare const ENV_ANGULAR_NODE_APP_CONTAINER_ONLY: any;
|
|
6
|
+
export declare const ENV_ANGULAR_NODE_APP_CONTAINER_END: any;
|
|
7
|
+
export declare const ENV_ANGULAR_NODE_APP_CONTAINER_START: any;
|
|
8
|
+
export declare const ENV_ANGULAR_NODE_APP_CONTAINER_SKIP_RELEASED: any;
|
|
9
|
+
export declare const ENV_ANGULAR_NODE_APP_CONTAINER_SKIP: any;
|
|
10
|
+
export declare const ENV_ANGULAR_NODE_APP_INIT_BRANDING: any;
|
|
11
|
+
export declare const ENV_ANGULAR_NODE_APP_INIT_STRUCT: any;
|
|
12
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_PWA_DISABLE_SERVICE_WORKER: any;
|
|
13
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_PWA_NAME: any;
|
|
14
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_PWA_SHORT_NAME: any;
|
|
15
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_PWA_START_URL: any;
|
|
16
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_ELECTRON_SHOW_DEV_TOOLS: any;
|
|
17
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_SSR: any;
|
|
18
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_WEBSQL: any;
|
|
19
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_PROD: any;
|
|
20
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_OVERRIDE_OUTPUT_PATH: any;
|
|
21
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_BASE_HREF: any;
|
|
22
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_WATCH: any;
|
|
23
|
+
export declare const ENV_ANGULAR_NODE_APP_BUILD_GEN_ONLY_CLIENT_CODE: any;
|
|
24
|
+
export declare const ENV_ANGULAR_NODE_APP_LOADING_PRE_ANGULAR_BOOTSTRAP_LOADER: any;
|
|
25
|
+
export declare const ENV_ANGULAR_NODE_APP_LOADING_PRE_ANGULAR_BOOTSTRAP_BACKGROUND: any;
|
|
26
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_CLI_MINIFY: any;
|
|
27
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_CLI_INCLUDE_NODE_MODULES: any;
|
|
28
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_CLI_UGLIFY: any;
|
|
29
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_CLI_OBSCURE: any;
|
|
30
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_CLI_COMPRESS: any;
|
|
31
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_NODE_BACKEND_APP_MINIFY: any;
|
|
32
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_LIB_REMOVE_DTS: any;
|
|
33
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_LIB_OBSCURE_FILE_BY_FILE: any;
|
|
34
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_LIB_UGLIFY_FILE_BY_FILE: any;
|
|
35
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_LIB_INCLUDE_SOURCE_MAPS: any;
|
|
36
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_LIB_COMPRESS: any;
|
|
37
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_LIB_DO_NOT_INCLUDE_LIB_FILES: any;
|
|
38
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_RESOLVED_NEW_VERSION: any;
|
|
39
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_RELEASE_VERSION_BUMP_TYPE: any;
|
|
40
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_ENV_NUMBER: any;
|
|
41
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_INSTALL_LOCALLY: any;
|
|
42
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_REMOVE_RELEASE_OUTPUT_AFTER_LOCAL_INSTALL: any;
|
|
43
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_RELEASE_TYPE: any;
|
|
44
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_AUTO_RELEASE_USING_CONFIG: any;
|
|
45
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_AUTO_RELEASE_TASK_NAME: any;
|
|
46
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_TAON_INSTANCE_IP: any;
|
|
47
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_SKIP_NPM_PUBLISH: any;
|
|
48
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_SKIP_DEPLOY: any;
|
|
49
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_SKIP_TAG_GIT_PUSH: any;
|
|
50
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_SKIP_RELEASE_QUESTION: any;
|
|
51
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_SKIP_RESOLVING_GIT_CHANGES: any;
|
|
52
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_SKIP_CODE_CUTTING: any;
|
|
53
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_SKIP_BUILDING_ARTIFACTS: any;
|
|
54
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_PUSH_TO_ALL_ORIGINS_WHEN_LOCAL_RELEASE_BRANCH: any;
|
|
55
|
+
export declare const ENV_ANGULAR_NODE_APP_RELEASE_USE_LOCAL_RELEASE_BRANCH: any;
|
|
56
|
+
export declare const ENV_ANGULAR_NODE_APP_COPY_TO_MANAGER_BEFORE_COPY_HOOK: any;
|
|
57
|
+
export declare const ENV_ANGULAR_NODE_APP_COPY_TO_MANAGER_COPY_TO_LOCATIONS: any;
|
|
58
|
+
export declare const ENV_ANGULAR_NODE_APP_COPY_TO_MANAGER_COPY_TO_PROJECTS: any;
|
|
59
|
+
export declare const ENV_ANGULAR_NODE_APP_COPY_TO_MANAGER_SKIP: any;
|
|
60
|
+
export declare const ENV_ANGULAR_NODE_APP_WEBSITE_USE_DOMAIN: any;
|
|
61
|
+
export declare const ENV_ANGULAR_NODE_APP_PURPOSE: any;
|
|
62
|
+
export declare const ENV_ANGULAR_NODE_APP_RECURSIVE_ACTION: any;
|
|
63
|
+
export declare const ENV_ANGULAR_NODE_APP_IS_CI_PROCESS: any;
|
|
64
|
+
export declare const ENV_ANGULAR_NODE_APP_DOCKER_ADDITIONAL_CONTAINER: any;
|
|
65
|
+
export declare const ENV_ANGULAR_NODE_APP_DOCKER_SKIP_START_IN_ORDER: any;
|
|
66
|
+
export declare const ENV_ANGULAR_NODE_APP_DOCKER_SKIP_USING_MYSQL_DB: any;
|