@shellui/cli 0.0.17 → 0.0.18

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shellui/cli",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "ShellUI CLI - Command-line tool for ShellUI",
5
5
  "main": "src/cli.js",
6
6
  "type": "module",
@@ -30,7 +30,7 @@
30
30
  "tsx": "^4.21.0",
31
31
  "vite": "7.3.1",
32
32
  "workbox-build": "^7.1.0",
33
- "@shellui/core": "0.0.17"
33
+ "@shellui/core": "0.0.18"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
@@ -90,6 +90,10 @@ export async function buildCommand(root = '.') {
90
90
  // Dedupe React and core package to prevent duplicate module instances
91
91
  // This is critical for React Context to work correctly in micro-frontends
92
92
  dedupe: ['react', 'react-dom', '@shellui/core'],
93
+ // Ensure consistent module resolution to prevent duplicate instances
94
+ // when the same module is imported via different paths (relative, alias, with/without extensions)
95
+ conditions: ['import', 'module', 'browser', 'default'],
96
+ preserveSymlinks: false,
93
97
  },
94
98
  css: {
95
99
  postcss: postcssConfig,
@@ -47,6 +47,11 @@ async function startServer(root, cwd, shouldOpen = false) {
47
47
  // This is critical for React Context to work correctly in micro-frontends
48
48
  // When React is a peer dependency, dedupe ensures Vite uses a single instance
49
49
  dedupe: ['react', 'react-dom', '@shellui/core'],
50
+ // Ensure consistent module resolution to prevent duplicate instances
51
+ // when the same module is imported via different paths (relative, alias, with/without extensions)
52
+ conditions: ['import', 'module', 'browser', 'default'],
53
+ // Don't preserve symlinks - ensures consistent resolution in monorepos
54
+ preserveSymlinks: false,
50
55
  },
51
56
  css: {
52
57
  postcss: createPostCSSConfig(),
@@ -37,6 +37,9 @@ export function serviceWorkerDevPlugin(corePackagePath, coreSrcPath) {
37
37
  alias: createResolveAlias(),
38
38
  // Dedupe React and core package to prevent duplicate module instances
39
39
  dedupe: ['react', 'react-dom', '@shellui/core'],
40
+ // Ensure consistent module resolution to prevent duplicate instances
41
+ conditions: ['import', 'module', 'browser', 'default'],
42
+ preserveSymlinks: false,
40
43
  },
41
44
  build: {
42
45
  write: false,
package/src/utils/vite.js CHANGED
@@ -38,14 +38,19 @@ export function getCoreSrcPath() {
38
38
  * Always sets '@' to core/src. Sets '@shellui/sdk' to source entry when in
39
39
  * workspace mode; omits the alias when installed from npm so Vite resolves
40
40
  * through the package's exports field (dist/index.js).
41
+ *
42
+ * Also adds specific aliases for config module to ensure all imports
43
+ * (relative, alias, or with extensions) resolve to the same module instance.
44
+ * This prevents React Context duplication issues.
41
45
  * @returns {Object} Vite resolve.alias object
42
46
  */
43
47
  export function createResolveAlias() {
44
48
  const corePackagePath = resolvePackagePath('@shellui/core');
49
+ const coreSrcPath = path.join(corePackagePath, 'src');
45
50
  const sdkEntry = resolveSdkEntry();
46
51
 
47
52
  const alias = {
48
- '@': path.join(corePackagePath, 'src'),
53
+ '@': coreSrcPath,
49
54
  };
50
55
 
51
56
  if (sdkEntry) {