Skip to content

Commit 8abab8c

Browse files
Merge branch 'origin/pr8-unified-api' into pr9-implementation
Resolved merge conflicts: - .github/workflows/devtools.yml: kept --skip-nx-cache flag for CI consistency - packages/enhanced/src/lib/sharing/SharePlugin.ts: resolved validation logic conflicts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
2 parents 973d73f + 154516f commit 8abab8c

File tree

5 files changed

+19
-31
lines changed

5 files changed

+19
-31
lines changed

.github/workflows/build-and-test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ jobs:
5858
- name: Print Number of CPU Cores
5959
run: nproc
6060

61-
- name: Build SDK with skip cache to ensure workspace deps available
62-
run: npx nx build sdk --skip-nx-cache
63-
6461
- name: Run Build for All
6562
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
6663

.github/workflows/devtools.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ jobs:
5252
- name: Install Cypress
5353
run: npx cypress install
5454

55-
- name: Install Cypress
56-
run: npx cypress install
57-
58-
- name: Warm Nx Cache
59-
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=1
60-
6155
- name: Run Affected Build
6256
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=1 --skip-nx-cache
6357

packages/enhanced/src/lib/sharing/SharePlugin.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,8 @@ class SharePlugin {
3737
constructor(options: SharePluginOptions) {
3838
validate(options);
3939

40-
// Store options for debugging and introspection
4140
this._options = options;
4241

43-
// Validate shared configuration
44-
if (
45-
!options.shared ||
46-
(typeof options.shared === 'object' &&
47-
Object.keys(options.shared).length === 0)
48-
) {
49-
throw new Error(
50-
'SharePlugin requires at least one shared module configuration',
51-
);
52-
}
5342
const sharedOptions: [string, SharedConfig][] = parseOptions(
5443
options.shared,
5544
(item, key) => {
@@ -119,6 +108,13 @@ class SharePlugin {
119108
},
120109
}));
121110

111+
// Validate that at least one shared module is configured
112+
if (sharedOptions.length === 0) {
113+
throw new Error(
114+
'SharePlugin requires at least one shared module configuration',
115+
);
116+
}
117+
122118
this._shareScope = options.shareScope || 'default';
123119
this._consumes = consumes;
124120
this._provides = provides;

packages/enhanced/test/unit/sharing/SharePlugin.improved.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,15 @@ describe('SharePlugin Real Behavior', () => {
287287
});
288288

289289
describe('edge cases and error handling', () => {
290-
it('should handle empty shared configuration', () => {
291-
const plugin = new SharePlugin({
292-
shareScope: 'default',
293-
shared: {},
294-
});
295-
296-
const compiler = createRealWebpackCompiler();
297-
expect(() => plugin.apply(compiler)).not.toThrow();
290+
it('should throw error for empty shared configuration', () => {
291+
expect(() => {
292+
new SharePlugin({
293+
shareScope: 'default',
294+
shared: {},
295+
});
296+
}).toThrow(
297+
'SharePlugin requires at least one shared module configuration',
298+
);
298299
});
299300

300301
it('should handle missing shareScope with default fallback', () => {

packages/modernjs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
"./shared-strategy": {
5353
"types": "./dist/types/cli/mfRuntimePlugins/shared-strategy.d.ts",
5454
"import": "./dist/esm/cli/mfRuntimePlugins/shared-strategy.js",
55-
"require": "./dist/esm/cli/mfRuntimePlugins/shared-strategy.js"
55+
"require": "./dist/cjs/cli/mfRuntimePlugins/shared-strategy.js"
5656
},
5757
"./resolve-entry-ipv4": {
5858
"types": "./dist/types/cli/mfRuntimePlugins/resolve-entry-ipv4.d.ts",
5959
"import": "./dist/esm/cli/mfRuntimePlugins/resolve-entry-ipv4.js",
60-
"require": "./dist/esm/cli/mfRuntimePlugins/resolve-entry-ipv4.js"
60+
"require": "./dist/cjs/cli/mfRuntimePlugins/resolve-entry-ipv4.js"
6161
},
6262
"./inject-node-fetch": {
6363
"types": "./dist/types/cli/mfRuntimePlugins/inject-node-fetch.d.ts",
6464
"import": "./dist/esm/cli/mfRuntimePlugins/inject-node-fetch.js",
65-
"require": "./dist/esm/cli/mfRuntimePlugins/inject-node-fetch.js"
65+
"require": "./dist/cjs/cli/mfRuntimePlugins/inject-node-fetch.js"
6666
},
6767
"./data-fetch-server-plugin": {
6868
"types": "./dist/types/cli/server/data-fetch-server-plugin.d.ts",

0 commit comments

Comments
 (0)