@common-stack/rollup-vite-utils 7.2.1-alpha.16 → 7.2.1-alpha.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.
@@ -22,6 +22,7 @@
22
22
  "build": "npm run build:clean && npm run build:lib",
23
23
  "build:clean": "rimraf lib",
24
24
  "build:lib": "rollup -c rollup.config.mjs",
25
+ "build:fix": "node ./scripts/fix-generated-types.js",
25
26
  "build:lib:watch": "npm run build:lib -- -w",
26
27
  "watch": "npm run build:lib:watch"
27
28
  },
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-build script to fix malformed generated TypeScript definitions
5
+ * Fixes issues where JSDoc comments are incorrectly inserted into type definitions
6
+ */
7
+
8
+ import { readFileSync, writeFileSync } from 'fs';
9
+ import { fileURLToPath } from 'url';
10
+ import { dirname, join } from 'path';
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = dirname(__filename);
14
+
15
+ const generatedFilePath = join(__dirname, '../lib/generated/generated.d.ts');
16
+
17
+ try {
18
+ console.log('Fixing generated type definitions...');
19
+
20
+ let content = readFileSync(generatedFilePath, 'utf8');
21
+
22
+ // Fix the specific issue where JSDoc comments are inserted in the middle of type definitions
23
+ // Pattern: SchemaTypes.Scalars["URI"] /**...*/ ["input"]
24
+ // Should be: SchemaTypes.Scalars["URI"]["input"]
25
+ const jsdocInTypeRegex = /SchemaTypes\.Scalars\["URI"\]\s*\/\*\*[\s\S]*?\*\/\s*\["input"\]/g;
26
+
27
+ content = content.replace(jsdocInTypeRegex, 'SchemaTypes.Scalars["URI"]["input"]');
28
+
29
+ // Write the fixed content back
30
+ writeFileSync(generatedFilePath, content, 'utf8');
31
+
32
+ console.log('✓ Successfully fixed generated type definitions');
33
+ } catch (error) {
34
+ console.error('Error fixing generated types:', error.message);
35
+ process.exit(1);
36
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './generated/generated-models';
2
+ export * from './generated/service-schemas';
2
3
  export * from './configuration';
3
4
  export * from './permissions';
4
5
  export * from './apollo-context';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/rollup-vite-utils",
3
- "version": "7.2.1-alpha.16",
3
+ "version": "7.2.1-alpha.18",
4
4
  "description": "Client Module for react app",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -58,7 +58,7 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "90bb4fb4a62dbdb67dae77af1c3e6655aeac6305",
61
+ "gitHead": "df98b17f2792bb0920073df7b6d5c5af0eb4d16a",
62
62
  "typescript": {
63
63
  "definition": "lib/index.d.ts"
64
64
  }