@egen-civitas/egen 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +12 -1
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +1 -0
- package/dist/utils/config.d.ts +2 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +10 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @egen-civitas/egen
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 669cbd6: Réforme multiplateforme, lot P0 (docs/EGEN-FRAMEWORK-DEV.md) :
|
|
8
|
+
|
|
9
|
+
- esm-globals : `EgenTarget`, `CapabilityName`, `getEgenTarget()`, `isNativeTarget()`.
|
|
10
|
+
- esm-platform (nouveau package, 1.0.0) : contrats des capacités (annexe 2), `PlatformError`, détection de la cible, `getPlatform()` (adaptateur Web : session vide, `openExternal`, `lifecycle`, `files.select`, `camera`, `permissions` ; jamais de faux coffre ni de biométrie simulée. En natif, aucune capacité tant que le client de pont n'est pas branché, `ready` rejette `INCOMPATIBLE` sans Host), `createMockPlatform` (sous-chemin `/testing`).
|
|
11
|
+
- esm-framework : ré-export de `@egen-civitas/esm-platform` (`index`, `internal`, mocks).
|
|
12
|
+
- egen (CLI) : option `build --platform web|android|ios`.
|
|
13
|
+
- esm-api : `setAuthorizationProvider` (jeton fourni par la plateforme, rafraîchissement unique sur 401, rejeu GET/HEAD, politique `credentials`) ; `FetchConfig.replayOnUnauthorized` ; `isDevAuthBypassEnabled()` inerte en natif. Sans fournisseur, comportement inchangé.
|
|
14
|
+
- esm-dynamic-loading : overrides d'import map et de route map désactivés en cible native.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [d1d2d7d]
|
|
19
|
+
- Updated dependencies [b3d9419]
|
|
20
|
+
- Updated dependencies [ef3c97f]
|
|
21
|
+
- Updated dependencies [478e80c]
|
|
22
|
+
- @egen-civitas/esm-app-shell@2.9.0
|
|
23
|
+
|
|
3
24
|
## 2.2.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAc,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAiEzC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAc,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAiEzC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,YAsX/B"}
|
package/dist/cli.js
CHANGED
|
@@ -229,6 +229,15 @@ export function buildCli(y) {
|
|
|
229
229
|
default: 'production',
|
|
230
230
|
describe: 'The environment to build for. e.g., development, production.',
|
|
231
231
|
type: 'string'
|
|
232
|
+
}).option('platform', {
|
|
233
|
+
default: 'web',
|
|
234
|
+
choices: [
|
|
235
|
+
'web',
|
|
236
|
+
'android',
|
|
237
|
+
'ios'
|
|
238
|
+
],
|
|
239
|
+
describe: 'The target platform of the build. `android` and `ios` produce a self-contained, locked-down SPA for a native host (requires an absolute https API URL and inline importmap/routes).',
|
|
240
|
+
type: 'string'
|
|
232
241
|
}).option('asset', {
|
|
233
242
|
default: [],
|
|
234
243
|
describe: "The path to CSS or JS assets to copy into 'assets/' in the build directory, and include as <link> and <script> tags in the generated HTML. Can be used multiple times.",
|
|
@@ -238,7 +247,9 @@ export function buildCli(y) {
|
|
|
238
247
|
...args,
|
|
239
248
|
configUrls: args['config-url'],
|
|
240
249
|
configPaths: args['config-path'],
|
|
241
|
-
assets: args['asset']
|
|
250
|
+
assets: args['asset'],
|
|
251
|
+
// yargs ne type pas `choices` : la valeur est déjà restreinte à web | android | ios à l'exécution.
|
|
252
|
+
platform: args.platform
|
|
242
253
|
}));
|
|
243
254
|
y.command('assemble', 'Assembles an import map incl. all required resources.', (argv)=>argv.option('target', {
|
|
244
255
|
default: 'dist',
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface BuildArgs {
|
|
|
5
5
|
importmap?: string;
|
|
6
6
|
routes?: string;
|
|
7
7
|
spaPath: string;
|
|
8
|
+
platform?: 'web' | 'android' | 'ios';
|
|
8
9
|
fresh?: boolean;
|
|
9
10
|
apiUrl: string;
|
|
10
11
|
pageTitle: string;
|
|
@@ -25,6 +26,7 @@ export type BuildConfig = Partial<{
|
|
|
25
26
|
importmap: string;
|
|
26
27
|
routes: string;
|
|
27
28
|
spaPath: string;
|
|
29
|
+
platform: 'web' | 'android' | 'ios';
|
|
28
30
|
env: string;
|
|
29
31
|
assets: Array<string>;
|
|
30
32
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,WAA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AC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB,CAAC,CAAC;AAiBH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,SAAS,iBAqG7C"}
|
package/dist/commands/build.js
CHANGED
|
@@ -56,6 +56,7 @@ export async function runBuild(args) {
|
|
|
56
56
|
pageTitle: buildConfig.pageTitle || args.pageTitle,
|
|
57
57
|
supportOffline: buildConfig.supportOffline ?? args.supportOffline,
|
|
58
58
|
spaPath: buildConfig.spaPath || args.spaPath,
|
|
59
|
+
platform: buildConfig.platform || args.platform,
|
|
59
60
|
fresh: args.fresh ?? false,
|
|
60
61
|
assets: args.assets || buildConfig.assets || []
|
|
61
62
|
});
|
package/dist/utils/config.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface BuildOptions {
|
|
|
6
6
|
routes?: RoutesDeclaration;
|
|
7
7
|
apiUrl?: string;
|
|
8
8
|
spaPath?: string;
|
|
9
|
+
/** Cible de build : web (défaut), android ou ios. Voir `tools/targets.js` du shell. */
|
|
10
|
+
platform?: 'web' | 'android' | 'ios';
|
|
9
11
|
pageTitle?: string;
|
|
10
12
|
supportOffline?: boolean;
|
|
11
13
|
configUrls?: Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG3E,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,YAAiB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG3E,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,YAAiB,QAiFvD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,YAAiB,wCAmB3D"}
|
package/dist/utils/config.js
CHANGED
|
@@ -8,7 +8,12 @@ import { setEnvVariables } from "./variables.js";
|
|
|
8
8
|
if (typeof options.backend === 'string') {
|
|
9
9
|
variables.EGEN_PROXY_TARGET = options.backend;
|
|
10
10
|
}
|
|
11
|
-
if (typeof options.
|
|
11
|
+
if (typeof options.platform === 'string') {
|
|
12
|
+
variables.EGEN_TARGET = options.platform;
|
|
13
|
+
}
|
|
14
|
+
// Cibles natives : le chemin public est IMPOSÉ par la cible (voir tools/targets.js du shell) ; on ne
|
|
15
|
+
// transmet donc pas le `--spa-path` (dont la valeur par défaut est celle du Web).
|
|
16
|
+
if (typeof options.spaPath === 'string' && (options.platform === undefined || options.platform === 'web')) {
|
|
12
17
|
variables.EGEN_PUBLIC_PATH = options.spaPath;
|
|
13
18
|
}
|
|
14
19
|
if (typeof options.apiUrl === 'string') {
|
|
@@ -67,6 +72,10 @@ import { setEnvVariables } from "./variables.js";
|
|
|
67
72
|
export function loadBundlerConfig(options = {}) {
|
|
68
73
|
setBundlerEnv(options);
|
|
69
74
|
const require = createRequire(import.meta.url);
|
|
75
|
+
// La config rspack lit `process.env` à l'ÉVALUATION du module (constantes de tête) : Node met les modules CJS en
|
|
76
|
+
// cache, donc un second appel dans le même processus (mode watch, usage programmatique, tests) réutiliserait
|
|
77
|
+
// silencieusement les valeurs du premier (apiUrl, configUrls…), malgré `setBundlerEnv` ci-dessus.
|
|
78
|
+
delete require.cache[require.resolve('@egen-civitas/esm-app-shell/rspack.config.js')];
|
|
70
79
|
const config = require('@egen-civitas/esm-app-shell/rspack.config.js');
|
|
71
80
|
if (typeof config === 'function') {
|
|
72
81
|
return config({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egen-civitas/egen",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
],
|
|
61
61
|
"homepage": "https://github.com/amourgit/Frontend-esm-framework/tree/main/packages/tooling/egen#readme",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@egen-civitas/esm-app-shell": "^2.
|
|
63
|
+
"@egen-civitas/esm-app-shell": "^2.9.0",
|
|
64
64
|
"@egen-civitas/rspack-config": "^1.1.0",
|
|
65
65
|
"@egen-civitas/webpack-config": "^1.0.0",
|
|
66
66
|
"@inquirer/prompts": "8.3.2",
|