@softarc/native-federation-esbuild 3.5.5 → 4.0.0-RC10

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 (52) hide show
  1. package/package.json +29 -10
  2. package/src/domain.d.ts +4 -0
  3. package/src/domain.d.ts.map +1 -0
  4. package/src/domain.js +3 -0
  5. package/src/index.d.ts +5 -1
  6. package/src/index.d.ts.map +1 -0
  7. package/src/index.js +4 -5
  8. package/src/lib/core/builder.d.ts +10 -0
  9. package/src/lib/core/builder.d.ts.map +1 -0
  10. package/src/lib/core/builder.js +102 -0
  11. package/src/lib/core/esbuild-adapter.d.ts +4 -0
  12. package/src/lib/core/esbuild-adapter.d.ts.map +1 -0
  13. package/src/lib/core/esbuild-adapter.js +89 -0
  14. package/src/lib/core/normalize-options.d.ts +3 -0
  15. package/src/lib/core/normalize-options.d.ts.map +1 -0
  16. package/src/lib/core/normalize-options.js +29 -0
  17. package/src/lib/domain/adapter-config.contract.d.ts +13 -0
  18. package/src/lib/domain/adapter-config.contract.d.ts.map +1 -0
  19. package/src/lib/domain/adapter-config.contract.js +1 -0
  20. package/src/lib/domain/adapter-context.contract.d.ts +7 -0
  21. package/src/lib/domain/adapter-context.contract.d.ts.map +1 -0
  22. package/src/lib/domain/adapter-context.contract.js +1 -0
  23. package/src/lib/domain/builder-config.contract.d.ts +32 -0
  24. package/src/lib/domain/builder-config.contract.d.ts.map +1 -0
  25. package/src/lib/domain/builder-config.contract.js +1 -0
  26. package/src/lib/{collect-exports.d.ts → utils/collect-exports.d.ts} +1 -0
  27. package/src/lib/utils/collect-exports.d.ts.map +1 -0
  28. package/src/lib/{collect-exports.js → utils/collect-exports.js} +4 -9
  29. package/src/lib/utils/index.d.ts +6 -0
  30. package/src/lib/utils/index.d.ts.map +1 -0
  31. package/src/lib/utils/index.js +5 -0
  32. package/src/lib/utils/node-modules-bundler.d.ts +5 -0
  33. package/src/lib/utils/node-modules-bundler.d.ts.map +1 -0
  34. package/src/lib/utils/node-modules-bundler.js +56 -0
  35. package/src/lib/utils/react-replacements.d.ts +3 -0
  36. package/src/lib/utils/react-replacements.d.ts.map +1 -0
  37. package/src/lib/{react-replacements.js → utils/react-replacements.js} +1 -5
  38. package/src/lib/utils/source-code-bundler.d.ts +5 -0
  39. package/src/lib/utils/source-code-bundler.d.ts.map +1 -0
  40. package/src/lib/utils/source-code-bundler.js +26 -0
  41. package/src/lib/utils/write-result.d.ts +3 -0
  42. package/src/lib/utils/write-result.d.ts.map +1 -0
  43. package/src/lib/utils/write-result.js +13 -0
  44. package/LICENSE +0 -8
  45. package/README.md +0 -3
  46. package/src/index.js.map +0 -1
  47. package/src/lib/adapter.d.ts +0 -16
  48. package/src/lib/adapter.js +0 -148
  49. package/src/lib/adapter.js.map +0 -1
  50. package/src/lib/collect-exports.js.map +0 -1
  51. package/src/lib/react-replacements.d.ts +0 -2
  52. package/src/lib/react-replacements.js.map +0 -1
package/package.json CHANGED
@@ -1,17 +1,36 @@
1
1
  {
2
2
  "name": "@softarc/native-federation-esbuild",
3
- "version": "3.5.5",
4
- "type": "commonjs",
3
+ "version": "4.0.0-RC10",
4
+ "type": "module",
5
+ "license": "MIT",
5
6
  "dependencies": {
6
- "@rollup/plugin-commonjs": "^28.0.3",
7
- "@rollup/plugin-node-resolve": "^16.0.1",
8
- "@rollup/plugin-replace": "^6.0.2",
9
- "rollup": "^4.52.0",
10
- "rollup-plugin-node-externals": "^8.1.1",
11
- "esbuild": "^0.27.1",
12
- "signale": "^1.4.0",
13
- "acorn": "^8.8.1"
7
+ "@chialab/esbuild-plugin-commonjs": "^0.19.1",
8
+ "acorn": "^8.16.0",
9
+ "@softarc/native-federation": "~4.0.0"
14
10
  },
11
+ "homepage": "https://github.com/native-federation/esbuild-adapter",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/native-federation/esbuild-adapter"
15
+ },
16
+ "exports": {
17
+ "./package.json": "./package.json",
18
+ ".": {
19
+ "types": "./src/index.d.ts",
20
+ "import": "./src/index.js",
21
+ "default": "./src/index.js"
22
+ },
23
+ "./config": {
24
+ "types": "./src/config.d.ts",
25
+ "import": "./src/config.js",
26
+ "default": "./src/config.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "src",
31
+ "!**/*.tsbuildinfo"
32
+ ],
15
33
  "types": "./src/index.d.ts",
34
+ "module": "./src/index.js",
16
35
  "main": "./src/index.js"
17
36
  }
