@angular-architects/native-federation 1.1.0-beta.0 → 16.1.1

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.
Files changed (59) hide show
  1. package/README.md +154 -137
  2. package/builders.json +1 -1
  3. package/config.d.ts +1 -1
  4. package/config.js +4 -4
  5. package/package.json +12 -16
  6. package/src/builders/build/builder.d.ts +5 -5
  7. package/src/builders/build/builder.js +79 -146
  8. package/src/builders/build/builder.js.map +1 -1
  9. package/src/builders/build/schema.d.ts +8 -1
  10. package/src/builders/build/schema.json +19 -532
  11. package/src/builders/serve/builder.ts.bak +57 -0
  12. package/src/builders/serve/schema.json.bak +107 -0
  13. package/src/config.d.ts +2 -2
  14. package/src/config.js +9 -9
  15. package/src/executors/build/executor.d.ts +4 -4
  16. package/src/executors/build/executor.js +12 -12
  17. package/src/generators/native-federation/generator.d.ts +3 -3
  18. package/src/generators/native-federation/generator.js +43 -43
  19. package/src/generators/native-federation/generator.js.map +1 -1
  20. package/src/index.d.ts +1 -1
  21. package/src/index.js +1 -5
  22. package/src/plugin/dev-externals-mixin.d.ts +1 -0
  23. package/src/plugin/dev-externals-mixin.js +30 -0
  24. package/src/plugin/dev-externals-mixin.js.map +1 -0
  25. package/src/plugin/externals-skip-list.d.ts +2 -0
  26. package/src/plugin/externals-skip-list.js +9 -0
  27. package/src/plugin/externals-skip-list.js.map +1 -0
  28. package/src/plugin/index.d.ts +2 -0
  29. package/src/plugin/index.js +101 -0
  30. package/src/plugin/index.js.map +1 -0
  31. package/src/schematics/init/files/federation.config.js__tmpl__ +8 -0
  32. package/src/schematics/init/schematic.d.ts +4 -4
  33. package/src/schematics/init/schematic.js +194 -161
  34. package/src/schematics/init/schematic.js.map +1 -1
  35. package/src/utils/angular-esbuild-adapter.d.ts +6 -3
  36. package/src/utils/angular-esbuild-adapter.js +140 -90
  37. package/src/utils/angular-esbuild-adapter.js.map +1 -1
  38. package/src/utils/dev-server.d.ts +4 -0
  39. package/src/utils/dev-server.js +41 -0
  40. package/src/utils/dev-server.js.map +1 -0
  41. package/src/utils/event-sorce.d.ts +9 -0
  42. package/src/utils/event-sorce.js +20 -0
  43. package/src/utils/event-sorce.js.map +1 -0
  44. package/src/utils/rebuild-events.d.ts +9 -0
  45. package/src/utils/rebuild-events.js +12 -0
  46. package/src/utils/rebuild-events.js.map +1 -0
  47. package/src/utils/rollup.d.ts +1 -1
  48. package/src/utils/rollup.js +57 -57
  49. package/src/utils/rollup.js.map +1 -1
  50. package/src/utils/rollup.ts.bak +60 -0
  51. package/src/utils/shared-mappings-plugin.d.ts +3 -3
  52. package/src/utils/shared-mappings-plugin.js +28 -28
  53. package/src/utils/shared-mappings-plugin.js.map +1 -1
  54. package/src/utils/transform.d.ts +1 -0
  55. package/src/utils/transform.js +45 -0
  56. package/src/utils/transform.js.map +1 -0
  57. package/src/utils/updateIndexHtml.d.ts +2 -0
  58. package/src/utils/updateIndexHtml.js +33 -0
  59. package/src/utils/updateIndexHtml.js.map +1 -0
