@softarc/native-federation 3.5.1 → 4.0.0-RC1
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/package.json +33 -5
- package/src/config.d.ts +5 -1
- package/src/config.d.ts.map +1 -0
- package/src/config.js +4 -6
- package/src/domain.d.ts +3 -0
- package/src/domain.d.ts.map +1 -0
- package/src/domain.js +2 -0
- package/src/index.d.ts +9 -1
- package/src/index.d.ts.map +1 -0
- package/src/index.js +8 -5
- package/src/internal.d.ts +12 -0
- package/src/internal.d.ts.map +1 -0
- package/src/internal.js +8 -0
- package/src/lib/config/configuration-context.d.ts +1 -0
- package/src/lib/config/configuration-context.d.ts.map +1 -0
- package/src/lib/config/configuration-context.js +3 -9
- package/src/lib/config/default-skip-list.d.ts +5 -0
- package/src/lib/config/default-skip-list.d.ts.map +1 -0
- package/src/lib/{core → config}/default-skip-list.js +10 -16
- package/src/lib/config/share-utils.d.ts +7 -17
- package/src/lib/config/share-utils.d.ts.map +1 -0
- package/src/lib/config/share-utils.js +50 -123
- package/src/lib/config/with-native-federation.d.ts +2 -1
- package/src/lib/config/with-native-federation.d.ts.map +1 -0
- package/src/lib/config/with-native-federation.js +16 -20
- package/src/lib/core/build-adapter.d.ts +4 -28
- package/src/lib/core/build-adapter.d.ts.map +1 -0
- package/src/lib/core/build-adapter.js +4 -9
- package/src/lib/core/build-for-federation.d.ts +5 -8
- package/src/lib/core/build-for-federation.d.ts.map +1 -0
- package/src/lib/core/build-for-federation.js +38 -45
- package/src/lib/core/bundle-exposed-and-mappings.d.ts +4 -7
- package/src/lib/core/bundle-exposed-and-mappings.d.ts.map +1 -0
- package/src/lib/core/bundle-exposed-and-mappings.js +32 -42
- package/src/lib/core/bundle-shared.d.ts +6 -4
- package/src/lib/core/bundle-shared.d.ts.map +1 -0
- package/src/lib/core/bundle-shared.js +57 -64
- package/src/lib/core/default-external-list.d.ts +1 -0
- package/src/lib/core/default-external-list.d.ts.map +1 -0
- package/src/lib/core/default-external-list.js +1 -5
- package/src/lib/core/default-server-deps-list.d.ts +1 -0
- package/src/lib/core/default-server-deps-list.d.ts.map +1 -0
- package/src/lib/core/default-server-deps-list.js +2 -6
- package/src/lib/core/federation-builder.d.ts +7 -6
- package/src/lib/core/federation-builder.d.ts.map +1 -0
- package/src/lib/core/federation-builder.js +14 -19
- package/src/lib/core/get-externals.d.ts +2 -1
- package/src/lib/core/get-externals.d.ts.map +1 -0
- package/src/lib/core/get-externals.js +2 -6
- package/src/lib/core/load-federation-config.d.ts +3 -2
- package/src/lib/core/load-federation-config.d.ts.map +1 -0
- package/src/lib/core/load-federation-config.js +6 -12
- package/src/lib/core/remove-unused-deps.d.ts +2 -1
- package/src/lib/core/remove-unused-deps.d.ts.map +1 -0
- package/src/lib/core/remove-unused-deps.js +21 -29
- package/src/lib/core/write-federation-info.d.ts +3 -2
- package/src/lib/core/write-federation-info.d.ts.map +1 -0
- package/src/lib/core/write-federation-info.js +3 -8
- package/src/lib/core/write-import-map.d.ts +3 -2
- package/src/lib/core/write-import-map.d.ts.map +1 -0
- package/src/lib/core/write-import-map.js +3 -8
- package/src/lib/domain/config/external-config.contract.d.ts +40 -0
- package/src/lib/domain/config/external-config.contract.d.ts.map +1 -0
- package/src/lib/domain/config/external-config.contract.js +1 -0
- package/src/lib/domain/config/federation-config.contract.d.ts +28 -0
- package/src/lib/domain/config/federation-config.contract.d.ts.map +1 -0
- package/src/lib/domain/config/federation-config.contract.js +1 -0
- package/src/lib/domain/config/index.d.ts +4 -0
- package/src/lib/domain/config/index.d.ts.map +1 -0
- package/src/lib/domain/config/index.js +1 -0
- package/src/lib/{core/default-skip-list.d.ts → domain/config/skip-list.contract.d.ts} +1 -3
- package/src/lib/domain/config/skip-list.contract.d.ts.map +1 -0
- package/src/lib/domain/config/skip-list.contract.js +1 -0
- package/src/lib/domain/core/build-adapter.contract.d.ts +28 -0
- package/src/lib/domain/core/build-adapter.contract.d.ts.map +1 -0
- package/src/lib/domain/core/build-adapter.contract.js +1 -0
- package/src/lib/domain/core/build-notification-options.contract.d.ts +10 -0
- package/src/lib/domain/core/build-notification-options.contract.d.ts.map +1 -0
- package/src/lib/domain/core/build-notification-options.contract.js +6 -0
- package/src/lib/domain/core/build-params.contract.d.ts +6 -0
- package/src/lib/domain/core/build-params.contract.d.ts.map +1 -0
- package/src/lib/domain/core/build-params.contract.js +1 -0
- package/src/lib/domain/core/federation-info.contract.d.ts +29 -0
- package/src/lib/domain/core/federation-info.contract.d.ts.map +1 -0
- package/src/lib/domain/core/federation-info.contract.js +1 -0
- package/src/lib/{core/federation-options.d.ts → domain/core/federation-options.contract.d.ts} +2 -1
- package/src/lib/domain/core/federation-options.contract.d.ts.map +1 -0
- package/src/lib/domain/core/federation-options.contract.js +1 -0
- package/src/lib/domain/core/index.d.ts +6 -0
- package/src/lib/domain/core/index.d.ts.map +1 -0
- package/src/lib/domain/core/index.js +1 -0
- package/src/lib/domain/utils/index.d.ts +3 -0
- package/src/lib/domain/utils/index.d.ts.map +1 -0
- package/src/lib/domain/utils/index.js +1 -0
- package/src/lib/domain/utils/keyvaluepair.contract.d.ts +5 -0
- package/src/lib/domain/utils/keyvaluepair.contract.d.ts.map +1 -0
- package/src/lib/domain/utils/keyvaluepair.contract.js +1 -0
- package/src/lib/domain/utils/mapped-path.contract.d.ts +5 -0
- package/src/lib/domain/utils/mapped-path.contract.d.ts.map +1 -0
- package/src/lib/domain/utils/mapped-path.contract.js +1 -0
- package/src/lib/utils/build-result-map.d.ts +3 -2
- package/src/lib/utils/build-result-map.d.ts.map +1 -0
- package/src/lib/utils/build-result-map.js +5 -11
- package/src/lib/utils/build-utils.d.ts +3 -2
- package/src/lib/utils/build-utils.d.ts.map +1 -0
- package/src/lib/utils/build-utils.js +3 -7
- package/src/lib/utils/bundle-caching.d.ts +4 -3
- package/src/lib/utils/bundle-caching.d.ts.map +1 -0
- package/src/lib/utils/bundle-caching.js +35 -47
- package/src/lib/utils/errors.d.ts +1 -0
- package/src/lib/utils/errors.d.ts.map +1 -0
- package/src/lib/utils/errors.js +1 -6
- package/src/lib/utils/get-external-imports.d.ts +1 -0
- package/src/lib/utils/get-external-imports.d.ts.map +1 -0
- package/src/lib/utils/get-external-imports.js +5 -10
- package/src/lib/utils/hash-file.d.ts +1 -0
- package/src/lib/utils/hash-file.d.ts.map +1 -0
- package/src/lib/utils/hash-file.js +3 -8
- package/src/lib/utils/logger.d.ts +1 -0
- package/src/lib/utils/logger.d.ts.map +1 -0
- package/src/lib/utils/logger.js +10 -16
- package/src/lib/utils/mapped-paths.d.ts +2 -4
- package/src/lib/utils/mapped-paths.d.ts.map +1 -0
- package/src/lib/utils/mapped-paths.js +4 -9
- package/src/lib/utils/normalize.d.ts +1 -0
- package/src/lib/utils/normalize.d.ts.map +1 -0
- package/src/lib/utils/normalize.js +2 -7
- package/src/lib/utils/package-info.d.ts +1 -0
- package/src/lib/utils/package-info.d.ts.map +1 -0
- package/src/lib/utils/package-info.js +36 -47
- package/src/lib/utils/rebuild-queue.d.ts +1 -0
- package/src/lib/utils/rebuild-queue.d.ts.map +1 -0
- package/src/lib/utils/rebuild-queue.js +5 -10
- package/src/lib/utils/resolve-glob.d.ts +1 -0
- package/src/lib/utils/resolve-glob.d.ts.map +1 -0
- package/src/lib/utils/resolve-glob.js +3 -8
- package/src/lib/utils/resolve-wildcard-keys.d.ts +2 -4
- package/src/lib/utils/resolve-wildcard-keys.d.ts.map +1 -0
- package/src/lib/utils/resolve-wildcard-keys.js +3 -8
- package/src/lib/utils/rewrite-chunk-imports.d.ts +1 -0
- package/src/lib/utils/rewrite-chunk-imports.d.ts.map +1 -0
- package/src/lib/utils/rewrite-chunk-imports.js +13 -22
- package/LICENSE +0 -8
- package/README.md +0 -509
- package/build.d.ts +0 -1
- package/build.js +0 -5
- package/build.js.map +0 -1
- package/src/build.d.ts +0 -19
- package/src/build.js +0 -38
- package/src/build.js.map +0 -1
- package/src/config.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/config/configuration-context.js.map +0 -1
- package/src/lib/config/federation-config.d.ts +0 -55
- package/src/lib/config/federation-config.js +0 -3
- package/src/lib/config/federation-config.js.map +0 -1
- package/src/lib/config/share-utils.js.map +0 -1
- package/src/lib/config/with-native-federation.js.map +0 -1
- package/src/lib/core/build-adapter.js.map +0 -1
- package/src/lib/core/build-for-federation.js.map +0 -1
- package/src/lib/core/bundle-exposed-and-mappings.js.map +0 -1
- package/src/lib/core/bundle-shared.js.map +0 -1
- package/src/lib/core/default-external-list.js.map +0 -1
- package/src/lib/core/default-server-deps-list.js.map +0 -1
- package/src/lib/core/default-skip-list.js.map +0 -1
- package/src/lib/core/federation-builder.js.map +0 -1
- package/src/lib/core/federation-options.js +0 -3
- package/src/lib/core/federation-options.js.map +0 -1
- package/src/lib/core/get-externals.js.map +0 -1
- package/src/lib/core/load-federation-config.js.map +0 -1
- package/src/lib/core/remove-unused-deps.js.map +0 -1
- package/src/lib/core/write-federation-info.js.map +0 -1
- package/src/lib/core/write-import-map.js.map +0 -1
- package/src/lib/utils/build-result-map.js.map +0 -1
- package/src/lib/utils/build-utils.js.map +0 -1
- package/src/lib/utils/bundle-caching.js.map +0 -1
- package/src/lib/utils/errors.js.map +0 -1
- package/src/lib/utils/get-external-imports.js.map +0 -1
- package/src/lib/utils/hash-file.js.map +0 -1
- package/src/lib/utils/logger.js.map +0 -1
- package/src/lib/utils/mapped-paths.js.map +0 -1
- package/src/lib/utils/normalize.js.map +0 -1
- package/src/lib/utils/package-info.js.map +0 -1
- package/src/lib/utils/rebuild-queue.js.map +0 -1
- package/src/lib/utils/resolve-glob.js.map +0 -1
- package/src/lib/utils/resolve-wildcard-keys.js.map +0 -1
- package/src/lib/utils/rewrite-chunk-imports.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PreparedSkipList, SkipList } from './skip-list.contract.js';
|
|
2
|
+
import type { MappedPath } from '../utils/mapped-path.contract.js';
|
|
3
|
+
import type { NormalizedSharedExternalsConfig, SharedExternalsConfig } from './external-config.contract.js';
|
|
4
|
+
export interface FederationConfig {
|
|
5
|
+
name?: string;
|
|
6
|
+
exposes?: Record<string, string>;
|
|
7
|
+
shared?: SharedExternalsConfig;
|
|
8
|
+
sharedMappings?: Array<string>;
|
|
9
|
+
skip?: SkipList;
|
|
10
|
+
externals?: string[];
|
|
11
|
+
features?: {
|
|
12
|
+
mappingVersion?: boolean;
|
|
13
|
+
ignoreUnusedDeps?: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface NormalizedFederationConfig {
|
|
17
|
+
name: string;
|
|
18
|
+
exposes: Record<string, string>;
|
|
19
|
+
shared: NormalizedSharedExternalsConfig;
|
|
20
|
+
sharedMappings: Array<MappedPath>;
|
|
21
|
+
skip: PreparedSkipList;
|
|
22
|
+
externals: string[];
|
|
23
|
+
features: {
|
|
24
|
+
mappingVersion: boolean;
|
|
25
|
+
ignoreUnusedDeps: boolean;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=federation-config.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federation-config.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/config/federation-config.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EACV,+BAA+B,EAC/B,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,+BAA+B,CAAC;IACxC,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE;QACR,cAAc,EAAE,OAAO,CAAC;QACxB,gBAAgB,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { ExternalConfig, IncludeSecondariesOptions, SharedExternalsConfig, ShareAllExternalsOptions, ShareExternalsOptions, } from './external-config.contract.js';
|
|
2
|
+
export type { FederationConfig } from './federation-config.contract.js';
|
|
3
|
+
export type { PreparedSkipList, SkipFn, SkipList, SkipListEntry } from './skip-list.contract.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/config/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export type SkipFn = (name: string) => boolean;
|
|
2
2
|
export type SkipListEntry = string | RegExp | SkipFn;
|
|
3
3
|
export type SkipList = SkipListEntry[];
|
|
4
|
-
export declare const DEFAULT_SKIP_LIST: SkipList;
|
|
5
4
|
export type PreparedSkipList = {
|
|
6
5
|
strings: Set<string>;
|
|
7
6
|
functions: SkipFn[];
|
|
8
7
|
regexps: RegExp[];
|
|
9
8
|
};
|
|
10
|
-
|
|
11
|
-
export declare function isInSkipList(entry: string, skipList: PreparedSkipList): boolean;
|
|
9
|
+
//# sourceMappingURL=skip-list.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-list.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/config/skip-list.contract.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;AAEvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { MappedPath } from '../utils/mapped-path.contract.js';
|
|
2
|
+
export type NFBuildAdapter = (options: NFBuildAdapterOptions) => Promise<NFBuildAdapterResult[]>;
|
|
3
|
+
export type BuildKind = 'shared-package' | 'shared-mapping' | 'exposed' | 'mapping-or-exposed';
|
|
4
|
+
export interface EntryPoint {
|
|
5
|
+
fileName: string;
|
|
6
|
+
outName: string;
|
|
7
|
+
key?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface NFBuildAdapterOptions {
|
|
10
|
+
entryPoints: EntryPoint[];
|
|
11
|
+
tsConfigPath?: string;
|
|
12
|
+
external: Array<string>;
|
|
13
|
+
outdir: string;
|
|
14
|
+
mappedPaths: MappedPath[];
|
|
15
|
+
packageName?: string;
|
|
16
|
+
esm?: boolean;
|
|
17
|
+
dev?: boolean;
|
|
18
|
+
watch?: boolean;
|
|
19
|
+
kind: BuildKind;
|
|
20
|
+
hash: boolean;
|
|
21
|
+
platform?: 'browser' | 'node';
|
|
22
|
+
optimizedMappings?: boolean;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}
|
|
25
|
+
export interface NFBuildAdapterResult {
|
|
26
|
+
fileName: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=build-adapter.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-adapter.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/core/build-adapter.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;AAEjG,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,SAAS,GAAG,oBAAoB,CAAC;AAE/F,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BuildNotificationOptions {
|
|
2
|
+
enable: boolean;
|
|
3
|
+
endpoint: string;
|
|
4
|
+
}
|
|
5
|
+
export declare enum BuildNotificationType {
|
|
6
|
+
COMPLETED = "federation-rebuild-complete",
|
|
7
|
+
ERROR = "federation-rebuild-error",
|
|
8
|
+
CANCELLED = "federation-rebuild-cancelled"
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=build-notification-options.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-notification-options.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/core/build-notification-options.contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,qBAAqB;IAC/B,SAAS,gCAAgC;IACzC,KAAK,6BAA6B;IAClC,SAAS,iCAAiC;CAC3C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var BuildNotificationType;
|
|
2
|
+
(function (BuildNotificationType) {
|
|
3
|
+
BuildNotificationType["COMPLETED"] = "federation-rebuild-complete";
|
|
4
|
+
BuildNotificationType["ERROR"] = "federation-rebuild-error";
|
|
5
|
+
BuildNotificationType["CANCELLED"] = "federation-rebuild-cancelled";
|
|
6
|
+
})(BuildNotificationType || (BuildNotificationType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-params.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/core/build-params.contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,sBAAsB,EAAE,OAAO,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface FederationInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
exposes: ExposesInfo[];
|
|
4
|
+
shared: SharedInfo[];
|
|
5
|
+
buildNotificationsEndpoint?: string;
|
|
6
|
+
}
|
|
7
|
+
export type SharedInfo = {
|
|
8
|
+
singleton: boolean;
|
|
9
|
+
strictVersion: boolean;
|
|
10
|
+
requiredVersion: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
packageName: string;
|
|
13
|
+
outFileName: string;
|
|
14
|
+
dev?: {
|
|
15
|
+
entryPoint: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export interface ExposesInfo {
|
|
19
|
+
key: string;
|
|
20
|
+
outFileName: string;
|
|
21
|
+
dev?: {
|
|
22
|
+
entryPoint: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface ArtefactInfo {
|
|
26
|
+
mappings: SharedInfo[];
|
|
27
|
+
exposes: ExposesInfo[];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=federation-info.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federation-info.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/core/federation-info.contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;AACD,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AACF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/lib/{core/federation-options.d.ts → domain/core/federation-options.contract.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuildNotificationOptions } from '
|
|
1
|
+
import type { BuildNotificationOptions } from './build-notification-options.contract.js';
|
|
2
2
|
export interface FederationOptions {
|
|
3
3
|
workspaceRoot: string;
|
|
4
4
|
outputPath: string;
|
|
@@ -12,3 +12,4 @@ export interface FederationOptions {
|
|
|
12
12
|
entryPoint?: string;
|
|
13
13
|
buildNotifications?: BuildNotificationOptions;
|
|
14
14
|
}
|
|
15
|
+
//# sourceMappingURL=federation-options.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federation-options.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/core/federation-options.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEzF,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { SharedInfo, FederationInfo, ExposesInfo, ArtefactInfo, } from './federation-info.contract.js';
|
|
2
|
+
export { type BuildNotificationOptions, BuildNotificationType, } from './build-notification-options.contract.js';
|
|
3
|
+
export type { FederationOptions } from './federation-options.contract.js';
|
|
4
|
+
export type { BuildKind, EntryPoint, NFBuildAdapterOptions, NFBuildAdapter, NFBuildAdapterResult, } from './build-adapter.contract.js';
|
|
5
|
+
export type { BuildParams } from './build-params.contract.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,wBAAwB,EAC7B,qBAAqB,GACtB,MAAM,0CAA0C,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,YAAY,EACV,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BuildNotificationType, } from './build-notification-options.contract.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyvaluepair.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/utils/keyvaluepair.contract.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapped-path.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/utils/mapped-path.contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function createBuildResultMap(buildResult:
|
|
1
|
+
import type { NFBuildAdapterResult } from '../domain/core/build-adapter.contract.js';
|
|
2
|
+
export declare function createBuildResultMap(buildResult: NFBuildAdapterResult[], isHashed: boolean): Record<string, string>;
|
|
3
3
|
export declare function lookupInResultMap(map: Record<string, string>, requestName: string): string;
|
|
4
|
+
//# sourceMappingURL=build-result-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-result-map.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/build-result-map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,oBAAoB,EAAE,EACnC,QAAQ,EAAE,OAAO,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAoBxB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAG1F"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.createBuildResultMap = createBuildResultMap;
|
|
4
|
-
exports.lookupInResultMap = lookupInResultMap;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
-
function createBuildResultMap(buildResult, isHashed) {
|
|
1
|
+
import path from 'path';
|
|
2
|
+
export function createBuildResultMap(buildResult, isHashed) {
|
|
8
3
|
const map = {};
|
|
9
4
|
for (const item of buildResult) {
|
|
10
|
-
const resultName =
|
|
5
|
+
const resultName = path.basename(item.fileName);
|
|
11
6
|
let requestName = resultName;
|
|
12
7
|
if (isHashed) {
|
|
13
8
|
const start = resultName.lastIndexOf('-');
|
|
@@ -20,8 +15,7 @@ function createBuildResultMap(buildResult, isHashed) {
|
|
|
20
15
|
}
|
|
21
16
|
return map;
|
|
22
17
|
}
|
|
23
|
-
function lookupInResultMap(map, requestName) {
|
|
24
|
-
const key =
|
|
18
|
+
export function lookupInResultMap(map, requestName) {
|
|
19
|
+
const key = path.basename(requestName);
|
|
25
20
|
return map[key];
|
|
26
21
|
}
|
|
27
|
-
//# sourceMappingURL=build-result-map.js.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function bundle(options:
|
|
1
|
+
import type { NFBuildAdapterOptions } from '../domain/core/build-adapter.contract.js';
|
|
2
|
+
export declare function bundle(options: NFBuildAdapterOptions): Promise<import("../domain/core/build-adapter.contract.js").NFBuildAdapterResult[]>;
|
|
3
|
+
//# sourceMappingURL=build-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/build-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAGtF,wBAAsB,MAAM,CAAC,OAAO,EAAE,qBAAqB,sFAG1D"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const build_adapter_1 = require("../core/build-adapter");
|
|
5
|
-
async function bundle(options) {
|
|
6
|
-
const adapter = (0, build_adapter_1.getBuildAdapter)();
|
|
1
|
+
import { getBuildAdapter } from '../core/build-adapter.js';
|
|
2
|
+
export async function bundle(options) {
|
|
3
|
+
const adapter = getBuildAdapter();
|
|
7
4
|
return await adapter(options);
|
|
8
5
|
}
|
|
9
|
-
//# sourceMappingURL=build-utils.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SharedInfo } from '
|
|
1
|
+
import type { NormalizedExternalConfig } from '../domain/config/external-config.contract.js';
|
|
2
|
+
import type { SharedInfo } from '../domain/core/federation-info.contract.js';
|
|
3
3
|
export declare const getCachePath: (workspaceRoot: string, project: string) => string;
|
|
4
4
|
export declare const getFilename: (title: string, dev?: boolean) => string;
|
|
5
|
-
export declare const getChecksum: (shared: Record<string,
|
|
5
|
+
export declare const getChecksum: (shared: Record<string, NormalizedExternalConfig>, dev: "1" | "0") => string;
|
|
6
6
|
export declare const cacheEntry: (pathToCache: string, fileName: string) => {
|
|
7
7
|
getMetadata: (checksum: string) => {
|
|
8
8
|
checksum: string;
|
|
@@ -17,3 +17,4 @@ export declare const cacheEntry: (pathToCache: string, fileName: string) => {
|
|
|
17
17
|
copyFiles: (fullOutputPath: string) => void;
|
|
18
18
|
clear: () => void;
|
|
19
19
|
};
|
|
20
|
+
//# sourceMappingURL=bundle-caching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-caching.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/bundle-caching.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAG7E,eAAO,MAAM,YAAY,GAAI,eAAe,MAAM,EAAE,SAAS,MAAM,WACS,CAAC;AAE7E,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,MAAM,OAAO,WAGvD,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,QAAQ,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,EAChD,KAAK,GAAG,GAAG,GAAG,KACb,MAaF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,aAAa,MAAM,EAAE,UAAU,MAAM;4BAElD,MAAM,KAEd;QACE,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,UAAU,EAAE,CAAC;QACxB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,GACD,SAAS;uBAYM;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,UAAU,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE;gCAGrD,MAAM;;CA6ClC,CAAC"}
|
|
@@ -1,78 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
8
|
-
const logger_1 = require("../utils/logger");
|
|
9
|
-
const getCachePath = (workspaceRoot, project) => path_1.default.join(workspaceRoot, 'node_modules/.cache/native-federation', project);
|
|
10
|
-
exports.getCachePath = getCachePath;
|
|
11
|
-
const getFilename = (title, dev) => {
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import crypto from 'crypto';
|
|
4
|
+
import { logger } from '../utils/logger.js';
|
|
5
|
+
export const getCachePath = (workspaceRoot, project) => path.join(workspaceRoot, 'node_modules/.cache/native-federation', project);
|
|
6
|
+
export const getFilename = (title, dev) => {
|
|
12
7
|
const devSuffix = dev ? '-dev' : '';
|
|
13
8
|
return `${title}${devSuffix}.meta.json`;
|
|
14
9
|
};
|
|
15
|
-
|
|
16
|
-
const getChecksum = (shared, dev) => {
|
|
10
|
+
export const getChecksum = (shared, dev) => {
|
|
17
11
|
const denseExternals = Object.keys(shared)
|
|
18
12
|
.sort()
|
|
19
13
|
.reduce((clean, external) => {
|
|
20
|
-
return (clean +
|
|
21
|
-
':' +
|
|
22
|
-
external +
|
|
23
|
-
(shared[external].version ? `@${shared[external].version}` : ''));
|
|
14
|
+
return (clean + ':' + external + (shared[external].version ? `@${shared[external].version}` : ''));
|
|
24
15
|
}, 'deps');
|
|
25
|
-
return
|
|
16
|
+
return crypto
|
|
26
17
|
.createHash('sha256')
|
|
27
18
|
.update(denseExternals + `:dev=${dev}`)
|
|
28
19
|
.digest('hex');
|
|
29
20
|
};
|
|
30
|
-
|
|
31
|
-
const cacheEntry = (pathToCache, fileName) => ({
|
|
21
|
+
export const cacheEntry = (pathToCache, fileName) => ({
|
|
32
22
|
getMetadata: (checksum) => {
|
|
33
|
-
const metadataFile =
|
|
34
|
-
if (!
|
|
23
|
+
const metadataFile = path.join(pathToCache, fileName);
|
|
24
|
+
if (!fs.existsSync(pathToCache) || !fs.existsSync(metadataFile))
|
|
35
25
|
return undefined;
|
|
36
|
-
const cachedResult = JSON.parse(
|
|
26
|
+
const cachedResult = JSON.parse(fs.readFileSync(metadataFile, 'utf-8'));
|
|
37
27
|
if (cachedResult.checksum !== checksum)
|
|
38
28
|
return undefined;
|
|
39
29
|
return cachedResult;
|
|
40
30
|
},
|
|
41
31
|
persist: (payload) => {
|
|
42
|
-
|
|
32
|
+
fs.writeFileSync(path.join(pathToCache, fileName), JSON.stringify(payload), 'utf-8');
|
|
43
33
|
},
|
|
44
34
|
copyFiles: (fullOutputPath) => {
|
|
45
|
-
const metadataFile =
|
|
46
|
-
if (!
|
|
35
|
+
const metadataFile = path.join(pathToCache, fileName);
|
|
36
|
+
if (!fs.existsSync(metadataFile))
|
|
47
37
|
throw new Error('Error copying artifacts to dist, metadata file could not be found.');
|
|
48
|
-
const cachedResult = JSON.parse(
|
|
49
|
-
|
|
50
|
-
cachedResult.files.forEach(
|
|
51
|
-
const cachedFile =
|
|
52
|
-
const distFileName =
|
|
53
|
-
if (
|
|
54
|
-
|
|
38
|
+
const cachedResult = JSON.parse(fs.readFileSync(metadataFile, 'utf-8'));
|
|
39
|
+
fs.mkdirSync(path.dirname(fullOutputPath), { recursive: true });
|
|
40
|
+
cachedResult.files.forEach(file => {
|
|
41
|
+
const cachedFile = path.join(pathToCache, file);
|
|
42
|
+
const distFileName = path.join(fullOutputPath, file);
|
|
43
|
+
if (fs.existsSync(cachedFile)) {
|
|
44
|
+
fs.copyFileSync(cachedFile, distFileName);
|
|
55
45
|
}
|
|
56
46
|
});
|
|
57
47
|
},
|
|
58
48
|
clear: () => {
|
|
59
|
-
const metadataFile =
|
|
60
|
-
if (!
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
const metadataFile = path.join(pathToCache, fileName);
|
|
50
|
+
if (!fs.existsSync(pathToCache)) {
|
|
51
|
+
fs.mkdirSync(pathToCache, { recursive: true });
|
|
52
|
+
logger.debug(`Creating cache folder '${pathToCache}' for '${fileName}'.`);
|
|
63
53
|
return;
|
|
64
54
|
}
|
|
65
|
-
if (!
|
|
55
|
+
if (!fs.existsSync(metadataFile))
|
|
66
56
|
return;
|
|
67
|
-
|
|
68
|
-
const cachedResult = JSON.parse(
|
|
69
|
-
cachedResult.files.forEach(
|
|
70
|
-
const cachedFile =
|
|
71
|
-
if (
|
|
72
|
-
|
|
57
|
+
logger.debug(`Purging cached bundle '${metadataFile}'.`);
|
|
58
|
+
const cachedResult = JSON.parse(fs.readFileSync(metadataFile, 'utf-8'));
|
|
59
|
+
cachedResult.files.forEach(file => {
|
|
60
|
+
const cachedFile = path.join(pathToCache, file);
|
|
61
|
+
if (fs.existsSync(cachedFile))
|
|
62
|
+
fs.unlinkSync(cachedFile);
|
|
73
63
|
});
|
|
74
|
-
|
|
64
|
+
fs.unlinkSync(metadataFile);
|
|
75
65
|
},
|
|
76
66
|
});
|
|
77
|
-
exports.cacheEntry = cacheEntry;
|
|
78
|
-
//# sourceMappingURL=bundle-caching.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAK5B"}
|
package/src/lib/utils/errors.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbortedError = void 0;
|
|
4
|
-
class AbortedError extends Error {
|
|
1
|
+
export class AbortedError extends Error {
|
|
5
2
|
constructor(message) {
|
|
6
3
|
super(message);
|
|
7
4
|
this.name = 'AbortedError';
|
|
8
5
|
Object.setPrototypeOf(this, AbortedError.prototype);
|
|
9
6
|
}
|
|
10
7
|
}
|
|
11
|
-
exports.AbortedError = AbortedError;
|
|
12
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-external-imports.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/get-external-imports.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,YA2FvD"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const path = tslib_1.__importStar(require("path"));
|
|
6
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
-
const ts = tslib_1.__importStar(require("typescript"));
|
|
8
|
-
function getExternalImports(entryFilePath) {
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as ts from 'typescript';
|
|
4
|
+
export function getExternalImports(entryFilePath) {
|
|
9
5
|
const visited = new Set();
|
|
10
6
|
const externals = new Set();
|
|
11
7
|
function isExternal(specifier) {
|
|
@@ -25,7 +21,7 @@ function getExternalImports(entryFilePath) {
|
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
23
|
if (fs.existsSync(abs) && fs.statSync(abs).isDirectory()) {
|
|
28
|
-
for (const file of extensions.map(
|
|
24
|
+
for (const file of extensions.map(e => 'index' + e)) {
|
|
29
25
|
const indexPath = path.join(abs, file);
|
|
30
26
|
if (fs.existsSync(indexPath) && fs.statSync(indexPath).isFile()) {
|
|
31
27
|
return indexPath;
|
|
@@ -82,4 +78,3 @@ function getExternalImports(entryFilePath) {
|
|
|
82
78
|
visit(entryFilePath);
|
|
83
79
|
return Array.from(externals);
|
|
84
80
|
}
|
|
85
|
-
//# sourceMappingURL=get-external-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/hash-file.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKjD"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const crypto = tslib_1.__importStar(require("crypto"));
|
|
6
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
-
function hashFile(fileName) {
|
|
1
|
+
import * as crypto from 'crypto';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
export function hashFile(fileName) {
|
|
8
4
|
const fileBuffer = fs.readFileSync(fileName);
|
|
9
5
|
const hashSum = crypto.createHash('md5');
|
|
10
6
|
hashSum.update(fileBuffer);
|
|
11
7
|
return hashSum.digest('hex');
|
|
12
8
|
}
|
|
13
|
-
//# sourceMappingURL=hash-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/logger.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM;gBACL,GAAG;iBACF,GAAG;kBACF,GAAG;gBACL,GAAG;mBACA,GAAG;iBAEL,GAAG;qBAEC,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,MAAM;CAkBrD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,SAExC,CAAC"}
|
package/src/lib/utils/logger.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
|
|
4
|
-
exports.setLogLevel = exports.logger = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
2
|
+
import chalk from 'chalk';
|
|
7
3
|
let verbose = false;
|
|
8
|
-
|
|
9
|
-
warn: (msg) => console.warn(
|
|
10
|
-
error: (msg) => console.error(
|
|
11
|
-
notice: (msg) => console.log(
|
|
12
|
-
info: (msg) => console.log(
|
|
13
|
-
verbose: (msg) => verbose && console.log(
|
|
14
|
-
debug: (msg) => verbose && console.log(
|
|
4
|
+
export const logger = {
|
|
5
|
+
warn: (msg) => console.warn(chalk.bgYellow.ansi256(15)(' WARN '), msg),
|
|
6
|
+
error: (msg) => console.error(chalk.bgRed.ansi256(15)(' ERRR '), msg),
|
|
7
|
+
notice: (msg) => console.log(chalk.bgYellowBright.black(' NOTE '), msg),
|
|
8
|
+
info: (msg) => console.log(chalk.bgGreen.ansi256(15)(' INFO '), msg),
|
|
9
|
+
verbose: (msg) => verbose && console.log(chalk.bgGreen.ansi256(15)(' DBG! '), msg),
|
|
10
|
+
debug: (msg) => verbose && console.log(chalk.bgGreen.ansi256(15)(' DBG! '), msg),
|
|
15
11
|
measure: (start, milestone) => {
|
|
16
12
|
if (!verbose)
|
|
17
13
|
return;
|
|
@@ -23,11 +19,9 @@ exports.logger = {
|
|
|
23
19
|
const timeStr = `${minutes.toString().padStart(2, '0')}:${seconds
|
|
24
20
|
.toString()
|
|
25
21
|
.padStart(2, '0')}:${msFormatted.padStart(7, '0')}ms`;
|
|
26
|
-
console.log(
|
|
22
|
+
console.log(chalk.bgGreen.ansi256(15)(' DBG! '), `${timeStr} - ${milestone}`);
|
|
27
23
|
},
|
|
28
24
|
};
|
|
29
|
-
const setLogLevel = (level) => {
|
|
25
|
+
export const setLogLevel = (level) => {
|
|
30
26
|
verbose = level === 'verbose';
|
|
31
27
|
};
|
|
32
|
-
exports.setLogLevel = setLogLevel;
|
|
33
|
-
//# sourceMappingURL=logger.js.map
|