@onecx/accelerator 8.8.0 → 9.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -40,13 +40,10 @@ __export(index_exports, {
40
40
  ensureProperty: () => ensureProperty,
41
41
  getLocation: () => getLocation,
42
42
  getNormalizedBrowserLocales: () => getNormalizedBrowserLocales,
43
- getOneCXSharedLibraryConfig: () => getOneCXSharedLibraryConfig,
44
- getOneCXSharedRecommendations: () => getOneCXSharedRecommendations,
45
43
  getUTCDateWithoutTimezoneIssues: () => getUTCDateWithoutTimezoneIssues,
46
44
  isTest: () => isTest,
47
45
  isValidDate: () => isValidDate,
48
- normalizeLocales: () => normalizeLocales,
49
- onecxPackageFilter: () => onecxPackageFilter
46
+ normalizeLocales: () => normalizeLocales
50
47
  });
51
48
  module.exports = __toCommonJS(index_exports);
52
49
 
@@ -668,150 +665,3 @@ var Gatherer = class _Gatherer {
668
665
  return this.ownIds.has(m.id);
669
666
  }
670
667
  };
671
-
672
- // libs/accelerator/src/lib/utils/get-onecx-shared-recommendations.ts
673
- var sharedLibraryPatterns = [
674
- /^@angular.*$/,
675
- /^@onecx.*$/,
676
- /^rxjs.*$/,
677
- /^primeng.*$/,
678
- /^@ngx-translate.*$/,
679
- /^@ngrx.*$/
680
- ];
681
- function getOneCXSharedRecommendations(libraryName, sharedConfig) {
682
- if (!sharedLibraryPatterns.some((pattern) => pattern.test(libraryName))) {
683
- return false;
684
- }
685
- sharedConfig.singleton = false;
686
- sharedConfig.strictVersion = false;
687
- sharedConfig.eager = false;
688
- return sharedConfig;
689
- }
690
-
691
- // libs/accelerator/src/lib/utils/get-onecx-shared-library-config.ts
692
- var angularCore = "@angular/core";
693
- var logger = createLogger("getOneCXSharedLibraryConfig");
694
- function getNodeRequire() {
695
- try {
696
- if (typeof process !== "undefined" && process?.versions?.node) {
697
- return eval("require");
698
- }
699
- } catch {
700
- logger.warn(`Node require is not available.`);
701
- }
702
- return null;
703
- }
704
- var EXPORTS_BLACKLIST = [".", "./package.json"];
705
- var DEFAULT_DEPENDENCY_BLACKLIST = [
706
- /^@nx(\/.*)?$/,
707
- /^@module-federation(\/.*)?$/,
708
- /^@onecx\/build-utils(\/.*)?$/
709
- ];
710
- var DEFAULT_FULL_PACKAGE_BLACKLIST = [
711
- "@angular/common/locales/global/*",
712
- "@angular/common/locales/*",
713
- "@angular/common/upgrade",
714
- "@angular/core/schematics/*",
715
- "@angular/core/event-dispatch-contract.min.js",
716
- "@angular/service-worker/ngsw-worker.js",
717
- "@angular/service-worker/safety-worker.js",
718
- "@angular/service-worker/config/schema.json",
719
- "@angular/router/upgrade",
720
- "@angular/localize/tools",
721
- "rxjs/internal/*",
722
- "primeng/resources/",
723
- "primeng/editor",
724
- "@onecx/angular-accelerator/testing",
725
- "@onecx/angular-accelerator/migrations.json"
726
- ];
727
- function removeExportPrefix(str) {
728
- return str.replace("./", "");
729
- }
730
- function onecxPackageFilter(packageName) {
731
- if (isDependencyBlacklisted(packageName)) {
732
- return true;
733
- }
734
- return DEFAULT_FULL_PACKAGE_BLACKLIST.includes(packageName);
735
- }
736
- function isDependencyBlacklisted(dependency) {
737
- return DEFAULT_DEPENDENCY_BLACKLIST.some((entry) => {
738
- if (entry instanceof RegExp) {
739
- return entry.test(dependency);
740
- }
741
- return entry === dependency;
742
- });
743
- }
744
- function readDependencyPackageJson(dependency) {
745
- const nodeRequire = getNodeRequire();
746
- if (!nodeRequire) return null;
747
- let packagePath;
748
- try {
749
- packagePath = nodeRequire.resolve(`${dependency}/package.json`);
750
- } catch {
751
- return null;
752
- }
753
- const fs = nodeRequire("fs");
754
- if (!fs.existsSync(packagePath)) {
755
- return null;
756
- }
757
- const packageContent = fs.readFileSync(packagePath, "utf-8");
758
- return JSON.parse(packageContent);
759
- }
760
- function generateSubPackageConfig(dependency, version, packageFilterCallback) {
761
- const subpackages = [];
762
- const dependencyPackage = readDependencyPackageJson(dependency);
763
- if (!dependencyPackage?.exports) {
764
- return subpackages;
765
- }
766
- const exportKeys = Object.keys(dependencyPackage.exports);
767
- for (const exportKey of exportKeys) {
768
- if (EXPORTS_BLACKLIST.includes(exportKey)) continue;
769
- const subpackageName = `${dependency}/${removeExportPrefix(exportKey)}`;
770
- if (packageFilterCallback && packageFilterCallback(subpackageName)) continue;
771
- subpackages.push({ name: subpackageName, requiredVersion: version });
772
- }
773
- return subpackages;
774
- }
775
- function generatePackageConfig(versionMap, dependency, shouldGenerateSubDeps, packageFilterCallback = onecxPackageFilter) {
776
- if (packageFilterCallback(dependency)) {
777
- return [];
778
- }
779
- const allPackages = [];
780
- const version = versionMap[dependency];
781
- allPackages.push({ name: dependency, requiredVersion: version });
782
- if (shouldGenerateSubDeps) {
783
- const subpackages = generateSubPackageConfig(dependency, version, packageFilterCallback);
784
- allPackages.push(...subpackages);
785
- }
786
- return allPackages;
787
- }
788
- function getOneCXSharedLibraryConfig(dependencies, shouldGenerateSubDeps, options) {
789
- const allDependencies = Object.keys(dependencies).flatMap((dependency) => {
790
- return generatePackageConfig(dependencies, dependency, shouldGenerateSubDeps, options?.packageFilterCallback);
791
- });
792
- const sharedEntries = allDependencies.reduce((acc, packageEntry) => {
793
- const sharedLibConfig = {};
794
- sharedLibConfig["requiredVersion"] = packageEntry.requiredVersion;
795
- sharedLibConfig["shareScope"] = "default";
796
- const angularCoreVersion = (dependencies[angularCore] || "").split(".")[0].replace("^", "");
797
- if (angularCoreVersion && parseInt(angularCoreVersion, 10) >= 21) {
798
- const shareScope = "angular_".concat(angularCoreVersion);
799
- sharedLibConfig["shareScope"] = shareScope;
800
- }
801
- const onecxRecommendation = getOneCXSharedRecommendations(packageEntry.name, sharedLibConfig);
802
- if (!onecxRecommendation) {
803
- return acc;
804
- }
805
- const configFromCallback = options?.configCallback ? options.configCallback(packageEntry.name, onecxRecommendation) : void 0;
806
- if (configFromCallback && typeof configFromCallback === "object") {
807
- Object.assign(onecxRecommendation, configFromCallback);
808
- }
809
- return {
810
- ...acc,
811
- [packageEntry.name]: {
812
- ...onecxRecommendation
813
- }
814
- };
815
- }, {});
816
- return sharedEntries;
817
- }
package/dist/index.mjs CHANGED
@@ -618,153 +618,6 @@ var Gatherer = class _Gatherer {
618
618
  return this.ownIds.has(m.id);
619
619
  }