@@ -1,91 +1,141 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadEsmModule = exports.AngularEsBuildAdapter = void 0;
4
- const tslib_1 = require("tslib");
5
- const build_1 = require("@softarc/native-federation/build");
6
- const esbuild = require("esbuild");
7
- const compiler_plugin_1 = require("@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin");
8
- const shared_mappings_plugin_1 = require("./shared-mappings-plugin");
9
- const rollup_1 = require("./rollup");
10
- const fs = require("fs");
11
- const core_1 = require("@babel/core");
12
- const AngularEsBuildAdapter = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
13
- const { entryPoint, tsConfigPath, external, outfile, mappedPaths, kind, watch, } = options;
14
- if (kind === 'shared-package') {
15
- yield (0, rollup_1.runRollup)(entryPoint, external, outfile);
16
- }
17
- else {
18
- yield runEsbuild(entryPoint, external, outfile, tsConfigPath, mappedPaths, watch);
19
- }
20
- if (kind === 'shared-package' && fs.existsSync(outfile)) {
21
- yield link(outfile);
22
- }
23
- });
24
- exports.AngularEsBuildAdapter = AngularEsBuildAdapter;
25
- function link(outfile) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- const code = fs.readFileSync(outfile, 'utf-8');
28
- try {
29
- const linkerEsm = yield loadEsmModule('@angular/compiler-cli/linker/babel');
30
- const linker = linkerEsm.default;
31
- const result = yield (0, core_1.transformAsync)(code, {
32
- filename: outfile,
33
- // inputSourceMap: (useInputSourcemap ? undefined : false) as undefined,
34
- // sourceMaps: pluginOptions.sourcemap ? 'inline' : false,
35
- compact: false,
36
- configFile: false,
37
- babelrc: false,
38
- minified: true,
39
- browserslistConfigFile: false,
40
- plugins: [linker],
41
- });
42
- fs.writeFileSync(outfile, result.code, 'utf-8');
43
- }
44
- catch (e) {
45
- build_1.logger.error('error linking');
46
- if (fs.existsSync(`${outfile}.error`)) {
47
- fs.unlinkSync(`${outfile}.error`);
48
- }
49
- fs.renameSync(outfile, `${outfile}.error`);
50
- throw e;
51
- }
52
- });
53
- }
54
- function runEsbuild(entryPoint, external, outfile, tsConfigPath, mappedPaths, watch, plugins = null, absWorkingDir = undefined, logLevel = 'warning') {
55
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
- return yield esbuild.build({
57
- entryPoints: [entryPoint],
58
- absWorkingDir,
59
- external,
60
- outfile,
61
- logLevel,
62
- watch: !!watch,
63
- bundle: true,
64
- sourcemap: true,
65
- minify: true,
66
- platform: 'browser',
67
- format: 'esm',
68
- target: ['esnext'],
69
- plugins: plugins || [
70
- (0, compiler_plugin_1.createCompilerPlugin)({
71
- sourcemap: true,
72
- tsconfig: tsConfigPath,
73
- advancedOptimizations: true,
74
- thirdPartySourcemaps: true,
75
- }, {
76
- optimization: true,
77
- sourcemap: true,
78
- workspaceRoot: __dirname,
79
- }),
80
- ...(mappedPaths && mappedPaths.length > 0
81
- ? [(0, shared_mappings_plugin_1.createSharedMappingsPlugin)(mappedPaths)]
82
- : []),
83
- ],
84
- });
85
- });
86
- }
87
- function loadEsmModule(modulePath) {
88
- return new Function('modulePath', `return import(modulePath);`)(modulePath);
89
- }
90
- exports.loadEsmModule = loadEsmModule;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadEsmModule = exports.createAngularBuildAdapter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const build_1 = require("@softarc/native-federation/build");
6
+ const esbuild = tslib_1.__importStar(require("esbuild"));
7
+ const compiler_plugin_1 = require("@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin");
8
+ const transform_1 = require("./transform");
9
+ // TODO: Use this import instead in next version:
10
+ // import {
11
+ // transformSupportedBrowsersToTargets
12
+ // } from '@angular-devkit/build-angular/src/tools/esbuild/utils';
13
+ const supported_browsers_1 = require("@angular-devkit/build-angular/src/utils/supported-browsers");
14
+ const shared_mappings_plugin_1 = require("./shared-mappings-plugin");
15
+ const fs = tslib_1.__importStar(require("fs"));
16
+ const path = tslib_1.__importStar(require("path"));
17
+ const core_1 = require("@babel/core");
18
+ const rebuild_events_1 = require("./rebuild-events");
19
+ const fesmFolderRegExp = /[/\\]fesm\d+[/\\]/;
20
+ function createAngularBuildAdapter(builderOptions, context, rebuildRequested = new rebuild_events_1.RebuildHubs()) {
21
+ return (options) => tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const { entryPoint, tsConfigPath, external, outfile, mappedPaths, kind, watch, dev, } = options;
23
+ // TODO: Do we still need rollup as esbuilt evolved?
24
+ // if (kind === 'shared-package') {
25
+ // await runRollup(entryPoint, external, outfile);
26
+ // } else {
27
+ if (dev &&
28
+ kind === 'shared-package' &&
29
+ entryPoint.match(fesmFolderRegExp)) {
30
+ fs.copyFileSync(entryPoint, outfile);
31
+ }
32
+ else {
33
+ yield runEsbuild(builderOptions, context, entryPoint, external, outfile, tsConfigPath, mappedPaths, watch, rebuildRequested, dev, kind);
34
+ }
35
+ if (kind === 'shared-package' && fs.existsSync(outfile)) {
36
+ yield link(outfile, dev);
37
+ }
38
+ });
39
+ function link(outfile, dev) {
40
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
41
+ const code = fs.readFileSync(outfile, 'utf-8');
42
+ try {
43
+ const linkerEsm = yield loadEsmModule('@angular/compiler-cli/linker/babel');
44
+ const linker = linkerEsm.default;
45
+ const result = yield (0, core_1.transformAsync)(code, {
46
+ filename: outfile,
47
+ // inputSourceMap: (useInputSourcemap ? undefined : false) as undefined,
48
+ // sourceMaps: pluginOptions.sourcemap ? 'inline' : false,
49
+ compact: !dev,
50
+ configFile: false,
51
+ babelrc: false,
52
+ minified: !dev,
53
+ browserslistConfigFile: false,
54
+ plugins: [linker],
55
+ });
56
+ fs.writeFileSync(outfile, result.code, 'utf-8');
57
+ }
58
+ catch (e) {
59
+ build_1.logger.error('error linking');
60
+ if (fs.existsSync(`${outfile}.error`)) {
61
+ fs.unlinkSync(`${outfile}.error`);
62
+ }
63
+ fs.renameSync(outfile, `${outfile}.error`);
64
+ throw e;
65
+ }
66
+ });
67
+ }
68
+ }
69
+ exports.createAngularBuildAdapter = createAngularBuildAdapter;
70
+ function runEsbuild(builderOptions, context, entryPoint, external, outfile, tsConfigPath, mappedPaths, watch, rebuildRequested = new rebuild_events_1.RebuildHubs(), dev, kind, plugins = null, absWorkingDir = undefined, logLevel = 'warning') {
71
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
72
+ const projectRoot = path.dirname(tsConfigPath);
73
+ const browsers = (0, supported_browsers_1.getSupportedBrowsers)(projectRoot, context.logger);
74
+ const target = (0, transform_1.transformSupportedBrowsersToTargets)(browsers);
75
+ const config = {
76
+ entryPoints: [entryPoint],
77
+ absWorkingDir,
78
+ external,
79
+ outfile,
80
+ logLevel,
81
+ bundle: true,
82
+ sourcemap: dev,
83
+ minify: !dev,
84
+ platform: 'browser',
85
+ format: 'esm',
86
+ target: ['esnext'],
87
+ plugins: plugins || [
88
+ (0, compiler_plugin_1.createCompilerPlugin)(
89
+ // TODO: Once available, use helper functions
90
+ // for creating these config objects:
91
+ // packages/angular_devkit/build_angular/src/tools/esbuild/compiler-plugin-options.ts
92
+ {
93
+ jit: false,
94
+ sourcemap: dev,
95
+ tsconfig: tsConfigPath,
96
+ advancedOptimizations: !dev,
97
+ thirdPartySourcemaps: false,
98
+ }, {
99
+ optimization: !dev,
100
+ sourcemap: dev ? 'inline' : false,
101
+ workspaceRoot: __dirname,
102
+ inlineStyleLanguage: builderOptions.inlineStyleLanguage,
103
+ browsers: browsers,
104
+ target: target,
105
+ }),
106
+ ...(mappedPaths && mappedPaths.length > 0
107
+ ? [(0, shared_mappings_plugin_1.createSharedMappingsPlugin)(mappedPaths)]
108
+ : []),
109
+ ],
110
+ define: {
111
+ ngDevMode: dev ? 'true' : 'false',
112
+ ngJitMode: 'false',
113
+ },
114
+ };
115
+ if (watch) {
116
+ const ctx = yield esbuild.context(config);
117
+ yield ctx.rebuild();
118
+ registerForRebuilds(kind, rebuildRequested, ctx);
119
+ }
120
+ else {
121
+ yield esbuild.build(config);
122
+ }
123
+ });
124
+ }
125
+ function registerForRebuilds(kind, rebuildRequested, ctx) {
126
+ if (kind === 'exposed') {
127
+ rebuildRequested.rebuildExposed.register(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
128
+ yield ctx.rebuild();
129
+ }));
130
+ }
131
+ else if (kind === 'shared-mapping') {
132
+ rebuildRequested.rebuildMappings.register(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
133
+ yield ctx.rebuild();
134
+ }));
135
+ }
136
+ }
137
+ function loadEsmModule(modulePath) {
138
+ return new Function('modulePath', `return import(modulePath);`)(modulePath);
139
+ }
140
+ exports.loadEsmModule = loadEsmModule;
91
141
  //# sourceMappingURL=angular-esbuild-adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"angular-esbuild-adapter.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/angular-esbuild-adapter.ts"],"names":[],"mappings":";;;;AAAA,4DAI0C;AAC1C,mCAAmC;AACnC,g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,CAAC,EAAE,CAAC;aACR;SACF,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAgB,aAAa,CAAI,UAAwB;IACvD,OAAO,IAAI,QAAQ,CAAC,YAAY,EAAE,4BAA4B,CAAC,CAC7D,UAAU,CACG,CAAC;AAClB,CAAC;AAJD,sCAIC"}