@@ -0,0 +1,4 @@
1
+ export * from './lib/domain/adapter-config.contract.js';
2
+ export * from './lib/domain/adapter-context.contract.js';
3
+ export * from './lib/domain/builder-config.contract.js';
4
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/domain.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC"}
package/src/domain.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './lib/domain/adapter-config.contract.js';
2
+ export * from './lib/domain/adapter-context.contract.js';
3
+ export * from './lib/domain/builder-config.contract.js';
package/src/index.d.ts CHANGED
@@ -1 +1,5 @@
1
- export * from './lib/adapter';
1
+ export * from './lib/core/esbuild-adapter.js';
2
+ export * from './lib/core/builder.js';
3
+ export * from './lib/core/normalize-options.js';
4
+ export * from './domain.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC"}
package/src/index.js CHANGED
@@ -1,5 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./lib/adapter"), exports);
5
- //# sourceMappingURL=index.js.map
1
+ export * from './lib/core/esbuild-adapter.js';
2
+ export * from './lib/core/builder.js';
3
+ export * from './lib/core/normalize-options.js';
4
+ export * from './domain.js';
@@ -0,0 +1,10 @@
1
+ import { type FederationInfo } from '@softarc/native-federation';
2
+ import type { EsBuildBuilderOptions, NormalizedEsBuildBuilderOptions } from '../domain/builder-config.contract.js';
3
+ export interface EsBuildBuilder {
4
+ federationInfo: FederationInfo;
5
+ externals: string[];
6
+ options: NormalizedEsBuildBuilderOptions;
7
+ close(): Promise<void>;
8
+ }
9
+ export declare function runEsBuildBuilder(federationConfigPath: string, rawOptions: EsBuildBuilderOptions): Promise<EsBuildBuilder>;
10
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAKpB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EACV,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,sCAAsC,CAAC;AAK9C,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,+BAA+B,CAAC;IACzC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,wBAAsB,iBAAiB,CACrC,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,cAAc,CAAC,CA4GzB"}
@@ -0,0 +1,102 @@
1
+ import { buildForFederation, createFederationCache, getExternals, normalizeFederationOptions, rebuildForFederation, setBuildAdapter, } from '@softarc/native-federation';
2
+ import { AbortedError, createNfWatcher, logger, RebuildQueue, setLogLevel, syncNfFileWatcher, } from '@softarc/native-federation/internal';
3
+ import { createEsBuildAdapter } from './esbuild-adapter.js';
4
+ import { normalizeBuilderOptions } from './normalize-options.js';
5
+ export async function runEsBuildBuilder(federationConfigPath, rawOptions) {
6
+ const options = normalizeBuilderOptions(rawOptions);
7
+ setLogLevel(options.verbose ? 'verbose' : 'info');
8
+ const adapter = createEsBuildAdapter(options.adapterConfig);
9
+ setBuildAdapter(adapter);
10
+ const bundlerCache = new Map();
11
+ const normalized = await normalizeFederationOptions({
12
+ projectName: options.projectName,
13
+ workspaceRoot: options.workspaceRoot,
14
+ outputPath: options.outputPath,
15
+ federationConfig: federationConfigPath,
16
+ tsConfig: options.tsConfig,
17
+ verbose: options.verbose,
18
+ watch: options.watch,
19
+ dev: options.dev,
20
+ entryPoints: options.entryPoints,
21
+ packageJson: options.packageJson,
22
+ cacheExternalArtifacts: options.cacheExternalArtifacts,
23
+ }, createFederationCache(options.cachePath, bundlerCache));
24
+ const externals = getExternals(normalized.config);
25
+ let federationInfo;
26
+ try {
27
+ federationInfo = await buildForFederation(normalized.config, normalized.options, externals);
28
+ }
29
+ catch (error) {
30
+ logger.error(error?.message ?? 'Building the federation artifacts failed');
31
+ await adapter.dispose();
32
+ throw error;
33
+ }
34
+ if (!options.watch) {
35
+ return {
36
+ federationInfo,
37
+ externals,
38
+ options,
39
+ close: () => adapter.dispose(),
40
+ };
41
+ }
42
+ const rebuildQueue = new RebuildQueue();
43
+ const pendingChanges = new Set();
44
+ let closed = false;
45
+ const watcher = createNfWatcher({
46
+ onChange: changedPath => {
47
+ if (closed)
48
+ return;
49
+ pendingChanges.add(changedPath);
50
+ void triggerRebuild();
51
+ },
52
+ });
53
+ syncNfFileWatcher(watcher, bundlerCache);
54
+ async function triggerRebuild() {
55
+ await rebuildQueue.track(async (signal) => {
56
+ try {
57
+ await abortableDelay(Math.max(10, options.rebuildDelay), signal);
58
+ if (signal.aborted) {
59
+ throw new AbortedError('[builder] Aborted before rebuild');
60
+ }
61
+ const files = [...pendingChanges];
62
+ pendingChanges.clear();
63
+ federationInfo = await rebuildForFederation(normalized.config, normalized.options, externals, files, signal);
64
+ syncNfFileWatcher(watcher, bundlerCache);
65
+ logger.info('Federation rebuild done.');
66
+ return { success: true };
67
+ }
68
+ catch (error) {
69
+ if (error instanceof AbortedError) {
70
+ logger.verbose('Rebuild was canceled: ' + error.message);
71
+ return { success: false, cancelled: true };
72
+ }
73
+ logger.error('Federation rebuild failed!');
74
+ if (options.verbose)
75
+ console.error(error);
76
+ return { success: false };
77
+ }
78
+ });
79
+ }
80
+ return {
81
+ get federationInfo() {
82
+ return federationInfo;
83
+ },
84
+ externals,
85
+ options,
86
+ async close() {
87
+ closed = true;
88
+ rebuildQueue.dispose();
89
+ await watcher.close();
90
+ await adapter.dispose();
91
+ },
92
+ };
93
+ }
94
+ function abortableDelay(ms, signal) {
95
+ return new Promise((resolve, reject) => {
96
+ const timeout = setTimeout(resolve, ms);
97
+ signal.addEventListener('abort', () => {
98
+ clearTimeout(timeout);
99
+ reject(new AbortedError('[builder] Debounce canceled'));
100
+ }, { once: true });
101
+ });
102
+ }
@@ -0,0 +1,4 @@
1
+ import type { NFBuildAdapter } from '@softarc/native-federation/domain';
2
+ import type { EsBuildAdapterConfig } from '../domain/adapter-config.contract.js';
3
+ export declare function createEsBuildAdapter(config: EsBuildAdapterConfig): NFBuildAdapter;
4
+ //# sourceMappingURL=esbuild-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild-adapter.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/esbuild-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAMjF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAiIjF"}
@@ -0,0 +1,89 @@
1
+ import { AbortedError } from '@softarc/native-federation/internal';
2
+ import * as esbuild from 'esbuild';
3
+ import { writeResult } from '../utils/write-result.js';
4
+ import { createSourceCodeEsbuildContext } from '../utils/source-code-bundler.js';
5
+ import { createNodeModulesEsbuildContext } from '../utils/node-modules-bundler.js';
6
+ export function createEsBuildAdapter(config) {
7
+ if (!config.compensateExports) {
8
+ config.compensateExports = [new RegExp('/react/')];
9
+ }
10
+ const bundleContextCache = new Map();
11
+ const dispose = async (name) => {
12
+ if (name) {
13
+ const entry = bundleContextCache.get(name);
14
+ if (!entry) {
15
+ throw new Error(`Could not dispose of non-existing build '${name}'`);
16
+ }
17
+ await entry.ctx.dispose();
18
+ bundleContextCache.delete(name);
19
+ return;
20
+ }
21
+ const disposals = [];
22
+ for (const [, entry] of bundleContextCache) {
23
+ disposals.push(entry.ctx.dispose());
24
+ }
25
+ bundleContextCache.clear();
26
+ await Promise.all(disposals);
27
+ await esbuild.stop();
28
+ };
29
+ const setup = async (name, options) => {
30
+ const { entryPoints, external, outdir, hash, dev = false, platform = 'browser', tsConfigPath, isMappingOrExposed, cache, } = options;
31
+ if (bundleContextCache.has(name)) {
32
+ return;
33
+ }
34
+ const esbuildPlatform = platform === 'node' ? 'node' : 'browser';
35
+ const ctx = isMappingOrExposed
36
+ ? await createSourceCodeEsbuildContext(entryPoints, external, outdir, config, dev, hash, esbuildPlatform, tsConfigPath)
37
+ : await createNodeModulesEsbuildContext(entryPoints, external, outdir, config, dev, hash, esbuildPlatform);
38
+ bundleContextCache.set(name, {
39
+ ctx,
40
+ outdir,
41
+ dev,
42
+ name,
43
+ isMappingOrExposed,
44
+ bundlerCache: cache?.bundlerCache,
45
+ });
46
+ };
47
+ const build = async (name, opts = {}) => {
48
+ const entry = bundleContextCache.get(name);
49
+ if (!entry) {
50
+ throw new Error(`No context found for build "${name}". Call setup() first.`);
51
+ }
52
+ if (opts.signal?.aborted) {
53
+ throw new AbortedError('[build] Aborted before rebuild');
54
+ }
55
+ if (opts.modifiedFiles && entry.bundlerCache) {
56
+ for (const file of opts.modifiedFiles)
57
+ entry.bundlerCache.delete(file);
58
+ }
59
+ const cancelBuild = () => {
60
+ try {
61
+ entry.ctx.cancel();
62
+ }
63
+ catch {
64
+ // noop — context may already be cancelled/disposed
65
+ }
66
+ };
67
+ opts.signal?.addEventListener('abort', cancelBuild, { once: true });
68
+ try {
69
+ const result = await entry.ctx.rebuild();
70
+ const writtenFiles = writeResult(result, entry.outdir);
71
+ if (entry.bundlerCache && result.metafile) {
72
+ for (const input of Object.keys(result.metafile.inputs)) {
73
+ entry.bundlerCache.set(input, null);
74
+ }
75
+ }
76
+ return writtenFiles.map(fileName => ({ fileName }));
77
+ }
78
+ catch (error) {
79
+ if (opts.signal?.aborted && error instanceof Error && error.message.includes('canceled')) {
80
+ throw new AbortedError('[build] ESBuild rebuild was canceled.');
81
+ }
82
+ throw error;
83
+ }
84
+ finally {
85
+ opts.signal?.removeEventListener('abort', cancelBuild);
86
+ }
87
+ };
88
+ return { setup, build, dispose };
89
+ }
@@ -0,0 +1,3 @@
1
+ import type { EsBuildBuilderOptions, NormalizedEsBuildBuilderOptions } from '../domain/builder-config.contract.js';
2
+ export declare function normalizeBuilderOptions(options: EsBuildBuilderOptions): NormalizedEsBuildBuilderOptions;
3
+ //# sourceMappingURL=normalize-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/normalize-options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,sCAAsC,CAAC;AAG9C,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,qBAAqB,GAC7B,+BAA+B,CA6BjC"}
@@ -0,0 +1,29 @@
1
+ import * as path from 'path';
2
+ import { getDefaultCachePath } from '@softarc/native-federation/internal';
3
+ export function normalizeBuilderOptions(options) {
4
+ if (!options.outputPath) {
5
+ throw new Error('[esbuild-builder] outputPath is required');
6
+ }
7
+ const workspaceRoot = options.workspaceRoot
8
+ ? path.resolve(process.cwd(), options.workspaceRoot)
9
+ : process.cwd();
10
+ const tsConfig = options.tsConfig ?? 'tsconfig.json';
11
+ const cachePath = options.cachePath
12
+ ? path.join(workspaceRoot, options.cachePath)
13
+ : getDefaultCachePath(workspaceRoot);
14
+ return {
15
+ workspaceRoot,
16
+ outputPath: options.outputPath,
17
+ tsConfig,
18
+ cachePath,
19
+ projectName: options.projectName,
20
+ entryPoints: options.entryPoints,
21
+ packageJson: options.packageJson,
22
+ dev: !!options.dev,
23
+ watch: !!options.watch,
24
+ verbose: !!options.verbose,
25
+ rebuildDelay: options.rebuildDelay ?? 50,
26
+ cacheExternalArtifacts: options.cacheExternalArtifacts !== false,
27
+ adapterConfig: options.adapterConfig ?? { plugins: [] },
28
+ };
29
+ }
@@ -0,0 +1,13 @@
1
+ import type * as esbuild from 'esbuild';
2
+ export type ReplacementConfig = {
3
+ file: string;
4
+ };
5
+ export interface EsBuildAdapterConfig {
6
+ plugins: esbuild.Plugin[];
7
+ fileReplacements?: Record<string, string | ReplacementConfig>;
8
+ compensateExports?: RegExp[];
9
+ loader?: {
10
+ [ext: string]: esbuild.Loader;
11
+ };
12
+ }
13
+ //# sourceMappingURL=adapter-config.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-config.contract.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/adapter-config.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAC9D,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;KAAE,CAAC;CAC5C"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { NFBuildAdapterContext } from '@softarc/native-federation';
2
+ import type * as esbuild from 'esbuild';
3
+ export type EsbuildBundlerCache = Map<string, unknown>;
4
+ export interface CachedContext extends NFBuildAdapterContext<esbuild.BuildContext> {
5
+ bundlerCache: EsbuildBundlerCache | undefined;
6
+ }
7
+ //# sourceMappingURL=adapter-context.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-context.contract.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/adapter-context.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvD,MAAM,WAAW,aAAc,SAAQ,qBAAqB,CAAC,OAAO,CAAC,YAAY,CAAC;IAChF,YAAY,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAC/C"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import type { EsBuildAdapterConfig } from './adapter-config.contract.js';
2
+ export interface EsBuildBuilderOptions {
3
+ workspaceRoot?: string;
4
+ outputPath: string;
5
+ tsConfig?: string;
6
+ cachePath?: string;
7
+ projectName?: string;
8
+ entryPoints?: string[];
9
+ packageJson?: string;
10
+ dev?: boolean;
11
+ watch?: boolean;
12
+ verbose?: boolean;
13
+ rebuildDelay?: number;
14
+ cacheExternalArtifacts?: boolean;
15
+ adapterConfig?: EsBuildAdapterConfig;
16
+ }
17
+ export interface NormalizedEsBuildBuilderOptions {
18
+ workspaceRoot: string;
19
+ outputPath: string;
20
+ cachePath: string;
21
+ tsConfig: string;
22
+ projectName?: string;
23
+ entryPoints?: string[];
24
+ packageJson?: string;
25
+ dev: boolean;
26
+ watch: boolean;
27
+ verbose: boolean;
28
+ rebuildDelay: number;
29
+ cacheExternalArtifacts: boolean;
30
+ adapterConfig: EsBuildAdapterConfig;
31
+ }
32
+ //# sourceMappingURL=builder-config.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder-config.contract.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/builder-config.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,oBAAoB,CAAC;CACrC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -4,3 +4,4 @@ export declare function collectExports(path: string): {
4
4
  defaultExportName: string;