620
620
  };
621
-
622
- // libs/accelerator/src/lib/utils/get-onecx-shared-recommendations.ts
623
- var sharedLibraryPatterns = [
624
- /^@angular.*$/,
625
- /^@onecx.*$/,
626
- /^rxjs.*$/,
627
- /^primeng.*$/,
628
- /^@ngx-translate.*$/,
629
- /^@ngrx.*$/
630
- ];
631
- function getOneCXSharedRecommendations(libraryName, sharedConfig) {
632
- if (!sharedLibraryPatterns.some((pattern) => pattern.test(libraryName))) {
633
- return false;
634
- }
635
- sharedConfig.singleton = false;
636
- sharedConfig.strictVersion = false;
637
- sharedConfig.eager = false;
638
- return sharedConfig;
639
- }
640
-
641
- // libs/accelerator/src/lib/utils/get-onecx-shared-library-config.ts
642
- var angularCore = "@angular/core";
643
- var logger = createLogger("getOneCXSharedLibraryConfig");
644
- function getNodeRequire() {
645
- try {
646
- if (typeof process !== "undefined" && process?.versions?.node) {
647
- return eval("require");
648
- }
649
- } catch {
650
- logger.warn(`Node require is not available.`);
651
- }
652
- return null;
653
- }
654
- var EXPORTS_BLACKLIST = [".", "./package.json"];
655
- var DEFAULT_DEPENDENCY_BLACKLIST = [
656
- /^@nx(\/.*)?$/,
657
- /^@module-federation(\/.*)?$/,
658
- /^@onecx\/build-utils(\/.*)?$/
659
- ];
660
- var DEFAULT_FULL_PACKAGE_BLACKLIST = [
661
- "@angular/common/locales/global/*",
662
- "@angular/common/locales/*",
663
- "@angular/common/upgrade",
664
- "@angular/core/schematics/*",
665
- "@angular/core/event-dispatch-contract.min.js",
666
- "@angular/service-worker/ngsw-worker.js",
667
- "@angular/service-worker/safety-worker.js",
668
- "@angular/service-worker/config/schema.json",
669
- "@angular/router/upgrade",
670
- "@angular/localize/tools",
671
- "rxjs/internal/*",
672
- "primeng/resources/",
673
- "primeng/editor",
674
- "@onecx/angular-accelerator/testing",
675
- "@onecx/angular-accelerator/migrations.json"
676
- ];
677
- function removeExportPrefix(str) {
678
- return str.replace("./", "");
679
- }
680
- function onecxPackageFilter(packageName) {
681
- if (isDependencyBlacklisted(packageName)) {
682
- return true;
683
- }
684
- return DEFAULT_FULL_PACKAGE_BLACKLIST.includes(packageName);
685
- }
686
- function isDependencyBlacklisted(dependency) {
687
- return DEFAULT_DEPENDENCY_BLACKLIST.some((entry) => {
688
- if (entry instanceof RegExp) {
689
- return entry.test(dependency);
690
- }
691
- return entry === dependency;
692
- });
693
- }
694
- function readDependencyPackageJson(dependency) {
695
- const nodeRequire = getNodeRequire();
696
- if (!nodeRequire) return null;
697
- let packagePath;
698
- try {
699
- packagePath = nodeRequire.resolve(`${dependency}/package.json`);
700
- } catch {
701
- return null;
702
- }
703
- const fs = nodeRequire("fs");
704
- if (!fs.existsSync(packagePath)) {
705
- return null;
706
- }
707
- const packageContent = fs.readFileSync(packagePath, "utf-8");
708
- return JSON.parse(packageContent);
709
- }
710
- function generateSubPackageConfig(dependency, version, packageFilterCallback) {
711
- const subpackages = [];
712
- const dependencyPackage = readDependencyPackageJson(dependency);
713
- if (!dependencyPackage?.exports) {
714
- return subpackages;
715
- }
716
- const exportKeys = Object.keys(dependencyPackage.exports);
717
- for (const exportKey of exportKeys) {
718
- if (EXPORTS_BLACKLIST.includes(exportKey)) continue;
719
- const subpackageName = `${dependency}/${removeExportPrefix(exportKey)}`;
720
- if (packageFilterCallback && packageFilterCallback(subpackageName)) continue;
721
- subpackages.push({ name: subpackageName, requiredVersion: version });
722
- }
723
- return subpackages;
724
- }
725
- function generatePackageConfig(versionMap, dependency, shouldGenerateSubDeps, packageFilterCallback = onecxPackageFilter) {
726
- if (packageFilterCallback(dependency)) {
727
- return [];
728
- }
729
- const allPackages = [];
730
- const version = versionMap[dependency];
731
- allPackages.push({ name: dependency, requiredVersion: version });
732
- if (shouldGenerateSubDeps) {
733
- const subpackages = generateSubPackageConfig(dependency, version, packageFilterCallback);
734
- allPackages.push(...subpackages);
735
- }
736
- return allPackages;
737
- }
738
- function getOneCXSharedLibraryConfig(dependencies, shouldGenerateSubDeps, options) {
739
- const allDependencies = Object.keys(dependencies).flatMap((dependency) => {
740
- return generatePackageConfig(dependencies, dependency, shouldGenerateSubDeps, options?.packageFilterCallback);
741
- });
742
- const sharedEntries = allDependencies.reduce((acc, packageEntry) => {
743
- const sharedLibConfig = {};
744
- sharedLibConfig["requiredVersion"] = packageEntry.requiredVersion;
745
- sharedLibConfig["shareScope"] = "default";
746
- const angularCoreVersion = (dependencies[angularCore] || "").split(".")[0].replace("^", "");
747
- if (angularCoreVersion && parseInt(angularCoreVersion, 10) >= 21) {
748
- const shareScope = "angular_".concat(angularCoreVersion);
749
- sharedLibConfig["shareScope"] = shareScope;
750
- }
751
- const onecxRecommendation = getOneCXSharedRecommendations(packageEntry.name, sharedLibConfig);
752
- if (!onecxRecommendation) {
753
- return acc;
754
- }
755
- const configFromCallback = options?.configCallback ? options.configCallback(packageEntry.name, onecxRecommendation) : void 0;
756
- if (configFromCallback && typeof configFromCallback === "object") {
757
- Object.assign(onecxRecommendation, configFromCallback);
758
- }
759
- return {
760
- ...acc,
761
- [packageEntry.name]: {
762
- ...onecxRecommendation
763
- }
764
- };
765
- }, {});
766
- return sharedEntries;
767
- }
768
621
  export {
769
622
  BroadcastChannelMock,
770
623
  FakeTopic,
@@ -776,11 +629,8 @@ export {
776
629
  ensureProperty,
777
630
  getLocation,
778
631
  getNormalizedBrowserLocales,
779
- getOneCXSharedLibraryConfig,
780
- getOneCXSharedRecommendations,
781
632
  getUTCDateWithoutTimezoneIssues,
782
633
  isTest,
783
634
  isValidDate,
784
- normalizeLocales,
785
- onecxPackageFilter
635
+ normalizeLocales
786
636
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onecx/accelerator",
3
- "version": "8.8.0",
3
+ "version": "9.0.0-rc.10",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.d.ts CHANGED
@@ -11,5 +11,3 @@ export * from './lib/utils/get-normalized-browser-locales.utils';
11
11
  export * from './lib/utils/gatherer';
12
12
  export * from './lib/utils/create-logger.utils';
13
13
  export * from './lib/utils/ensure-property.utils';
14
- export * from './lib/utils/get-onecx-shared-recommendations';
15
- export * from './lib/utils/get-onecx-shared-library-config';
package/src/index.js CHANGED
@@ -11,6 +11,4 @@ export * from './lib/utils/get-normalized-browser-locales.utils';
11
11
  export * from './lib/utils/gatherer';
12
12
  export * from './lib/utils/create-logger.utils';
13
13
  export * from './lib/utils/ensure-property.utils';
14
- export * from './lib/utils/get-onecx-shared-recommendations';
15
- export * from './lib/utils/get-onecx-shared-library-config';
16
14
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/accelerator/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0CAA0C,CAAA;AACxD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,kDAAkD,CAAA;AAChE,cAAc,sBAAsB,CAAA;AACpC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mCAAmC,CAAA;AACjD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,6CAA6C,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/accelerator/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0CAA0C,CAAA;AACxD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,kDAAkD,CAAA;AAChE,cAAc,sBAAsB,CAAA;AACpC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mCAAmC,CAAA"}
package/src/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const LIB_NAME = "@onecx/accelerator";
2
- export declare const LIB_VERSION = "8.8.0";
2
+ export declare const LIB_VERSION = "9.0.0-rc.10";
package/src/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export const LIB_NAME = '@onecx/accelerator';
2
- export const LIB_VERSION = '8.8.0';
2
+ export const LIB_VERSION = '9.0.0-rc.10';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../libs/accelerator/src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,oBAAoB,CAAA;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAA"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../libs/accelerator/src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,oBAAoB,CAAA;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA"}
@@ -1,101 +0,0 @@
1
- import { SharedLibraryConfig } from "./get-onecx-shared-recommendations";
2
- /**
3
- * @deprecated This interface is deprecated and will be moved to `@onecx/build-utils` in v9.
4
- *
5
- * Callbacks that can be passed to the SharedLibraryConfigOptions function to customize its behavior.
6
- * @property {function} configCallback - A function that receives the package name and current shared configuration, returning a modified configuration. Must return a SharedLibraryConfig object.
7
- * @property {function} packageFilterCallback - A function that takes a package name and returns a boolean. Return true to EXCLUDE the package, false to INCLUDE it, use onecxPackageFilter to use default blacklist.
8
- */
9
- export interface SharedLibraryConfigOptions {
10
- configCallback?: (packageName: string, currentConfig: SharedLibraryConfig) => SharedLibraryConfig;
11
- packageFilterCallback?: (packageName: string) => boolean | undefined;
12
- }
13
- /**
14
- * @deprecated This helper is deprecated and will be moved to `@onecx/build-utils` in v9.
15
- *
16
- * onecxPackageFilter is the default OneCX package filter.
17
- * @param {string} packageName - The full package name to check against the default blacklist.
18
- * @returns {boolean} - Returns `true` if the package is on the default blacklist, `false` otherwise.
19
- */
20
- export declare function onecxPackageFilter(packageName: string): boolean;
21
- /**
22
- * @deprecated This helper is deprecated and will be moved to `@onecx/build-utils` in v9.
23
- *
24
- * Generates a shared library configuration object for all dependencies (main + subpackages if needed).
25
- * @param {Record<string, string>} dependencies - Map of dependency names to versions
26
- * @param {boolean} shouldGenerateSubDeps - Flag indicating whether to include subpackages based on exports
27
- * @param {SharedLibraryConfigOptions} options - Optional callbacks for customizing the configuration generation process. Includes:
28
- * - configCallback: A function that receives the package name and current shared configuration, returning a modified configuration.
29
- * configCallback?: (packageName: string, currentConfig: SharedLibraryConfig) => SharedLibraryConfig;
30
- * - packageFilterCallback: A function that takes a package name and returns a boolean. Return true to EXCLUDE the package, false to INCLUDE it.
31
- * packageFilterCallback?: (packageName: string) => boolean | undefined;
32
- * @returns {Record<string, SharedLibraryConfig>} A map of package names to their shared library configuration
33
- *
34
- * @example
35
- * **Recommended usage for @module-federation/enhanced:**
36
- * ```js
37
- * const sharedEntries = getOneCXSharedLibraryConfig(dependencies, true);
38
- * const config = {
39
- * name: 'onecx-test-project-ui',
40
- * filename: 'remoteEntry.js',
41
- * shared: sharedEntries,
42
- * shareScope: 'angular_21'
43
- * }
44
- * ```
45
- *
46
- * **Recommended usage for @angular-architects/module-federation:**
47
- * The share function is from @angular-architects/module-federation.
48
- * ```js
49
- * function customConfigCallback(packageName: string, currentConfig: SharedLibraryConfig): SharedLibraryConfig {
50
- * currentConfig[includeSecondaries]=true
51
- * currentConfig[requiredVersion]='auto'
52
- * return currentConfig
53
- * }
54
- *
55
- * const sharedEntries = getOneCXSharedLibraryConfig(dependencies, false, { configCallback: customConfigCallback });
56
- * const config = withModuleFederationPlugin({
57
- * name: 'onecx-<%= remoteModuleFileName %>-ui',
58
- * filename: 'remoteEntryOneCX.js',
59
- * exposes: {
60
- * './OneCX<%= remoteModuleName %>Module': './src/main.ts'
61
- * },
62
- * shared: share(sharedEntries),
63
- * });
64
- * ```
65
- * \
66
- * **With options (custom filter and config override) you can customize the behavior as follows:**
67
- * ```js
68
- * const sharedEntries = getOneCXSharedLibraryConfig(dependencies, true, {
69
- * packageFilterCallback: customPackageFilter,
70
- * configCallback: customConfigCallback,
71
- * });
72
- * ```
73
- * \
74
- * Following are some Custom Implementation:
75
- * 1. Adding Custom Config or overiding default config
76
- *```js
77
- * function customConfigCallback(packageName: string, currentConfig: SharedLibraryConfig): SharedLibraryConfig {
78
- * currentConfig[singleton]=true
79
- * return currentConfig
80
- * }
81
- * ```
82
- *
83
- * 2. Custom Package without using onecxPckageFilter
84
- * ```js
85
- * function customPackageFilter(packageName: string): boolean {
86
- * if (packageName.startsWith('@internal/')) return true;
87
- * return false;
88
- * }
89
- * ```
90
- *
91
- * 3. Custom Package using onecxPckageFilter as defaut:
92
- * ```js
93
- * function customPackageFilter(packageName: string): boolean {
94
- * if (packageName.startsWith('@internal/')) return true;
95
- * return onecxPackageFilter(packageName);
96
- * }
97
- *
98
- * ```
99
- *
100
- */
101
- export declare function getOneCXSharedLibraryConfig(dependencies: Record<string, string>, shouldGenerateSubDeps: boolean, options?: SharedLibraryConfigOptions): Record<string, SharedLibraryConfig>;
@@ -1,268 +0,0 @@
1
- import { getOneCXSharedRecommendations } from "./get-onecx-shared-recommendations";
2
- import { createLogger } from "./logger.utils";
3
- const angularCore = '@angular/core';
4
- const logger = createLogger('getOneCXSharedLibraryConfig');
5
- /**
6
- * As we have { platform: 'browser'} in accelerator's & integration-interface project.json.
7
- * We use dynamic require (provided by Node.js) to read package.json of dependencies, which is not supported in browser environment.
8
- * Resolved lazily on first call so that merely importing this module from a browser bundle does not throw.
9
- * Only `getOneCXSharedLibraryConfig` (build-time webpack config) calls into the file system helpers below.
10
- */
11
- function getNodeRequire() {
12
- try {
13
- if (typeof process !== 'undefined' && process?.versions?.node) {
14
- return eval('require');
15
- }
16
- }
17
- catch {
18
- logger.warn(`Node require is not available.`);
19
- }
20
- return null;
21
- }
22
- /**
23
- * Blacklist of export paths to exclude when generating subpackage entries.
24
- */
25
- const EXPORTS_BLACKLIST = ['.', './package.json'];
26
- /**
27
- * Patterns for identifying dependencies that should be blacklisted.
28
- */
29
- const DEFAULT_DEPENDENCY_BLACKLIST = [
30
- /^@nx(\/.*)?$/,
31
- /^@module-federation(\/.*)?$/,
32
- /^@onecx\/build-utils(\/.*)?$/,
33
- ];
34
- /**
35
- * For identifying full package paths that should be blacklisted.
36
- */
37
- const DEFAULT_FULL_PACKAGE_BLACKLIST = [
38
- '@angular/common/locales/global/*',
39
- '@angular/common/locales/*',
40
- '@angular/common/upgrade',
41
- '@angular/core/schematics/*',
42
- '@angular/core/event-dispatch-contract.min.js',
43
- '@angular/service-worker/ngsw-worker.js',
44
- '@angular/service-worker/safety-worker.js',
45
- '@angular/service-worker/config/schema.json',
46
- '@angular/router/upgrade',
47
- '@angular/localize/tools',
48
- 'rxjs/internal/*',
49
- 'primeng/resources/',
50
- 'primeng/editor',
51
- '@onecx/angular-accelerator/testing',
52
- '@onecx/angular-accelerator/migrations.json',
53
- ];
54
- /**
55
- * Removes the './' prefix from a string, typically used for export paths in package.json files.
56
- * @param {string} str - The string from which to remove the './' prefix.
57
- * @returns {string} The string without the './' prefix.
58
- */
59
- function removeExportPrefix(str) {
60
- return str.replace('./', '');
61
- }
62
- /**
63
- * @deprecated This helper is deprecated and will be moved to `@onecx/build-utils` in v9.
64
- *
65
- * onecxPackageFilter is the default OneCX package filter.
66
- * @param {string} packageName - The full package name to check against the default blacklist.
67
- * @returns {boolean} - Returns `true` if the package is on the default blacklist, `false` otherwise.
68
- */
69
- export function onecxPackageFilter(packageName) {
70
- if (isDependencyBlacklisted(packageName)) {
71
- return true;
72
- }
73
- return DEFAULT_FULL_PACKAGE_BLACKLIST.includes(packageName);
74
- }
75
- /**
76
- * Check whether a dependency matches any blacklist entry. Supports RegExp entries and exact string matches.
77
- */
78
- function isDependencyBlacklisted(dependency) {
79
- return DEFAULT_DEPENDENCY_BLACKLIST.some((entry) => {
80
- if (entry instanceof RegExp) {
81
- return entry.test(dependency);
82
- }
83
- return entry === dependency;
84
- });
85
- }
86
- /**
87
- * Resolves and reads a dependency's package.json file.
88
- * Handles module resolution across npm/yarn/pnpm layouts.
89
- * @param {string} dependency - Package name to resolve
90
- * @returns {Object|null} Parsed package.json or null if not found
91
- */
92
- function readDependencyPackageJson(dependency) {
93
- const nodeRequire = getNodeRequire();
94
- if (!nodeRequire)
95
- return null;
96
- let packagePath;
97
- try {
98
- packagePath = nodeRequire.resolve(`${dependency}/package.json`);
99
- }
100
- catch {
101
- return null;
102
- }
103
- const fs = nodeRequire('fs');
104
- if (!fs.existsSync(packagePath)) {
105
- return null;
106
- }
107
- const packageContent = fs.readFileSync(packagePath, 'utf-8');
108
- return JSON.parse(packageContent);
109
- }
110
- /**
111
- * Generates subpackages from a dependency's export entries. Reads the dependency's package.json to find all exported subpackages
112
- * and creates fully qualified package names.
113
- * @param {string} dependency - Package name
114
- * @param {string} version - Package version
115
- * @param {function} packageFilterCallback - Optional callback to filter out specific subpackages. Should return true to exclude a package, false to include it.
116
- * @returns {Array} Array of subpackage objects with name and version
117
- */
118
- function generateSubPackageConfig(dependency, version, packageFilterCallback) {
119
- const subpackages = [];
120
- const dependencyPackage = readDependencyPackageJson(dependency);
121
- if (!dependencyPackage?.exports) {
122
- return subpackages;
123
- }
124
- const exportKeys = Object.keys(dependencyPackage.exports);
125
- for (const exportKey of exportKeys) {
126
- if (EXPORTS_BLACKLIST.includes(exportKey))
127
- continue;
128
- const subpackageName = `${dependency}/${removeExportPrefix(exportKey)}`;
129
- if (packageFilterCallback && packageFilterCallback(subpackageName))
130
- continue;
131
- subpackages.push({ name: subpackageName, requiredVersion: version });
132
- }
133
- return subpackages;
134
- }
135
- /**
136
- * Generates all shared packages (main + subpackages) for a given dependency.
137
- * Includes the main package plus all exported subpackages.
138
- * @param {Object} versionMap - Map of dependency names to versions
139
- * @param {string} dependency - Package name to generate packages for
140
- * @param {boolean} shouldGenerateSubDeps - Flag indicating whether to include subpackages based on exports
141
- * @param {function} packageFilterCallback - Optional callback to filter out specific packages. Should return true to exclude a package, false to include it.
142
- * @returns {Array} Array of all packages (main + subpackages)
143
- */
144
- function generatePackageConfig(versionMap, dependency, shouldGenerateSubDeps, packageFilterCallback = onecxPackageFilter) {
145
- if (packageFilterCallback(dependency)) {
146
- return [];
147
- }
148
- const allPackages = [];
149
- const version = versionMap[dependency];
150
- allPackages.push({ name: dependency, requiredVersion: version });
151
- if (shouldGenerateSubDeps) {
152
- const subpackages = generateSubPackageConfig(dependency, version, packageFilterCallback);
153
- allPackages.push(...subpackages);
154
- }
155
- return allPackages;
156
- }
157
- /**
158
- * @deprecated This helper is deprecated and will be moved to `@onecx/build-utils` in v9.
159
- *
160
- * Generates a shared library configuration object for all dependencies (main + subpackages if needed).
161
- * @param {Record<string, string>} dependencies - Map of dependency names to versions
162
- * @param {boolean} shouldGenerateSubDeps - Flag indicating whether to include subpackages based on exports
163
- * @param {SharedLibraryConfigOptions} options - Optional callbacks for customizing the configuration generation process. Includes:
164
- * - configCallback: A function that receives the package name and current shared configuration, returning a modified configuration.
165
- * configCallback?: (packageName: string, currentConfig: SharedLibraryConfig) => SharedLibraryConfig;
166
- * - packageFilterCallback: A function that takes a package name and returns a boolean. Return true to EXCLUDE the package, false to INCLUDE it.
167
- * packageFilterCallback?: (packageName: string) => boolean | undefined;
168
- * @returns {Record<string, SharedLibraryConfig>} A map of package names to their shared library configuration
169
- *
170
- * @example
171
- * **Recommended usage for @module-federation/enhanced:**
172
- * ```js
173
- * const sharedEntries = getOneCXSharedLibraryConfig(dependencies, true);
174
- * const config = {
175
- * name: 'onecx-test-project-ui',
176
- * filename: 'remoteEntry.js',
177
- * shared: sharedEntries,
178
- * shareScope: 'angular_21'
179
- * }
180
- * ```
181
- *
182
- * **Recommended usage for @angular-architects/module-federation:**
183
- * The share function is from @angular-architects/module-federation.
184
- * ```js
185
- * function customConfigCallback(packageName: string, currentConfig: SharedLibraryConfig): SharedLibraryConfig {
186
- * currentConfig[includeSecondaries]=true
187
- * currentConfig[requiredVersion]='auto'
188
- * return currentConfig
189
- * }
190
- *
191
- * const sharedEntries = getOneCXSharedLibraryConfig(dependencies, false, { configCallback: customConfigCallback });
192
- * const config = withModuleFederationPlugin({
193
- * name: 'onecx-<%= remoteModuleFileName %>-ui',
194
- * filename: 'remoteEntryOneCX.js',
195
- * exposes: {
196
- * './OneCX<%= remoteModuleName %>Module': './src/main.ts'
197
- * },
198
- * shared: share(sharedEntries),
199
- * });
200
- * ```
201
- * \
202
- * **With options (custom filter and config override) you can customize the behavior as follows:**
203
- * ```js
204
- * const sharedEntries = getOneCXSharedLibraryConfig(dependencies, true, {
205
- * packageFilterCallback: customPackageFilter,
206
- * configCallback: customConfigCallback,
207
- * });
208
- * ```
209
- * \
210
- * Following are some Custom Implementation:
211
- * 1. Adding Custom Config or overiding default config
212
- *```js
213
- * function customConfigCallback(packageName: string, currentConfig: SharedLibraryConfig): SharedLibraryConfig {
214
- * currentConfig[singleton]=true
215
- * return currentConfig
216
- * }
217
- * ```
218
- *
219
- * 2. Custom Package without using onecxPckageFilter
220
- * ```js
221
- * function customPackageFilter(packageName: string): boolean {
222
- * if (packageName.startsWith('@internal/')) return true;
223
- * return false;
224
- * }
225
- * ```
226
- *
227
- * 3. Custom Package using onecxPckageFilter as defaut:
228
- * ```js
229
- * function customPackageFilter(packageName: string): boolean {
230
- * if (packageName.startsWith('@internal/')) return true;
231
- * return onecxPackageFilter(packageName);
232
- * }
233
- *
234
- * ```
235
- *
236
- */
237
- export function getOneCXSharedLibraryConfig(dependencies, shouldGenerateSubDeps, options) {
238
- const allDependencies = Object.keys(dependencies).flatMap((dependency) => {
239
- return generatePackageConfig(dependencies, dependency, shouldGenerateSubDeps, options?.packageFilterCallback);
240
- });
241
- const sharedEntries = allDependencies.reduce((acc, packageEntry) => {
242
- const sharedLibConfig = {};
243
- sharedLibConfig['requiredVersion'] = packageEntry.requiredVersion;
244
- sharedLibConfig['shareScope'] = 'default';
245
- const angularCoreVersion = (dependencies[angularCore] || '').split('.')[0].replace('^', '');
246
- if (angularCoreVersion && parseInt(angularCoreVersion, 10) >= 21) {
247
- const shareScope = ('angular_').concat(angularCoreVersion);
248
- sharedLibConfig['shareScope'] = shareScope;
249
- }
250
- const onecxRecommendation = getOneCXSharedRecommendations(packageEntry.name, sharedLibConfig);
251
- if (!onecxRecommendation) {
252
- return acc;
253
- }
254
- // Apply configCallback if provided to current config overriding the recommendation
255
- const configFromCallback = options?.configCallback ? options.configCallback(packageEntry.name, onecxRecommendation) : undefined;
256
- if (configFromCallback && typeof configFromCallback === 'object') {
257
- Object.assign(onecxRecommendation, configFromCallback);
258
- }
259
- return {
260
- ...acc,
261
- [packageEntry.name]: {
262
- ...onecxRecommendation,
263
- },
264
- };
265
- }, {});
266
- return sharedEntries;
267
- }
268
- //# sourceMappingURL=get-onecx-shared-library-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-onecx-shared-library-config.js","sourceRoot":"","sources":["../../../../../../libs/accelerator/src/lib/utils/get-onecx-shared-library-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAuB,MAAM,oCAAoC,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,GAAG,eAAe,CAAC;AACpC,MAAM,MAAM,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAA;AAE1D;;;;;GAKG;AACH,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO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,CAAC"}
@@ -1,20 +0,0 @@
1
- export interface SharedLibraryConfig {
2
- singleton?: boolean;
3
- strictVersion?: boolean;
4
- eager?: boolean;
5
- requiredVersion?: string | false;
6
- version?: string;
7
- includeSecondaries?: boolean;
8
- shareScope?: string;
9
- }
10
- /**
11
- * @deprecated This helper is deprecated and will be moved to `@onecx/build-utils` in v9. Use `getOneCXSharedLibraryConfig` to generate the shared config instead.
12
- *
13
- * Provides recommendations for shared library configurations for specific OneCX-related libraries.
14
- * If the library name matches certain patterns (e.g., Angular, OneCX, RxJS, PrimeNG, ngx-translate, ngrx), it modifies the shared configuration to set singleton, strictVersion, and eager to false.
15
- * For non-matching libraries, it returns false and does not modify the configuration.
16
- * @param {string} libraryName - The name of the library being shared.
17
- * @param {SharedLibraryConfig} sharedConfig - The existing shared configuration for the library, which may be modified if recommendations are applied.
18
- * @returns {false | SharedLibraryConfig} - Returns the modified shared configuration if recommendations are applied, or false if no recommendations are applicable.
19
- */
20
- export declare function getOneCXSharedRecommendations(libraryName: string, sharedConfig: SharedLibraryConfig): false | SharedLibraryConfig;
@@ -1,31 +0,0 @@
1
- /**
2
- * Patterns for identifying shared libraries that should have specific configuration recommendations.
3
- */
4
- const sharedLibraryPatterns = [
5
- /^@angular.*$/,
6
- /^@onecx.*$/,
7
- /^rxjs.*$/,
8
- /^primeng.*$/,
9
- /^@ngx-translate.*$/,
10
- /^@ngrx.*$/,
11
- ];
12
- /**
13
- * @deprecated This helper is deprecated and will be moved to `@onecx/build-utils` in v9. Use `getOneCXSharedLibraryConfig` to generate the shared config instead.
14
- *
15
- * Provides recommendations for shared library configurations for specific OneCX-related libraries.
16
- * If the library name matches certain patterns (e.g., Angular, OneCX, RxJS, PrimeNG, ngx-translate, ngrx), it modifies the shared configuration to set singleton, strictVersion, and eager to false.
17
- * For non-matching libraries, it returns false and does not modify the configuration.
18
- * @param {string} libraryName - The name of the library being shared.
19
- * @param {SharedLibraryConfig} sharedConfig - The existing shared configuration for the library, which may be modified if recommendations are applied.
20
- * @returns {false | SharedLibraryConfig} - Returns the modified shared configuration if recommendations are applied, or false if no recommendations are applicable.
21
- */
22
- export function getOneCXSharedRecommendations(libraryName, sharedConfig) {
23
- if (!sharedLibraryPatterns.some((pattern) => pattern.test(libraryName))) {
24
- return false;
25
- }
26
- sharedConfig.singleton = false;
27
- sharedConfig.strictVersion = false;
28
- sharedConfig.eager = false;
29
- return sharedConfig;
30
- }
31
- //# sourceMappingURL=get-onecx-shared-recommendations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-onecx-shared-recommendations.js","sourceRoot":"","sources":["../../../../../../libs/accelerator/src/lib/utils/get-onecx-shared-recommendations.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,qBAAqB,GAAa;IACtC,cAAc;IACd,YAAY;IACZ,UAAU;IACV,aAAa;IACb,oBAAoB;IACpB,WAAW;CACZ,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,WAAmB,EACnB,YAAiC;IAEjC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACxE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,YAAY,CAAC,SAAS,GAAG,KAAK,CAAA;IAC9B,YAAY,CAAC,aAAa,GAAG,KAAK,CAAA;IAClC,YAAY,CAAC,KAAK,GAAG,KAAK,CAAA;IAC1B,OAAO,YAAY,CAAA;AACrB,CAAC"}