1
+ {"version":3,"file":"angular-esbuild-adapter.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/angular-esbuild-adapter.ts"],"names":[],"mappings":";;;;AAAA,4DAI0C;AAC1C,yDAAmC;AACnC,6GAA+G;AAI/G,2CAAkE;AAElE,iDAAiD;AACjD,WAAW;AACX,wCAAwC;AACxC,kEAAkE;AAElE,mGAAkG;AAIlG,qEAAsE;AACtE,+CAAyB;AACzB,mDAA6B;AAE7B,sCAAyD;AACzD,qDAA8D;AAG9D,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C,SAAgB,yBAAyB,CACvC,cAAqC,EACrC,OAAuB,EACvB,mBAAkC,IAAI,4BAAW,EAAE;IAEnD,OAAO,CAAO,OAAO,EAAE,EAAE;QACvB,MAAM,EACJ,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,WAAW,EACX,IAAI,EACJ,KAAK,EACL,GAAG,GACJ,GAAG,OAAO,CAAC;QAEZ,oDAAoD;QACpD,mCAAmC;QACnC,oDAAoD;QACpD,WAAW;QACX,IACE,GAAG;YACH,IAAI,KAAK,gBAAgB;YACzB,UAAU,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAClC;YACA,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;SACtC;aAAM;YACL,MAAM,UAAU,CACd,cAAc,EACd,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,WAAW,EACX,KAAK,EACL,gBAAgB,EAChB,GAAG,EACH,IAAI,CACL,CAAC;SACH;QACD,IAAI,IAAI,KAAK,gBAAgB,IAAI,EAAE,CAAC,UAAU,C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CAAC;oBAC3C,CAAC,CAAC,EAAE,CAAC;aACR;YACD,MAAM,EAAE;gBACN,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;gBACjC,SAAS,EAAE,OAAO;aACnB;SACF,CAAC;QAEF,IAAI,KAAK,EAAE;YACT,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC1C,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;YACpB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC;SAClD;aAAM;YACL,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC7B;IACH,CAAC;CAAA;AAED,SAAS,mBAAmB,CAC1B,IAAY,EACZ,gBAA+B,EAC/B,GAA+C;IAE/C,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAS,EAAE;YAClD,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC,CAAA,CAAC,CAAC;KACJ;SAAM,IAAI,IAAI,KAAK,gBAAgB,EAAE;QACpC,gBAAgB,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAS,EAAE;YACnD,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC,CAAA,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAgB,aAAa,CAAI,UAAwB;IACvD,OAAO,IAAI,QAAQ,CAAC,YAAY,EAAE,4BAA4B,CAAC,CAC7D,UAAU,CACG,CAAC;AAClB,CAAC;AAJD,sCAIC"}
@@ -0,0 +1,4 @@
1
+ import { NfBuilderSchema } from '../builders/build/schema';
2
+ export declare function startServer(options: NfBuilderSchema, path: string): void;
3
+ export declare function reloadBrowser(): void;
4
+ export declare function reloadShell(shellProjectName: string): void;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reloadShell = exports.reloadBrowser = exports.startServer = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const browserSync = tslib_1.__importStar(require("browser-sync"));
6
+ let server;
7
+ function startServer(options, path) {
8
+ const projectName = options.target.split(':')[0];
9
+ server = browserSync.create(projectName);
10
+ server.init({
11
+ port: options.port || 4200,
12
+ cors: true,
13
+ server: path,
14
+ notify: false,
15
+ single: true,
16
+ ui: false,
17
+ open: options.open,
18
+ });
19
+ }
20
+ exports.startServer = startServer;
21
+ function reloadBrowser() {
22
+ if (!server) {
23
+ throw new Error('server is not started');
24
+ }
25
+ server.reload();
26
+ }
27
+ exports.reloadBrowser = reloadBrowser;
28
+ function reloadShell(shellProjectName) {
29
+ if (!server) {
30
+ throw new Error('server is not started');
31
+ }
32
+ if (!shellProjectName) {
33
+ return;
34
+ }
35
+ if (browserSync.has(shellProjectName)) {
36
+ const shellServer = browserSync.get(shellProjectName);
37
+ shellServer.reload();
38
+ }
39
+ }
40
+ exports.reloadShell = reloadShell;
41
+ //# sourceMappingURL=dev-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-server.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/dev-server.ts"],"names":[],"mappings":";;;;AAAA,kEAA4C;AAG5C,IAAI,MAAuC,CAAC;AAE5C,SAAgB,WAAW,CAAC,OAAwB,EAAE,IAAY;IAChE,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjD,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAEzC,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI;QAC1B,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,IAAI;QACZ,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AAdD,kCAcC;AAED,SAAgB,aAAa;IAC3B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAC1C;IACD,MAAM,CAAC,MAAM,EAAE,CAAC;AAClB,CAAC;AALD,sCAKC;AAED,SAAgB,WAAW,CAAC,gBAAwB;IAClD,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAC1C;IACD,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO;KACR;IACD,IAAI,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;QACrC,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACtD,WAAW,CAAC,MAAM,EAAE,CAAC;KACtB;AACH,CAAC;AAXD,kCAWC"}
@@ -0,0 +1,9 @@
1
+ export type EventHandler = () => Promise<void>;
2
+ export interface EventSource {
3
+ register(handler: EventHandler): void;
4
+ }
5
+ export declare class EventHub implements EventSource {
6
+ private handlers;
7
+ register(handler: EventHandler): void;
8
+ emit(): Promise<void>;
9
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventHub = void 0;
4
+ const tslib_1 = require("tslib");
5
+ class EventHub {
6
+ constructor() {
7
+ this.handlers = [];
8
+ }
9
+ register(handler) {
10
+ this.handlers.push(handler);
11
+ }
12
+ emit() {
13
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
+ const promises = this.handlers.map((h) => h());
15
+ yield Promise.all(promises);
16
+ });
17
+ }
18
+ }
19
+ exports.EventHub = EventHub;
20
+ //# sourceMappingURL=event-sorce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-sorce.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/event-sorce.ts"],"names":[],"mappings":";;;;AAMA,MAAa,QAAQ;IAArB;QACU,aAAQ,GAAmB,EAAE,CAAC;IAUxC,CAAC;IARC,QAAQ,CAAC,OAAqB;QAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAEK,IAAI;;YACR,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC/C,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;KAAA;CACF;AAXD,4BAWC"}
@@ -0,0 +1,9 @@
1
+ import { EventHub, EventSource } from './event-sorce';
2
+ export interface RebuildEvents {
3
+ readonly rebuildMappings: EventSource;
4
+ readonly rebuildExposed: EventSource;
5
+ }
6
+ export declare class RebuildHubs implements RebuildEvents {
7
+ readonly rebuildMappings: EventHub;
8
+ readonly rebuildExposed: EventHub;
9
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RebuildHubs = void 0;
4
+ const event_sorce_1 = require("./event-sorce");
5
+ class RebuildHubs {
6
+ constructor() {
7
+ this.rebuildMappings = new event_sorce_1.EventHub();
8
+ this.rebuildExposed = new event_sorce_1.EventHub();
9
+ }
10
+ }
11
+ exports.RebuildHubs = RebuildHubs;
12
+ //# sourceMappingURL=rebuild-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebuild-events.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/rebuild-events.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAOtD,MAAa,WAAW;IAAxB;QACW,oBAAe,GAAG,IAAI,sBAAQ,EAAE,CAAC;QACjC,mBAAc,GAAG,IAAI,sBAAQ,EAAE,CAAC;IAC3C,CAAC;CAAA;AAHD,kCAGC"}
@@ -1 +1 @@
1
- export declare function runRollup(entryPoint: string, external: string[], outfile: string): Promise<void>;
1
+ export declare function runRollup(entryPoint: string, external: string[], outfile: string): Promise<void>;
@@ -1,58 +1,58 @@
1
- "use strict";
2
- //
3
- // We stick with rollup for bundling shared npm packages, as esbuild
4
- // does currently not allow to convert commonjs to esm
5
- //
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.runRollup = void 0;
8
- const tslib_1 = require("tslib");
9
- const rollup_1 = require("rollup");
10
- const plugin_node_resolve_1 = require("@rollup/plugin-node-resolve");
11
- const rollup_plugin_node_externals_1 = require("rollup-plugin-node-externals");
12
- const build_1 = require("@softarc/native-federation/build");
13
- const rollup_plugin_terser_1 = require("rollup-plugin-terser");
14
- // eslint-disable-next-line @typescript-eslint/no-var-requires
15
- const commonjs = require('@rollup/plugin-commonjs');
16
- // eslint-disable-next-line @typescript-eslint/no-var-requires
17
- const replace = require('@rollup/plugin-replace');
18
- // eslint-disable-next-line @typescript-eslint/no-var-requires
19
- const json = require('@rollup/plugin-json');
20
- // eslint-disable-next-line @typescript-eslint/no-var-requires
21
- function runRollup(entryPoint, external, outfile) {
22
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
- try {
24
- const result = yield (0, rollup_1.rollup)({
25
- input: entryPoint,
26
- onwarn: (warning) => {
27
- build_1.logger.verbose(warning);
28
- },
29
- plugins: [
30
- json(),
31
- commonjs(),
32
- (0, rollup_plugin_node_externals_1.externals)({ include: external }),
33
- (0, plugin_node_resolve_1.default)(),
34
- replace({
35
- preventAssignment: true,
36
- values: {
37
- 'process.env.NODE_ENV': '"development"',
38
- },
39
- }),
40
- (0, rollup_plugin_terser_1.terser)({ mangle: false, format: { comments: false } }),
41
- ],
42
- });
43
- yield result.write({
44
- format: 'esm',
45
- compact: true,
46
- file: outfile,
47
- sourcemap: true,
48
- exports: 'named',
49
- });
50
- }
51
- catch (e) {
52
- build_1.logger.error('Rollup error');
53
- throw e;
54
- }
55
- });
56
- }
57
- exports.runRollup = runRollup;
1
+ "use strict";
2
+ //
3
+ // We stick with rollup for bundling shared npm packages, as esbuild
4
+ // does currently not allow to convert commonjs to esm
5
+ //
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.runRollup = void 0;
8
+ const tslib_1 = require("tslib");
9
+ const rollup_1 = require("rollup");
10
+ const plugin_node_resolve_1 = tslib_1.__importDefault(require("@rollup/plugin-node-resolve"));
11
+ const rollup_plugin_node_externals_1 = require("rollup-plugin-node-externals");
12
+ const build_1 = require("@softarc/native-federation/build");
13
+ const rollup_plugin_terser_1 = require("rollup-plugin-terser");
14
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
15
+ const commonjs = require('@rollup/plugin-commonjs');
16
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
17
+ const replace = require('@rollup/plugin-replace');
18
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
19
+ const json = require('@rollup/plugin-json');
20
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
21
+ function runRollup(entryPoint, external, outfile) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ try {
24
+ const result = yield (0, rollup_1.rollup)({
25
+ input: entryPoint,
26
+ onwarn: (warning) => {
27
+ build_1.logger.verbose(warning);
28
+ },
29
+ plugins: [
30
+ json(),
31
+ commonjs(),
32
+ (0, rollup_plugin_node_externals_1.externals)({ include: external }),
33
+ (0, plugin_node_resolve_1.default)(),
34
+ replace({
35
+ preventAssignment: true,
36
+ values: {
37
+ 'process.env.NODE_ENV': '"development"',
38
+ },
39
+ }),
40
+ (0, rollup_plugin_terser_1.terser)({ mangle: false, format: { comments: false } }),
41
+ ],
42
+ });
43
+ yield result.write({
44
+ format: 'esm',
45
+ compact: true,
46
+ file: outfile,
47
+ sourcemap: true,
48
+ exports: 'named',
49
+ });
50
+ }
51
+ catch (e) {
52
+ build_1.logger.error('Rollup error');
53
+ throw e;
54
+ }
55
+ });
56
+ }
57
+ exports.runRollup = runRollup;
58
58
  //# sourceMappingURL=rollup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.js","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AAC,CAAC;SACJ;QAAC,OAAO,CAAC,EAAE;YACV,cAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAC7B,MAAM,CAAC,CAAC;SACT;IACH,CAAC;CAAA;AArCD,8BAqCC"}