5
5
  exports: string[];
6
6
  };
7
+ //# sourceMappingURL=collect-exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-exports.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/collect-exports.ts"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM;;;;;EAoD1C"}
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.collectExports = collectExports;
4
- const tslib_1 = require("tslib");
5
- const fs = tslib_1.__importStar(require("fs"));
6
- const acorn_1 = require("acorn");
7
- function collectExports(path) {
1
+ import * as fs from 'fs';
2
+ import { parse } from 'acorn';
3
+ export function collectExports(path) {
8
4
  const src = fs.readFileSync(path, 'utf8');
9
- const parseTree = (0, acorn_1.parse)(src, {
5
+ const parseTree = parse(src, {
10
6
  ecmaVersion: 'latest',
11
7
  allowHashBang: true,
12
8
  sourceType: 'module',
@@ -67,4 +63,3 @@ function isDefaultExport(exportSpecifier) {
67
63
  return (exportSpecifier.exported?.type === 'Identifier' &&
68
64
  exportSpecifier.exported?.name === 'default');
69
65
  }
70
- //# sourceMappingURL=collect-exports.js.map
@@ -0,0 +1,6 @@
1
+ export * from './write-result.js';
2
+ export * from './node-modules-bundler.js';
3
+ export * from './source-code-bundler.js';
4
+ export * from './collect-exports.js';
5
+ export * from './react-replacements.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './write-result.js';
2
+ export * from './node-modules-bundler.js';
3
+ export * from './source-code-bundler.js';
4
+ export * from './collect-exports.js';
5
+ export * from './react-replacements.js';
@@ -0,0 +1,5 @@
1
+ import * as esbuild from 'esbuild';
2
+ import type { EntryPoint } from '@softarc/native-federation/domain';
3
+ import type { EsBuildAdapterConfig } from '../domain/adapter-config.contract.js';
4
+ export declare function createNodeModulesEsbuildContext(entryPoints: EntryPoint[], external: string[], outdir: string, config: EsBuildAdapterConfig, dev: boolean, hash: boolean, platform: 'browser' | 'node'): Promise<esbuild.BuildContext>;
5
+ //# sourceMappingURL=node-modules-bundler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-modules-bundler.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/node-modules-bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAqB,MAAM,sCAAsC,CAAC;AAEpG,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,UAAU,EAAE,EACzB,QAAQ,EAAE,MAAM,EAAE,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,oBAAoB,EAC5B,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,SAAS,GAAG,MAAM,GAC3B,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAmC/B"}
@@ -0,0 +1,56 @@
1
+ import * as esbuild from 'esbuild';
2
+ import * as path from 'path';
3
+ export async function createNodeModulesEsbuildContext(entryPoints, external, outdir, config, dev, hash, platform) {
4
+ const env = dev ? 'development' : 'production';
5
+ // Apply file replacements to entry points
6
+ if (config.fileReplacements) {
7
+ const normalizedReplacements = normalize(config.fileReplacements);
8
+ for (const entryPoint of entryPoints) {
9
+ entryPoint.fileName = replaceEntryPoint(entryPoint.fileName, normalizedReplacements);
10
+ }
11
+ }
12
+ const commonjsPluginModule = await import('@chialab/esbuild-plugin-commonjs');
13
+ const commonjsPlugin = commonjsPluginModule.default;
14
+ return esbuild.context({
15
+ entryPoints: entryPoints.map((ep) => ({
16
+ in: ep.fileName,
17
+ out: path.parse(ep.outName).name,
18
+ })),
19
+ write: false,
20
+ outdir,
21
+ entryNames: hash ? '[name]-[hash]' : '[name]',
22
+ external,
23
+ bundle: true,
24
+ sourcemap: dev,
25
+ minify: !dev,
26
+ format: 'esm',
27
+ splitting: false, // Todo: support splitting
28
+ platform,
29
+ plugins: [commonjsPlugin()],
30
+ define: {
31
+ 'process.env.NODE_ENV': `"${env}"`,
32
+ },
33
+ resolveExtensions: ['.mjs', '.js', '.cjs'],
34
+ });
35
+ }
36
+ function normalize(config) {
37
+ const result = {};
38
+ for (const key in config) {
39
+ if (typeof config[key] === 'string') {
40
+ result[key] = {
41
+ file: config[key],
42
+ };
43
+ }
44
+ else {
45
+ result[key] = config[key];
46
+ }
47
+ }
48
+ return result;
49
+ }
50
+ function replaceEntryPoint(entryPoint, fileReplacements) {
51
+ entryPoint = entryPoint.replace(/\\/g, '/');
52
+ for (const key in fileReplacements) {
53
+ entryPoint = entryPoint.replace(new RegExp(`${key}$`), fileReplacements[key].file);
54
+ }
55
+ return entryPoint;
56
+ }
@@ -0,0 +1,3 @@
1
+ import { type ReplacementConfig } from '../domain/adapter-config.contract.js';
2
+ export declare const reactReplacements: Record<string, Record<string, ReplacementConfig>>;
3
+ //# sourceMappingURL=react-replacements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-replacements.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/react-replacements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CA6B/E,CAAC"}
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reactReplacements = void 0;
4
- exports.reactReplacements = {
1
+ export const reactReplacements = {
5
2
  dev: {
6
3
  'node_modules/react/index.js': {
7
4
  file: 'node_modules/react/cjs/react.development.js',
@@ -31,4 +28,3 @@ exports.reactReplacements = {
31
28
  },
32
29
  },
33
30
  };
34
- //# sourceMappingURL=react-replacements.js.map
@@ -0,0 +1,5 @@
1
+ import * as esbuild from 'esbuild';
2
+ import type { EntryPoint } from '@softarc/native-federation/domain';
3
+ import type { EsBuildAdapterConfig } from '../domain/adapter-config.contract.js';
4
+ export declare function createSourceCodeEsbuildContext(entryPoints: EntryPoint[], external: string[], outdir: string, config: EsBuildAdapterConfig, dev: boolean, hash: boolean, platform: 'browser' | 'node', tsConfigPath?: string): Promise<esbuild.BuildContext>;
5
+ //# sourceMappingURL=source-code-bundler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-code-bundler.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/source-code-bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,UAAU,EAAE,EACzB,QAAQ,EAAE,MAAM,EAAE,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,oBAAoB,EAC5B,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,SAAS,GAAG,MAAM,EAC5B,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAuB/B"}
@@ -0,0 +1,26 @@
1
+ import * as esbuild from 'esbuild';
2
+ import * as path from 'path';
3
+ export async function createSourceCodeEsbuildContext(entryPoints, external, outdir, config, dev, hash, platform, tsConfigPath) {
4
+ return esbuild.context({
5
+ entryPoints: entryPoints.map((ep) => ({
6
+ in: ep.fileName,
7
+ out: path.parse(ep.outName).name,
8
+ })),
9
+ write: false,
10
+ metafile: true,
11
+ outdir,
12
+ entryNames: hash ? '[name]-[hash]' : '[name]',
13
+ external,
14
+ loader: config.loader,
15
+ bundle: true,
16
+ sourcemap: dev,
17
+ minify: !dev,
18
+ format: 'esm',
19
+ splitting: false, // Todo: support splitting
20
+ target: ['esnext'],
21
+ platform,
22
+ tsconfig: tsConfigPath,
23
+ plugins: [...config.plugins],
24
+ resolveExtensions: ['.ts', '.tsx', '.mjs', '.js', '.cjs'],
25
+ });
26
+ }
@@ -0,0 +1,3 @@
1
+ import type * as esbuild from 'esbuild';
2
+ export declare function writeResult(result: esbuild.BuildResult<esbuild.BuildOptions>, outdir: string): string[];
3
+ //# sourceMappingURL=write-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-result.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/write-result.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAExC,wBAAgB,WAAW,CACzB,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,EACjD,MAAM,EAAE,MAAM,GACb,MAAM,EAAE,CAWV"}
@@ -0,0 +1,13 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ export function writeResult(result, outdir) {
4
+ const outputFiles = result.outputFiles || [];
5
+ const writtenFiles = [];
6
+ for (const outFile of outputFiles) {
7
+ const fileName = path.basename(outFile.path);
8
+ const filePath = path.join(outdir, fileName);
9
+ fs.writeFileSync(filePath, outFile.contents);
10
+ writtenFiles.push(filePath);
11
+ }
12
+ return writtenFiles;
13
+ }
package/LICENSE DELETED
@@ -1,8 +0,0 @@
1
- Copyright 2021 Softarc Consulting GmbH
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
-
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # native-federation-esbuild
2
-
3
- As Native Federation is tooling agnostic, we need an adapter to make it work with specific build tools. This library contains such an adapter for esbuild.
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/native-federation-esbuild/src/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B"}
@@ -1,16 +0,0 @@
1
- import { BuildAdapter, BuildAdapterOptions, BuildResult } from '@softarc/native-federation/build';
2
- import * as esbuild from 'esbuild';
3
- export declare const esBuildAdapter: BuildAdapter;
4
- export type ReplacementConfig = {
5
- file: string;
6
- };
7
- export interface EsBuildAdapterConfig {
8
- plugins: esbuild.Plugin[];
9
- fileReplacements?: Record<string, string | ReplacementConfig>;
10
- skipRollup?: boolean;
11
- compensateExports?: RegExp[];
12
- loader?: {
13
- [ext: string]: esbuild.Loader;
14
- };
15
- }
16
- export declare function createEsBuildAdapter(config: EsBuildAdapterConfig): (options: BuildAdapterOptions) => Promise<BuildResult[]>;
@@ -1,148 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.esBuildAdapter = void 0;
4
- exports.createEsBuildAdapter = createEsBuildAdapter;
5
- const tslib_1 = require("tslib");
6
- const esbuild = tslib_1.__importStar(require("esbuild"));
7
- const rollup_1 = require("rollup");
8
- const plugin_node_resolve_1 = tslib_1.__importDefault(require("@rollup/plugin-node-resolve"));
9
- const rollup_plugin_node_externals_1 = require("rollup-plugin-node-externals");
10
- const fs = tslib_1.__importStar(require("fs"));
11
- const path_1 = tslib_1.__importDefault(require("path"));
12
- // eslint-disable-next-line @typescript-eslint/no-var-requires
13
- const commonjs = require('@rollup/plugin-commonjs');
14
- // eslint-disable-next-line @typescript-eslint/no-var-requires
15
- const replace = require('@rollup/plugin-replace');
16
- exports.esBuildAdapter = createEsBuildAdapter({
17
- plugins: [],
18
- });
19
- function createEsBuildAdapter(config) {
20
- if (!config.compensateExports) {
21
- config.compensateExports = [new RegExp('/react/')];
22
- }
23
- return async (options) => {
24
- const { entryPoints, external, outdir, hash } = options;
25
- // TODO: Do we need to prepare packages anymore as esbuild has evolved?
26
- for (const entryPoint of entryPoints) {
27
- const isPkg = entryPoint.fileName.includes('node_modules');
28
- const pkgName = isPkg ? inferPkgName(entryPoint.fileName) : '';
29
- const tmpFolder = `node_modules/.tmp/${pkgName}`;
30
- if (isPkg) {
31
- await prepareNodePackage(entryPoint.fileName, external, tmpFolder, config, !!options.dev);
32
- entryPoint.fileName = tmpFolder;
33
- }
34
- }
35
- const ctx = await esbuild.context({
36
- entryPoints: entryPoints.map((ep) => ({
37
- in: ep.fileName,
38
- out: path_1.default.parse(ep.outName).name,
39
- })),
40
- write: false,
41
- outdir,
42
- entryNames: hash ? '[name]-[hash]' : '[name]',
43
- external,
44
- loader: config.loader,
45
- bundle: true,
46
- sourcemap: options.dev,
47
- minify: !options.dev,
48
- format: 'esm',
49
- target: ['esnext'],
50
- plugins: [...config.plugins],
51
- });
52
- const result = await ctx.rebuild();
53
- const writtenFiles = writeResult(result, outdir);
54
- ctx.dispose();
55
- return writtenFiles.map((fileName) => ({ fileName }));
56
- // const normEntryPoint = entryPoint.replace(/\\/g, '/');
57
- // if (
58
- // isPkg &&
59
- // config?.compensateExports?.find((regExp) => regExp.exec(normEntryPoint))
60
- // ) {
61
- // logger.verbose('compensate exports for ' + tmpFolder);
62
- // compensateExports(tmpFolder, outfile);
63
- // }
64
- };
65
- }
66
- function writeResult(result, outdir) {
67
- const outputFiles = result.outputFiles || [];
68
- const writtenFiles = [];
69
- for (const outFile of outputFiles) {
70
- const fileName = path_1.default.basename(outFile.path);
71
- const filePath = path_1.default.join(outdir, fileName);
72
- fs.writeFileSync(filePath, outFile.contents);
73
- writtenFiles.push(filePath);
74
- }
75
- return writtenFiles;
76
- }
77
- // TODO: Unused, to delete?
78
- // function compensateExports(entryPoint: string, outfile?: string): void {
79
- // const inExports = collectExports(entryPoint);
80
- // const outExports = outfile ? collectExports(outfile) : inExports;
81
- //
82
- // if (!outExports.hasDefaultExport || outExports.hasFurtherExports) {
83
- // return;
84
- // }
85
- // const defaultName = outExports.defaultExportName;
86
- //
87
- // let exports = '/*Try to compensate missing exports*/\n\n';
88
- // for (const exp of inExports.exports) {
89
- // exports += `let ${exp}$softarc = ${defaultName}.${exp};\n`;
90
- // exports += `export { ${exp}$softarc as ${exp} };\n`;
91
- // }
92
- //
93
- // const target = outfile ?? entryPoint;
94
- // fs.appendFileSync(target, exports, 'utf-8');
95
- // }
96
- async function prepareNodePackage(entryPoint, external, tmpFolder, config, dev) {
97
- if (config.fileReplacements) {
98
- entryPoint = replaceEntryPoint(entryPoint, normalize(config.fileReplacements));
99
- }
100
- const env = dev ? 'development' : 'production';
101
- const result = await (0, rollup_1.rollup)({
102
- input: entryPoint,
103
- plugins: [
104
- commonjs(),
105
- (0, rollup_plugin_node_externals_1.nodeExternals)({ include: external }),
106
- (0, plugin_node_resolve_1.default)(),
107
- replace({
108
- preventAssignment: true,
109
- values: {
110
- 'process.env.NODE_ENV': `"${env}"`,
111
- },
112
- }),
113
- ],
114
- });
115
- await result.write({
116
- format: 'esm',
117
- file: tmpFolder,
118
- sourcemap: dev,
119
- exports: 'named',
120
- });
121
- }
122
- function inferPkgName(entryPoint) {
123
- return entryPoint
124
- .replace(/.*?node_modules/g, '')
125
- .replace(/[^A-Za-z0-9.]/g, '_');
126
- }
127
- function normalize(config) {
128
- const result = {};
129
- for (const key in config) {
130
- if (typeof config[key] === 'string') {
131
- result[key] = {
132
- file: config[key],
133
- };
134
- }
135
- else {
136
- result[key] = config[key];
137
- }
138
- }
139
- return result;
140
- }
141
- function replaceEntryPoint(entryPoint, fileReplacements) {
142
- entryPoint = entryPoint.replace(/\\/g, '/');
143
- for (const key in fileReplacements) {
144
- entryPoint = entryPoint.replace(new RegExp(`${key}$`), fileReplacements[key].file);
145
- }
146
- return entryPoint;
147
- }
148
- //# sourceMappingURL=adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../../libs/native-federation-esbuild/src/lib/adapter.ts"],"names":[],"mappings":";;;AAkCA,oDA4DC;;AAzFD,yDAAmC;AACnC,mCAAgC;AAChC,8FAAkD;AAClD,+EAA6D;AAC7D,+CAAyB;AACzB,wDAAwB;AAExB,8DAA8D;AAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAEpD,8DAA8D;AAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAErC,QAAA,cAAc,GAAiB,oBAAoB,CAAC;IAC/D,OAAO,EAAE,EAAE;CACZ,CAAC,CAAC;AAcH,SAAgB,oBAAoB,CAAC,MAA4B;IAC/D,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC9B,MAAM,CAAC,iBAAiB,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,KAAK,EAAE,OAA4B,EAA0B,EAAE;QACpE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,IA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YACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAsB,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACxB,UAAkB,EAClB,gBAAmD;IAEnD,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE5C,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACnC,UAAU,GAAG,UAAU,CAAC,OAAO,CAC7B,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,EACrB,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,CAC3B,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"collect-exports.js","sourceRoot":"","sources":["../../../../../libs/native-federation-esbuild/src/lib/collect-exports.ts"],"names":[],"mappings":";;AAQA,wCAoDC;;AA5DD,+CAAyB;AACzB,iCAA8B;AAO9B,SAAgB,cAAc,CAAC,IAAY;IACzC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE1C,MAAM,SAAS,GAAG,IAAA,aAAK,EAAC,GAAG,EAAE;QAC3B,WAAW,EAAE,QAAQ;QACrB,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,QAAQ;KACrB,CAAC,CAAC;IAEH,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAC9B,IAAI,iBAAiB,GAAG,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3B,IACE,IAAI,CAAC,IAAI,KAAK,sBAAsB;YACpC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,SAAS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AAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,eAAqB;IAC5C,OAAO,CACL,eAAe,CAAC,QAAQ,EAAE,IAAI,KAAK,YAAY;QAC/C,eAAe,CAAC,QAAQ,EAAE,IAAI,KAAK,SAAS,CAC7C,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- import { ReplacementConfig } from './adapter';
2
- export declare const reactReplacements: Record<string, Record<string, ReplacementConfig>>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-replacements.js","sourceRoot":"","sources":["../../../../../libs/native-federation-esbuild/src/lib/react-replacements.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAG1B;IACF,GAAG,EAAE;QACH,6BAA6B,EAAE;YAC7B,IAAI,EAAE,6CAA6C;SACpD;QACD,uCAAuC,EAAE;YACvC,IAAI,EAAE,6DAA6D;SACpE;QACD,mCAAmC,EAAE;YACnC,IAAI,EAAE,yDAAyD;SAChE;QACD,iCAAiC,EAAE;YACjC,IAAI,EAAE,qDAAqD;SAC5D;KACF;IACD,IAAI,EAAE;QACJ,6BAA6B,EAAE;YAC7B,IAAI,EAAE,gDAAgD;SACvD;QACD,uCAAuC,EAAE;YACvC,IAAI,EAAE,gEAAgE;SACvE;QACD,mCAAmC,EAAE;YACnC,IAAI,EAAE,4DAA4D;SACnE;QACD,iCAAiC,EAAE;YACjC,IAAI,EAAE,wDAAwD;SAC/D;KACF;CACF,CAAC"}