nitrostack 1.0.5 → 1.0.6

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 CHANGED
@@ -8,6 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [1.0.6] - 2025-10-27
12
+
13
+ ### Fixed
14
+ - **Critical**: Added explicit webpack rule for Studio TypeScript compilation
15
+ - Created dedicated webpack rule with `next-swc-loader` for `lib/` and `components/` directories
16
+ - Uses `include` directive to explicitly process TypeScript files in these directories
17
+ - Resolves "Module parse failed: Unexpected token" by ensuring proper TypeScript compilation
18
+ - Works correctly when Studio is installed from npm in `node_modules`
19
+
20
+ ### Technical Details
21
+ - Previous approach of modifying `exclude` patterns wasn't working consistently
22
+ - New approach: explicitly `push` a new webpack rule that includes our directories
23
+ - Uses Next.js's internal `next-swc-loader` with proper configuration for both client and server builds
24
+
11
25
  ## [1.0.5] - 2025-10-27
12
26
 
13
27
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitrostack",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "NitroStack - Build powerful MCP servers with TypeScript",
5
5
  "type": "module",
6
6
  "main": "dist/core/index.js",
@@ -16,37 +16,33 @@ const nextConfig = {
16
16
  eslint: {
17
17
  ignoreDuringBuilds: true,
18
18
  },
19
- webpack: (config) => {
19
+ webpack: (config, { 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 TypeScript files are processed correctly
27
- // Remove exclude patterns that might block our lib/components from being processed
28
- config.module.rules.forEach((rule) => {
29
- if (rule.test && rule.test.toString().includes('tsx')) {
30
- // Remove node_modules exclude or modify it to allow our files
31
- if (rule.exclude) {
32
- const originalExclude = rule.exclude;
33
- rule.exclude = (modulePath) => {
34
- // Allow our lib and components directories
35
- if (modulePath.includes(path.join(__dirname, 'lib')) ||
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
+ // This is needed when Studio is running from node_modules
28
+ const libPath = path.join(__dirname, 'lib');
29
+ const componentsPath = path.join(__dirname, 'components');
30
+
31
+ // Add a new rule specifically for our TypeScript files
32
+ config.module.rules.push({
33
+ test: /\.(ts|tsx)$/,
34
+ include: [libPath, componentsPath],
35
+ use: [
36
+ {
37
+ loader: 'next-swc-loader',
38
+ options: {
39
+ isServer,
40
+ pagesDir: path.join(__dirname, 'app'),
41
+ appDir: path.join(__dirname, 'app'),
42
+ hasReactRefresh: !isServer,
43
+ },
44
+ },
45
+ ],
50
46
  });
51
47
 
52
48
  return config;