1
+ {"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/rollup.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,oEAAoE;AACpE,sDAAsD;AACtD,EAAE;;;;AAEF,mCAAgC;AAChC,8FAAkD;AAClD,+EAAyD;AACzD,4DAA0D;AAC1D,+DAA8C;AAE9C,8DAA8D;AAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAEpD,8DAA8D;AAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAElD,8DAA8D;AAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAE5C,8DAA8D;AAE9D,SAAsB,SAAS,CAC7B,UAAkB,EAClB,QAAkB,EAClB,OAAe;;QAEf,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAA,eAAM,EAAC;gBAC1B,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;oBAClB,cAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC1B,CAAC;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE;oBACN,QAAQ,EAAE;oBACV,IAAA,wCAAS,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;oBAChC,IAAA,6BAAO,GAAE;oBACT,OAAO,CAAC;wBACN,iBAAiB,EAAE,IAAI;wBACvB,MAAM,EAAE;4BACN,sBAAsB,EAAE,eAAe;yBACxC;qBACF,CAAC;oBACF,IAAA,6BAAM,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC;iBACvD;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,CAAC,KAAK,CAAC;gBACjB,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,OAAO;gBACb,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;SACJ;QAAC,OAAO,CAAC,EAAE;YACV,cAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAC7B,MAAM,CAAC,CAAC;SACT;IACH,CAAC;CAAA;AArCD,8BAqCC"}
@@ -0,0 +1,60 @@
1
+ //
2
+ // We stick with rollup for bundling shared npm packages, as esbuild
3
+ // does currently not allow to convert commonjs to esm
4
+ //
5
+
6
+ import { rollup } from 'rollup';
7
+ import resolve from '@rollup/plugin-node-resolve';
8
+ import { externals } from 'rollup-plugin-node-externals';
9
+ import { logger } from '@softarc/native-federation/build';
10
+ import { terser } from 'rollup-plugin-terser';
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
13
+ const commonjs = require('@rollup/plugin-commonjs');
14
+
15
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ const replace = require('@rollup/plugin-replace');
17
+
18
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
19
+ const json = require('@rollup/plugin-json');
20
+
21
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
22
+
23
+ export async function runRollup(
24
+ entryPoint: string,
25
+ external: string[],
26
+ outfile: string
27
+ ) {
28
+ try {
29
+ const result = await rollup({
30
+ input: entryPoint,
31
+ onwarn: (warning) => {
32
+ logger.verbose(warning);
33
+ },
34
+ plugins: [
35
+ json(),
36
+ commonjs(),
37
+ externals({ include: external }),
38
+ resolve(),
39
+ replace({
40
+ preventAssignment: true,
41
+ values: {
42
+ 'process.env.NODE_ENV': '"development"',
43
+ },
44
+ }),
45
+ terser({ mangle: false, format: { comments: false } }),
46
+ ],
47
+ });
48
+
49
+ await result.write({
50
+ format: 'esm',
51
+ compact: true,
52
+ file: outfile,
53
+ sourcemap: true,
54
+ exports: 'named',
55
+ });
56
+ } catch (e) {
57
+ logger.error('Rollup error');
58
+ throw e;
59
+ }
60
+ }
@@ -1,3 +1,3 @@
1
- import { Plugin } from 'esbuild';
2
- import { MappedPath } from '@softarc/native-federation/build';
3
- export declare function createSharedMappingsPlugin(mappedPaths: MappedPath[]): Plugin;
1
+ import { Plugin } from 'esbuild';
2
+ import { MappedPath } from '@softarc/native-federation/build';
3
+ export declare function createSharedMappingsPlugin(mappedPaths: MappedPath[]): Plugin;
@@ -1,29 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSharedMappingsPlugin = void 0;
4
- const tslib_1 = require("tslib");
5
- const path = require("path");
6
- function createSharedMappingsPlugin(mappedPaths) {
7
- return {
8
- name: 'custom',
9
- setup(build) {
10
- build.onResolve({ filter: /^[.]/ }, (args) => tslib_1.__awaiter(this, void 0, void 0, function* () {
11
- let mappedPath = null;
12
- if (args.path.includes('playground-lib') &&
13
- args.kind === 'import-statement') {
14
- const importPath = path.join(args.resolveDir, args.path);
15
- mappedPath = mappedPaths.find((p) => importPath.startsWith(path.dirname(p.path)));
16
- }
17
- if (mappedPath) {
18
- return {
19
- path: mappedPath.key,
20
- external: true,
21
- };
22
- }
23
- return {};
24
- }));
25
- },
26
- };
27
- }
28
- exports.createSharedMappingsPlugin = createSharedMappingsPlugin;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSharedMappingsPlugin = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path = tslib_1.__importStar(require("path"));
6
+ function createSharedMappingsPlugin(mappedPaths) {
7
+ return {
8
+ name: 'custom',
9
+ setup(build) {
10
+ build.onResolve({ filter: /^[.]/ }, (args) => tslib_1.__awaiter(this, void 0, void 0, function* () {
11
+ let mappedPath = null;
12
+ if (args.path.includes('playground-lib') &&
13
+ args.kind === 'import-statement') {
14
+ const importPath = path.join(args.resolveDir, args.path);
15
+ mappedPath = mappedPaths.find((p) => importPath.startsWith(path.dirname(p.path)));
16
+ }
17
+ if (mappedPath) {
18
+ return {
19
+ path: mappedPath.key,
20
+ external: true,
21
+ };
22
+ }
23
+ return {};
24
+ }));
25
+ },
26
+ };
27
+ }
28
+ exports.createSharedMappingsPlugin = createSharedMappingsPlugin;
29
29
  //# sourceMappingURL=shared-mappings-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-mappings-plugin.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/shared-mappings-plugin.ts"],"names":[],"mappings":";;;;AACA,6BAA6B;AAG7B,SAAgB,0BAA0B,CAAC,WAAyB;IAClE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,CAAC,KAAkB;YACtB,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAO,IAAI,EAAE,EAAE;gBACjD,IAAI,UAAU,GAAsB,IAAI,CAAC;gBACzC,IACE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;oBACpC,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAChC;oBACA,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;oBACzD,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAClC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAC5C,CAAC;iBACH;gBAED,IAAI,UAAU,EAAE;oBACd,OAAO;wBACL,IAAI,EAAE,UAAU,CAAC,GAAG;wBACpB,QAAQ,EAAE,IAAI;qBACf,CAAC;iBACH;gBAED,OAAO,EAAE,CAAC;YACZ,CAAC,CAAA,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AA3BD,gEA2BC"}
1
+ {"version":3,"file":"shared-mappings-plugin.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/shared-mappings-plugin.ts"],"names":[],"mappings":";;;;AACA,mDAA6B;AAG7B,SAAgB,0BAA0B,CAAC,WAAyB;IAClE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,CAAC,KAAkB;YACtB,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAO,IAAI,EAAE,EAAE;gBACjD,IAAI,UAAU,GAAsB,IAAI,CAAC;gBACzC,IACE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;oBACpC,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAChC;oBACA,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;oBACzD,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAClC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAC5C,CAAC;iBACH;gBAED,IAAI,UAAU,EAAE;oBACd,OAAO;wBACL,IAAI,EAAE,UAAU,CAAC,GAAG;wBACpB,QAAQ,EAAE,IAAI;qBACf,CAAC;iBACH;gBAED,OAAO,EAAE,CAAC;YACZ,CAAC,CAAA,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AA3BD,gEA2BC"}