@genesislcap/build-kit 14.162.4 → 14.162.5
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/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/prompts.js +2 -2
- package/dist/utils/seed.commands.d.ts +19 -0
- package/dist/utils/seed.commands.d.ts.map +1 -0
- package/dist/utils/seed.commands.js +58 -0
- package/dist/utils/seed.processing.d.ts.map +1 -1
- package/dist/utils/seed.processing.js +4 -3
- package/package.json +3 -3
- package/src/index.ts +0 -2
- package/src/types/build-context.ts +0 -57
- package/src/types/config.ts +0 -269
- package/src/types/index.ts +0 -3
- package/src/types/pwa.ts +0 -67
- package/src/utils/archive.ts +0 -18
- package/src/utils/args.ts +0 -7
- package/src/utils/build-context.ts +0 -42
- package/src/utils/child-process.ts +0 -115
- package/src/utils/config.ts +0 -45
- package/src/utils/console.ts +0 -1
- package/src/utils/env.ts +0 -71
- package/src/utils/federation.ts +0 -40
- package/src/utils/fs.ts +0 -53
- package/src/utils/handlebars.ts +0 -61
- package/src/utils/https.ts +0 -29
- package/src/utils/index.ts +0 -21
- package/src/utils/json.ts +0 -12
- package/src/utils/npm.ts +0 -155
- package/src/utils/object.ts +0 -21
- package/src/utils/prompts.ts +0 -160
- package/src/utils/proxy.ts +0 -139
- package/src/utils/seed.fetching.ts +0 -257
- package/src/utils/seed.meta.ts +0 -34
- package/src/utils/seed.processing.ts +0 -100
- package/src/utils/seed.setup.ts +0 -101
- package/src/utils/time.ts +0 -1
- package/test/utils/args.test.ts +0 -17
- package/test/utils/build-context.test.ts +0 -68
- package/test/utils/env.test.ts +0 -212
- package/test/utils/handlebars.test.ts +0 -277
- package/test/utils/https.test.ts +0 -14
- package/test/utils/proxy.test.ts +0 -96
- package/test/utils/seed.fetching.test.ts +0 -145
- package/test/utils/seed.meta.test.ts +0 -33
- package/tsconfig.json +0 -18
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -17,6 +17,7 @@ tslib_1.__exportStar(require("./npm"), exports);
|
|
|
17
17
|
tslib_1.__exportStar(require("./prompts"), exports);
|
|
18
18
|
tslib_1.__exportStar(require("./proxy"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./object"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./seed.commands"), exports);
|
|
20
21
|
tslib_1.__exportStar(require("./seed.fetching"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./seed.meta"), exports);
|
|
22
23
|
tslib_1.__exportStar(require("./seed.processing"), exports);
|
package/dist/utils/prompts.js
CHANGED
|
@@ -77,9 +77,9 @@ exports.getPromptValidators = getPromptValidators;
|
|
|
77
77
|
// process CLI prompt params
|
|
78
78
|
const getCLIParams = (persistedAnswers, params, defaults, dir, subdir, skipOptionalPrompts, seedMeta, details, validate) => {
|
|
79
79
|
const base = skipOptionalPrompts ? defaults : {};
|
|
80
|
-
const cliParams = Object.assign(Object.assign(Object.assign(Object.assign({}, base), persistedAnswers), params), { appName: (0, node_path_1.basename)(dir), pkgName: (0, node_path_1.basename)(dir), directory:
|
|
80
|
+
const cliParams = Object.assign(Object.assign(Object.assign(Object.assign({}, base), persistedAnswers), params), { appName: (0, node_path_1.basename)(dir), pkgName: (0, node_path_1.basename)(dir), directory: dir, appSeed: {
|
|
81
81
|
type: seedMeta.local ? 'local' : 'remote',
|
|
82
|
-
name: seedMeta.seed,
|
|
82
|
+
name: (0, node_path_1.basename)(seedMeta.seed || ''),
|
|
83
83
|
description: details.description,
|
|
84
84
|
version: details.version,
|
|
85
85
|
repo: seedMeta.repo,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { COMMAND } from '../types';
|
|
2
|
+
export type SeedCommandOptions = {
|
|
3
|
+
insecure?: boolean;
|
|
4
|
+
seed?: string;
|
|
5
|
+
subdir?: string;
|
|
6
|
+
remote?: boolean;
|
|
7
|
+
ref?: string;
|
|
8
|
+
skipOptionalPrompts?: boolean;
|
|
9
|
+
isLogLevelVerbose?: boolean;
|
|
10
|
+
shell?: boolean;
|
|
11
|
+
scope?: boolean;
|
|
12
|
+
npm?: boolean;
|
|
13
|
+
skipInitDirCheck?: boolean;
|
|
14
|
+
params?: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const runSeedCommand: (dirpath: string, options: SeedCommandOptions, command?: COMMAND) => Promise<void>;
|
|
19
|
+
//# sourceMappingURL=seed.commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.commands.d.ts","sourceRoot":"","sources":["../../src/utils/seed.commands.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAOnC,MAAM,MAAM,kBAAkB,GAAG;IAE/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAInB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAI5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAGhB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,MAAM,CAAC,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,WACN,kBAAkB,YAClB,OAAO,kBAmEjB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runSeedCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const consola_1 = require("consola");
|
|
8
|
+
const types_1 = require("../types");
|
|
9
|
+
const child_process_1 = require("./child-process");
|
|
10
|
+
const console_1 = require("./console");
|
|
11
|
+
const seed_fetching_1 = require("./seed.fetching");
|
|
12
|
+
const seed_meta_1 = require("./seed.meta");
|
|
13
|
+
const seed_setup_1 = require("./seed.setup");
|
|
14
|
+
const runSeedCommand = (dirpath, options, command = types_1.COMMAND.INIT) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const dir = (0, node_path_1.resolve)(process.cwd(), dirpath);
|
|
16
|
+
const start = Date.now();
|
|
17
|
+
consola_1.consola.debug('CLI options', { dir, options, command });
|
|
18
|
+
const isInit = command === types_1.COMMAND.INIT;
|
|
19
|
+
const { insecure, seed, subdir, remote, ref, skipOptionalPrompts, params, isLogLevelVerbose, shell, scope, npm, skipInitDirCheck, } = options;
|
|
20
|
+
if (isLogLevelVerbose) {
|
|
21
|
+
// Enables debug output in giget
|
|
22
|
+
process.env.DEBUG = '1';
|
|
23
|
+
// Debug level https://github.com/unjs/consola#log-level
|
|
24
|
+
process.env.CONSOLA_LEVEL = '4';
|
|
25
|
+
consola_1.consola.level = 4;
|
|
26
|
+
}
|
|
27
|
+
// don't overwrite if exists
|
|
28
|
+
if (isInit && (0, node_fs_1.existsSync)(dir) && !skipInitDirCheck) {
|
|
29
|
+
consola_1.consola.error(`Target directory ${(0, console_1.bold)(dir)} already exists.`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
// for add operation there is no default seed - it needs to be specified explicitly
|
|
33
|
+
if (!isInit && !seed) {
|
|
34
|
+
consola_1.consola.error(`Please specify a seed.`);
|
|
35
|
+
process.exit();
|
|
36
|
+
}
|
|
37
|
+
// fetch remote or copy local seed
|
|
38
|
+
const result = yield (0, seed_fetching_1.fetchSeed)(seed, dir, remote, ref, insecure, subdir, isInit, npm, scope);
|
|
39
|
+
consola_1.consola.debug('Seed fetched', result);
|
|
40
|
+
// NPM install in .genx folder
|
|
41
|
+
yield (0, seed_setup_1.installSeedDeps)(result.extractedSeedGenxDir, isLogLevelVerbose);
|
|
42
|
+
const seedInfo = yield (0, seed_meta_1.loadSeed)(result.extractedSeedGenxDir);
|
|
43
|
+
consola_1.consola.debug('Seed loaded', seedInfo);
|
|
44
|
+
// run seed configure script
|
|
45
|
+
yield (0, seed_setup_1.configureSeedApp)(seedInfo, result, params, dir, skipOptionalPrompts, isInit);
|
|
46
|
+
const label = isInit ? 'created' : 'updated';
|
|
47
|
+
consola_1.consola.success(`Project successfully ${label} in ${Date.now() - start}ms.`);
|
|
48
|
+
// show next steps message if defined in seed details
|
|
49
|
+
const nextStepsMessage = seedInfo.details.nextStepsMessage;
|
|
50
|
+
if (nextStepsMessage === null || nextStepsMessage === void 0 ? void 0 : nextStepsMessage.length) {
|
|
51
|
+
consola_1.consola.info(`Next steps: \n` + nextStepsMessage);
|
|
52
|
+
}
|
|
53
|
+
// launch shell in app dir
|
|
54
|
+
if (shell) {
|
|
55
|
+
(0, child_process_1.startShell)(dir);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
exports.runSeedCommand = runSeedCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.processing.d.ts","sourceRoot":"","sources":["../../src/utils/seed.processing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seed.processing.d.ts","sourceRoot":"","sources":["../../src/utils/seed.processing.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,eAAO,MAAM,gBAAgB,yBAA2B,MAAM,EAAE,kBAkB/D,CAAC;AAmCF,eAAO,MAAM,cAAc,yFAuC1B,CAAC"}
|
|
@@ -9,6 +9,7 @@ const console_1 = require("./console");
|
|
|
9
9
|
const fs_1 = require("./fs");
|
|
10
10
|
const handlebars_1 = require("./handlebars");
|
|
11
11
|
const json_1 = require("./json");
|
|
12
|
+
const formatPersistedData = (data) => (Object.assign(Object.assign({}, data), { directory: (0, node_path_1.basename)(data.directory) }));
|
|
12
13
|
exports.PROMPT_DATA_FILE = 'answers.json';
|
|
13
14
|
const removeExclusions = (dir, exclusions) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
15
|
try {
|
|
@@ -78,10 +79,10 @@ const processOptions = (fetchSeedResult, dir, data, isInit, persistedAnswers) =>
|
|
|
78
79
|
if (options.persistAnswers) {
|
|
79
80
|
const jsonPath = (0, node_path_1.resolve)(fetchSeedResult.genxDir, exports.PROMPT_DATA_FILE);
|
|
80
81
|
const additions = persistedAnswers.additions || [];
|
|
81
|
-
const
|
|
82
|
+
const persistedData = isInit
|
|
82
83
|
? data
|
|
83
|
-
: Object.assign(Object.assign({},
|
|
84
|
-
(0, json_1.writeJSON)(jsonPath,
|
|
84
|
+
: Object.assign(Object.assign({}, persistedAnswers), { additions: [...additions, data] });
|
|
85
|
+
(0, json_1.writeJSON)(jsonPath, formatPersistedData(persistedData));
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
exports.processOptions = processOptions;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/build-kit",
|
|
3
3
|
"description": "Build utilities & types",
|
|
4
|
-
"version": "14.162.
|
|
4
|
+
"version": "14.162.5",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@esbuild-kit/cjs-loader": "2.4.2",
|
|
39
|
-
"@genesislcap/foundation-testing": "14.162.
|
|
39
|
+
"@genesislcap/foundation-testing": "14.162.5",
|
|
40
40
|
"@types/http-proxy": "^1.17.8",
|
|
41
41
|
"@types/node": "^20.8.7",
|
|
42
42
|
"tsm": "^2.2.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "47733285b6e2d7988941967021ea4a48e9613aba"
|
|
55
55
|
}
|
package/src/index.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { PackageJson } from 'pkg-types';
|
|
2
|
-
import { Config } from './config';
|
|
3
|
-
|
|
4
|
-
export enum ENV {
|
|
5
|
-
PROD = 'production',
|
|
6
|
-
DEV = 'development',
|
|
7
|
-
TEST = 'test',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export enum COMMAND {
|
|
11
|
-
BUILD = 'build',
|
|
12
|
-
DEV = 'dev',
|
|
13
|
-
TEST = 'test',
|
|
14
|
-
ANALYZE = 'analyze',
|
|
15
|
-
RUN = 'run',
|
|
16
|
-
UPGRADE = 'upgrade',
|
|
17
|
-
LINT = 'lint',
|
|
18
|
-
INIT = 'init',
|
|
19
|
-
ADD = 'add',
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface BuildContext {
|
|
23
|
-
cli: {
|
|
24
|
-
command: COMMAND;
|
|
25
|
-
isDev: boolean;
|
|
26
|
-
isBuild: boolean;
|
|
27
|
-
isTest: boolean;
|
|
28
|
-
isAnalyze: boolean;
|
|
29
|
-
isRun: boolean;
|
|
30
|
-
isLint: boolean;
|
|
31
|
-
// CLI options
|
|
32
|
-
options: { [index: string]: any };
|
|
33
|
-
};
|
|
34
|
-
env: {
|
|
35
|
-
isCI: boolean;
|
|
36
|
-
};
|
|
37
|
-
// resolved options from genx.config.{js,json,ts} or genx key in package.json
|
|
38
|
-
config: Config;
|
|
39
|
-
// package.json of current project
|
|
40
|
-
pkg: PackageJson;
|
|
41
|
-
dirs: {
|
|
42
|
-
// working directory
|
|
43
|
-
cwd: string;
|
|
44
|
-
// monorepo root directory
|
|
45
|
-
workspace?: string;
|
|
46
|
-
};
|
|
47
|
-
resolve: {
|
|
48
|
-
alias: {
|
|
49
|
-
[index: string]: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
enable: {
|
|
53
|
-
apiExtractor?: object;
|
|
54
|
-
cemAnalyzer?: object;
|
|
55
|
-
mft?: object;
|
|
56
|
-
};
|
|
57
|
-
}
|
package/src/types/config.ts
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import { COMMAND } from './build-context';
|
|
2
|
-
import { PWAManifest } from './pwa';
|
|
3
|
-
|
|
4
|
-
export interface WebpackFilenames {
|
|
5
|
-
chunk?: ({ isDev }: { isDev: boolean }) => string;
|
|
6
|
-
file?: ({ isDev }: { isDev: boolean }) => string;
|
|
7
|
-
sourceMap?: ({ isDev }: { isDev: boolean }) => string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* GENX CLI configuration
|
|
12
|
-
* Loaded from genx.config.{js,json,ts} or genx key in package.json in working directory
|
|
13
|
-
*/
|
|
14
|
-
export interface Config {
|
|
15
|
-
app?: {
|
|
16
|
-
/**
|
|
17
|
-
* Root application element name (must include hyphen)
|
|
18
|
-
*/
|
|
19
|
-
rootElement?: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Override default builder for a given CLI command (dev/build/analyze/test).
|
|
23
|
-
* A given builder typically supports a subset of all possible commands (e.g. a test runner won't handle analyze command).
|
|
24
|
-
* If you use an incompatible builder, you'll get an unrecognized command error.
|
|
25
|
-
* @defaultValue
|
|
26
|
-
* ```
|
|
27
|
-
* {
|
|
28
|
-
* default: 'webpack',
|
|
29
|
-
* dev: 'vite',
|
|
30
|
-
* lint: 'eslint-stylelint',
|
|
31
|
-
* test: 'uvu-playwright',
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
* @example
|
|
35
|
-
* ```
|
|
36
|
-
* "builder": {
|
|
37
|
-
* "build": "ts",
|
|
38
|
-
* "dev": "ts"
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
builder?: {
|
|
43
|
-
[index in COMMAND | 'default']: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Controls whether dist folder should be cleared out before the build.
|
|
47
|
-
* Can be overriden using `GENX_NO_CLEAN` environment variable.
|
|
48
|
-
* @defaultValue true
|
|
49
|
-
*/
|
|
50
|
-
clean?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Static assets to copy during the build.
|
|
53
|
-
* @defaultValue ['src/**\/*.{css,jpg,png,svg,mp4,ogg,webm}']
|
|
54
|
-
*/
|
|
55
|
-
copyAssets?: string[];
|
|
56
|
-
/**
|
|
57
|
-
* Override default entry point
|
|
58
|
-
* Paths are resolved relative to src folder
|
|
59
|
-
* @example
|
|
60
|
-
* ```
|
|
61
|
-
* "entry": {
|
|
62
|
-
* "electron": "electron.main.ts"
|
|
63
|
-
* }
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
entry?: string | { [index: string]: string };
|
|
67
|
-
/**
|
|
68
|
-
* Environment variables to expose in UI code. Regex patterns allowed.
|
|
69
|
-
* @defaultValue `['API_HOST', 'DEFAULT_ORGANISATION', 'DEFAULT_USER', 'DEFAULT_PASSWORD', 'ENABLE_SSO', 'GENX.*', 'GENX_*', 'FORCE_HTTP', 'SOCKET_EXT']
|
|
70
|
-
*/
|
|
71
|
-
env?: string[];
|
|
72
|
-
/**
|
|
73
|
-
* Exclude modules from the output bundle.
|
|
74
|
-
* @remark This setting has no effect on `ts-builder`
|
|
75
|
-
* @defaultValue `index.ts`
|
|
76
|
-
* @example
|
|
77
|
-
* ```
|
|
78
|
-
* "externals": {
|
|
79
|
-
* "@ag-grid-community/core": "agGrid"
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
externals?: {
|
|
84
|
-
[index: string]: string;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Module federation options.
|
|
88
|
-
*/
|
|
89
|
-
federation?: {
|
|
90
|
-
/**
|
|
91
|
-
* Federation dashboard URL
|
|
92
|
-
*/
|
|
93
|
-
dashboardURL?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Federation publish version
|
|
96
|
-
* Defaults to version in package.json.
|
|
97
|
-
*/
|
|
98
|
-
publishVersion?: string;
|
|
99
|
-
/**
|
|
100
|
-
* Remote federated modules
|
|
101
|
-
* @example
|
|
102
|
-
* ```
|
|
103
|
-
* remotes: ["@genesislcap/foundation-zero"]
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
remotes?: {
|
|
107
|
-
[index: string]: string;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Shared federated modules
|
|
111
|
-
* @example
|
|
112
|
-
* ```
|
|
113
|
-
* shared: ["@microsoft/fast-components", "@microsoft/fast-element", "@microsoft/fast-foundation"]
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
shared?: {
|
|
117
|
-
[index: string]: string | { singleton: boolean; requiredVersion: string };
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Exposed entry points
|
|
121
|
-
* @example
|
|
122
|
-
* ```
|
|
123
|
-
* exposes: {
|
|
124
|
-
* "./index": "./src/index.federated.ts",
|
|
125
|
-
* "./utils": "./src/utils/index.ts"
|
|
126
|
-
* }
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
exposes?: {
|
|
130
|
-
[index: string]: string;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* HTTP polling configuration.
|
|
135
|
-
* @example
|
|
136
|
-
* ```
|
|
137
|
-
* http: {
|
|
138
|
-
* "POLLING_MAP": {
|
|
139
|
-
* "EVENT_AMEND_USER": {
|
|
140
|
-
* "TEMP_FREQUENCY": 400,
|
|
141
|
-
* "AMOUNT_OF_POLLS": 5,
|
|
142
|
-
* "QUERIES": [
|
|
143
|
-
* "ALL_USERS"
|
|
144
|
-
* ]
|
|
145
|
-
* }
|
|
146
|
-
* },
|
|
147
|
-
* "POLLING_INTERVAL_MAP": {
|
|
148
|
-
* "ALL_TRADES": 4000,
|
|
149
|
-
* "ALL_USERS": 4000,
|
|
150
|
-
* "ALL_PROCESSES_STATUS": 5000
|
|
151
|
-
* },
|
|
152
|
-
* "POLLING_FREQUENCY": 4000
|
|
153
|
-
* }
|
|
154
|
-
* ```
|
|
155
|
-
*/
|
|
156
|
-
http?: object;
|
|
157
|
-
/*
|
|
158
|
-
* Web application manifest
|
|
159
|
-
* @remarks
|
|
160
|
-
* Keys are specified using camel case notation
|
|
161
|
-
*
|
|
162
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Manifest
|
|
163
|
-
* @example
|
|
164
|
-
* ```
|
|
165
|
-
* pwa: {
|
|
166
|
-
* name: 'SampleApp',
|
|
167
|
-
* shortName: 'SampleApp',
|
|
168
|
-
* startUrl: '.',
|
|
169
|
-
* display: 'standalone',
|
|
170
|
-
* backgroundColor: '#FFF',
|
|
171
|
-
* description: 'Application manifest example.',
|
|
172
|
-
* icons: [{
|
|
173
|
-
* src: 'images/touch/homescreen48.png',
|
|
174
|
-
* sizes: [48]
|
|
175
|
-
* }]
|
|
176
|
-
* }
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
pwa?: PWAManifest;
|
|
180
|
-
/*
|
|
181
|
-
* Server worker configuration
|
|
182
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
|
|
183
|
-
*/
|
|
184
|
-
serviceWorker?: {
|
|
185
|
-
/*
|
|
186
|
-
* Service worker file
|
|
187
|
-
*/
|
|
188
|
-
worker: string;
|
|
189
|
-
/*
|
|
190
|
-
* Service worker registration file
|
|
191
|
-
*/
|
|
192
|
-
registration: string;
|
|
193
|
-
/*
|
|
194
|
-
* Generated service worker asset filename
|
|
195
|
-
* @defaultValue `service-worker.js`
|
|
196
|
-
*/
|
|
197
|
-
assetName?: string;
|
|
198
|
-
/*
|
|
199
|
-
* Exclude from from the precache manifest
|
|
200
|
-
* @defaultValue `[/\.map$/, /^manifest.*\.js$]`
|
|
201
|
-
*/
|
|
202
|
-
exclude?: Array<string | RegExp | ((arg0: any) => boolean)>;
|
|
203
|
-
/*
|
|
204
|
-
* Maximum size of files to precache, in bytes. This prevents you from inadvertently precaching very large files that might have accidentally matched one of your patterns.
|
|
205
|
-
* @defaultValue `2097152`
|
|
206
|
-
*/
|
|
207
|
-
maximumFileSizeToCache?: number;
|
|
208
|
-
};
|
|
209
|
-
/*
|
|
210
|
-
* Webpack specific configuration
|
|
211
|
-
*/
|
|
212
|
-
webpack?: {
|
|
213
|
-
/*
|
|
214
|
-
* Whether to polyfill or mock certain Node.js globals
|
|
215
|
-
* @see https://webpack.js.org/configuration/node/
|
|
216
|
-
*/
|
|
217
|
-
node?:
|
|
218
|
-
| false
|
|
219
|
-
| {
|
|
220
|
-
[index: string]: boolean | string;
|
|
221
|
-
};
|
|
222
|
-
/**
|
|
223
|
-
* Customize bundle filenames.
|
|
224
|
-
*
|
|
225
|
-
* @note Be careful when using non-hashed based filenames in production
|
|
226
|
-
* as most browsers will cache the asset and not detect the changes on first load.
|
|
227
|
-
*
|
|
228
|
-
* @see https://webpack.js.org/configuration/output/#outputfilename
|
|
229
|
-
* @example
|
|
230
|
-
* ```js
|
|
231
|
-
* filenames: {
|
|
232
|
-
* chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[contenthash].js')
|
|
233
|
-
* }
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
filenames?: WebpackFilenames;
|
|
237
|
-
/**
|
|
238
|
-
* Customize Webpack optimization settings.
|
|
239
|
-
*
|
|
240
|
-
* @see https://webpack.js.org/configuration/optimization/
|
|
241
|
-
*/
|
|
242
|
-
optimization?: ({ isDev }: { isDev: boolean }) => unknown;
|
|
243
|
-
/**
|
|
244
|
-
* Set Webpack deployment target.
|
|
245
|
-
*
|
|
246
|
-
* @see https://webpack.js.org/concepts/targets/
|
|
247
|
-
*/
|
|
248
|
-
target?: string | false | string[];
|
|
249
|
-
/**
|
|
250
|
-
* Dev server middleware writeToDisk toggle.
|
|
251
|
-
*
|
|
252
|
-
* @remarks
|
|
253
|
-
* Useful during development when watching packages for changes that are bundled with webpack.
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* ```json
|
|
257
|
-
* "genx": {
|
|
258
|
-
* "app": {...},
|
|
259
|
-
* "webpack": {
|
|
260
|
-
* "writeToDisk": true
|
|
261
|
-
* }
|
|
262
|
-
* },
|
|
263
|
-
* ```
|
|
264
|
-
*
|
|
265
|
-
* @see https://webpack.js.org/configuration/dev-server/#devserverdevmiddleware
|
|
266
|
-
*/
|
|
267
|
-
writeToDisk?: boolean;
|
|
268
|
-
};
|
|
269
|
-
}
|
package/src/types/index.ts
DELETED
package/src/types/pwa.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export type PWADirection = 'ltr' | 'rtl' | 'auto';
|
|
2
|
-
export type PWADisplay = 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser';
|
|
3
|
-
export type PWAOrientation =
|
|
4
|
-
| 'any'
|
|
5
|
-
| 'natural'
|
|
6
|
-
| 'landscape'
|
|
7
|
-
| 'landscape-primary'
|
|
8
|
-
| 'landscape-secondary'
|
|
9
|
-
| 'portrait'
|
|
10
|
-
| 'portrait-primary'
|
|
11
|
-
| 'portrait-secondary';
|
|
12
|
-
export type PWACrossOrigin = 'use-credentials' | 'anonymous';
|
|
13
|
-
|
|
14
|
-
export interface PWARelatedApplications {
|
|
15
|
-
platform?: string;
|
|
16
|
-
url: string;
|
|
17
|
-
id?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface PWAIosOptions {
|
|
20
|
-
'apple-touch-icon'?: string | PWAIosAppleTouchIcon;
|
|
21
|
-
'apple-touch-startup-image'?: string;
|
|
22
|
-
'apple-mobile-web-app-title'?: string;
|
|
23
|
-
'apple-mobile-web-app-capable'?: 'yes' | 'no' | boolean;
|
|
24
|
-
'apple-mobile-web-app-status-bar-style'?: 'default' | 'black' | 'black-translucent';
|
|
25
|
-
}
|
|
26
|
-
export interface PWAIosAppleTouchIcon {
|
|
27
|
-
sizes?: string | number;
|
|
28
|
-
href: string;
|
|
29
|
-
}
|
|
30
|
-
export interface PWAIcon {
|
|
31
|
-
src: string;
|
|
32
|
-
size?: string | number;
|
|
33
|
-
sizes?: number[];
|
|
34
|
-
destination?: string;
|
|
35
|
-
ios?: boolean | 'default' | 'startup';
|
|
36
|
-
purpose?: string;
|
|
37
|
-
type?: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Only listing the officially supported keys here https://developer.mozilla.org/en-US/docs/Web/Manifest
|
|
41
|
-
// Bundler-specific keys can still be passed in because of the index type below
|
|
42
|
-
export interface PWAManifest {
|
|
43
|
-
backgroundColor?: string;
|
|
44
|
-
categories?: string[];
|
|
45
|
-
crossorigin?: PWACrossOrigin;
|
|
46
|
-
description?: string;
|
|
47
|
-
dir?: PWADirection;
|
|
48
|
-
display?: PWADisplay;
|
|
49
|
-
displayOverride?: string[];
|
|
50
|
-
fileHandlers?: object[];
|
|
51
|
-
icons?: PWAIcon | PWAIcon[];
|
|
52
|
-
id?: string;
|
|
53
|
-
ios?: boolean | PWAIosOptions;
|
|
54
|
-
lang?: string;
|
|
55
|
-
launchHandler?: object;
|
|
56
|
-
name: string;
|
|
57
|
-
orientation?: PWAOrientation;
|
|
58
|
-
preferRelatedApplications?: boolean;
|
|
59
|
-
relatedApplications?: PWARelatedApplications[];
|
|
60
|
-
scope?: string;
|
|
61
|
-
screenshots?: object[];
|
|
62
|
-
shareTarget?: string;
|
|
63
|
-
shortName?: string;
|
|
64
|
-
startUrl?: string;
|
|
65
|
-
themeColor?: string;
|
|
66
|
-
[index: string]: string | object | boolean;
|
|
67
|
-
}
|
package/src/utils/archive.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { cpSync } from 'node:fs';
|
|
2
|
-
import consola from 'consola';
|
|
3
|
-
import download from 'download-tarball';
|
|
4
|
-
import tmp from 'tmp';
|
|
5
|
-
|
|
6
|
-
export const downloadTarball = async (url: string, destination: string, subPath = '') => {
|
|
7
|
-
const tmpDir = tmp.dirSync();
|
|
8
|
-
|
|
9
|
-
consola.debug({
|
|
10
|
-
tmp: tmpDir.name,
|
|
11
|
-
destination,
|
|
12
|
-
url,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
await download({ url, dir: tmpDir.name });
|
|
16
|
-
const source = `${tmpDir.name}${subPath}`;
|
|
17
|
-
cpSync(`${source}`, destination, { recursive: true });
|
|
18
|
-
};
|
package/src/utils/args.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
2
|
-
import { findWorkspaceDir } from 'pkg-types';
|
|
3
|
-
import { BuildContext, COMMAND } from '../types';
|
|
4
|
-
import { loadConfig } from './config';
|
|
5
|
-
import { loadPackageJSON, tryRequire } from './npm';
|
|
6
|
-
|
|
7
|
-
export const loadBuildContext = async (cwd, command: COMMAND, options): Promise<BuildContext> => {
|
|
8
|
-
const pkg = await loadPackageJSON();
|
|
9
|
-
const workspace = await findWorkspaceDir();
|
|
10
|
-
const config = await loadConfig(pkg);
|
|
11
|
-
return {
|
|
12
|
-
cli: {
|
|
13
|
-
command,
|
|
14
|
-
isDev: command === COMMAND.DEV,
|
|
15
|
-
isAnalyze: command === COMMAND.ANALYZE,
|
|
16
|
-
isBuild: command === COMMAND.BUILD,
|
|
17
|
-
isTest: command === COMMAND.TEST,
|
|
18
|
-
isRun: command === COMMAND.RUN,
|
|
19
|
-
isLint: command === COMMAND.LINT,
|
|
20
|
-
options,
|
|
21
|
-
},
|
|
22
|
-
env: {
|
|
23
|
-
isCI: !!process.env.CI,
|
|
24
|
-
},
|
|
25
|
-
dirs: {
|
|
26
|
-
cwd,
|
|
27
|
-
workspace,
|
|
28
|
-
},
|
|
29
|
-
resolve: {
|
|
30
|
-
alias: {
|
|
31
|
-
pbc: resolve(cwd, './src/pbc'),
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
pkg,
|
|
35
|
-
config,
|
|
36
|
-
enable: {
|
|
37
|
-
apiExtractor: tryRequire('./api-extractor', cwd),
|
|
38
|
-
cemAnalyzer: tryRequire('./custom-elements-manifest.config', cwd),
|
|
39
|
-
mft: tryRequire('./federation.config'),
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
};
|