nitrostack 1.0.5 → 1.0.7
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/CHANGELOG.md +27 -0
- package/package.json +1 -1
- package/src/studio/next.config.js +11 -25
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.0.7] - 2025-10-27
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- **Critical**: Fixed webpack loader configuration error for Studio
|
|
15
|
+
- Switched from manual `next-swc-loader` configuration to Next.js's `defaultLoaders.babel`
|
|
16
|
+
- Resolves "TypeError [ERR_INVALID_ARG_TYPE]: The 'from' argument must be of type string" error
|
|
17
|
+
- Uses Next.js's pre-configured loader with all correct options
|
|
18
|
+
|
|
19
|
+
### Technical Details
|
|
20
|
+
- Previous manual loader configuration was passing incorrect options to `next-swc-loader`
|
|
21
|
+
- New approach: use `defaultLoaders.babel` provided by Next.js webpack context
|
|
22
|
+
- This ensures all TypeScript/JSX files in `lib/` and `components/` are processed with the correct Babel/SWC configuration
|
|
23
|
+
|
|
24
|
+
## [1.0.6] - 2025-10-27
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- **Critical**: Added explicit webpack rule for Studio TypeScript compilation
|
|
28
|
+
- Created dedicated webpack rule with `next-swc-loader` for `lib/` and `components/` directories
|
|
29
|
+
- Uses `include` directive to explicitly process TypeScript files in these directories
|
|
30
|
+
- Resolves "Module parse failed: Unexpected token" by ensuring proper TypeScript compilation
|
|
31
|
+
- Works correctly when Studio is installed from npm in `node_modules`
|
|
32
|
+
|
|
33
|
+
### Technical Details
|
|
34
|
+
- Previous approach of modifying `exclude` patterns wasn't working consistently
|
|
35
|
+
- New approach: explicitly `push` a new webpack rule that includes our directories
|
|
36
|
+
- Uses Next.js's internal `next-swc-loader` with proper configuration for both client and server builds
|
|
37
|
+
|
|
11
38
|
## [1.0.5] - 2025-10-27
|
|
12
39
|
|
|
13
40
|
### Fixed
|
package/package.json
CHANGED
|
@@ -16,37 +16,23 @@ const nextConfig = {
|
|
|
16
16
|
eslint: {
|
|
17
17
|
ignoreDuringBuilds: true,
|
|
18
18
|
},
|
|
19
|
-
webpack: (config) => {
|
|
19
|
+
webpack: (config, { defaultLoaders, isServer }) => {
|
|
20
20
|
// Explicitly configure webpack to resolve @ alias
|
|
21
21
|
config.resolve.alias = {
|
|
22
22
|
...config.resolve.alias,
|
|
23
23
|
'@': __dirname,
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
// Ensure
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
modulePath.includes(path.join(__dirname, 'components'))) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
// Apply original exclude logic
|
|
40
|
-
if (typeof originalExclude === 'function') {
|
|
41
|
-
return originalExclude(modulePath);
|
|
42
|
-
}
|
|
43
|
-
if (originalExclude instanceof RegExp) {
|
|
44
|
-
return originalExclude.test(modulePath);
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
26
|
+
// Ensure our lib and components directories are included in compilation
|
|
27
|
+
// Use Next.js's default TypeScript loader
|
|
28
|
+
const libPath = path.resolve(__dirname, 'lib');
|
|
29
|
+
const componentsPath = path.resolve(__dirname, 'components');
|
|
30
|
+
|
|
31
|
+
// Add a rule for our TypeScript files using Next.js's default loader
|
|
32
|
+
config.module.rules.push({
|
|
33
|
+
test: /\.(ts|tsx)$/,
|
|
34
|
+
include: [libPath, componentsPath],
|
|
35
|
+
use: defaultLoaders.babel,
|
|
50
36
|
});
|
|
51
37
|
|
|
52
38
|
return config;
|