@ciderjs/gasnuki 0.5.4 → 0.5.5
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/.agent/skills/commit-msg/SKILL.md +30 -0
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/index.cjs +11 -4
- package/dist/index.mjs +12 -5
- package/dist/shared/{gasnuki.Ee5cF3d4.mjs → gasnuki.36-kDBNB.mjs} +58 -24
- package/dist/shared/{gasnuki.D2FZdJSt.cjs → gasnuki.BXbhblFz.cjs} +58 -24
- package/dist/vite.cjs +4 -4
- package/dist/vite.mjs +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commit-msg
|
|
3
|
+
description: Analyzes staged files, generates an appropriate commit message, and executes the commit.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commit Message Skill
|
|
7
|
+
|
|
8
|
+
Generate a commit message for staged files and execute the commit.
|
|
9
|
+
|
|
10
|
+
## Commit Procedure
|
|
11
|
+
|
|
12
|
+
1. Read staged file differences using `git diff --staged`.
|
|
13
|
+
2. Check the current branch using `git branch -a`.
|
|
14
|
+
- If on `main` branch or if the branch name does not reflect the staged changes, create and switch to a new branch:
|
|
15
|
+
|
|
16
|
+
```powershell
|
|
17
|
+
git branch <new-branch-name>
|
|
18
|
+
git checkout <new-branch-name>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. Review the last 3 commit messages using `git log -n 3` to understand the project's commit style.
|
|
22
|
+
4. Generate a commit message based on:
|
|
23
|
+
- The staged changes
|
|
24
|
+
- The observed commit message style
|
|
25
|
+
5. Execute the commit using `git commit` in a Windows 11 PowerShell environment.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
- Only commit staged files. Do not include unstaged changes.
|
|
30
|
+
- Execute each git command separately. Do not chain commands.
|
package/README.ja.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @ciderjs/gasnuki
|
|
2
2
|
|
|
3
3
|
[](./README.md)
|
|
4
|
-
[](https://github.com/luthpg/gasnuki)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://www.npmjs.com/package/@ciderjs/gasnuki)
|
|
7
7
|
[](https://www.npmjs.com/package/@ciderjs/gasnuki)
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @ciderjs/gasnuki
|
|
2
2
|
|
|
3
3
|
[](./README.ja.md)
|
|
4
|
-
[](https://github.com/luthpg/gasnuki)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://www.npmjs.com/package/@ciderjs/gasnuki)
|
|
7
7
|
[](https://www.npmjs.com/package/@ciderjs/gasnuki)
|
package/dist/cli.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
const path = require('node:path');
|
|
5
5
|
const commander = require('commander');
|
|
6
6
|
const index = require('./index.cjs');
|
|
7
|
-
const config = require('./shared/gasnuki.
|
|
7
|
+
const config = require('./shared/gasnuki.BXbhblFz.cjs');
|
|
8
8
|
require('chokidar');
|
|
9
9
|
require('consola');
|
|
10
10
|
require('node:crypto');
|
|
@@ -26,7 +26,7 @@ function _interopNamespaceCompat(e) {
|
|
|
26
26
|
|
|
27
27
|
const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
|
|
28
28
|
|
|
29
|
-
const version = "0.5.
|
|
29
|
+
const version = "0.5.5";
|
|
30
30
|
|
|
31
31
|
const parseArgs = async (command) => {
|
|
32
32
|
const cliOpts = command.opts();
|
package/dist/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
import { generateTypes } from './index.mjs';
|
|
5
|
-
import { l as loadConfig } from './shared/gasnuki.
|
|
5
|
+
import { l as loadConfig } from './shared/gasnuki.36-kDBNB.mjs';
|
|
6
6
|
import 'chokidar';
|
|
7
7
|
import 'consola';
|
|
8
8
|
import 'node:crypto';
|
|
@@ -10,7 +10,7 @@ import 'node:fs';
|
|
|
10
10
|
import 'ts-morph';
|
|
11
11
|
import 'jiti';
|
|
12
12
|
|
|
13
|
-
const version = "0.5.
|
|
13
|
+
const version = "0.5.5";
|
|
14
14
|
|
|
15
15
|
const parseArgs = async (command) => {
|
|
16
16
|
const cliOpts = command.opts();
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const path = require('node:path');
|
|
4
4
|
const chokidar = require('chokidar');
|
|
5
5
|
const consola = require('consola');
|
|
6
|
-
const config = require('./shared/gasnuki.
|
|
6
|
+
const config = require('./shared/gasnuki.BXbhblFz.cjs');
|
|
7
7
|
require('node:crypto');
|
|
8
8
|
require('node:fs');
|
|
9
9
|
require('ts-morph');
|
|
@@ -37,16 +37,23 @@ const generateTypes = async ({
|
|
|
37
37
|
}
|
|
38
38
|
const runGeneration = async (triggeredBy) => {
|
|
39
39
|
const reason = triggeredBy ? ` (${triggeredBy})` : "";
|
|
40
|
-
|
|
40
|
+
if (!watch) {
|
|
41
|
+
consola.consola.info(`Generating AppsScript types${reason}...`);
|
|
42
|
+
}
|
|
41
43
|
try {
|
|
42
44
|
await config.generateAppsScriptTypes({
|
|
43
45
|
project,
|
|
44
46
|
srcDir,
|
|
45
47
|
outDir,
|
|
46
48
|
outputFile,
|
|
47
|
-
cache
|
|
49
|
+
cache,
|
|
50
|
+
quiet: watch
|
|
48
51
|
});
|
|
49
|
-
|
|
52
|
+
if (watch) {
|
|
53
|
+
consola.consola.success(`Generated AppsScript types${reason}.`);
|
|
54
|
+
} else {
|
|
55
|
+
consola.consola.info("Type generation complete.");
|
|
56
|
+
}
|
|
50
57
|
} catch (e) {
|
|
51
58
|
consola.consola.error(`Type generation failed: ${e.message}`, e);
|
|
52
59
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
2
|
import * as chokidar from 'chokidar';
|
|
3
3
|
import { consola } from 'consola';
|
|
4
|
-
import { g as generateAppsScriptTypes } from './shared/gasnuki.
|
|
5
|
-
export { d as defineConfig } from './shared/gasnuki.
|
|
4
|
+
import { g as generateAppsScriptTypes } from './shared/gasnuki.36-kDBNB.mjs';
|
|
5
|
+
export { d as defineConfig } from './shared/gasnuki.36-kDBNB.mjs';
|
|
6
6
|
import 'node:crypto';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'ts-morph';
|
|
@@ -21,16 +21,23 @@ const generateTypes = async ({
|
|
|
21
21
|
}
|
|
22
22
|
const runGeneration = async (triggeredBy) => {
|
|
23
23
|
const reason = triggeredBy ? ` (${triggeredBy})` : "";
|
|
24
|
-
|
|
24
|
+
if (!watch) {
|
|
25
|
+
consola.info(`Generating AppsScript types${reason}...`);
|
|
26
|
+
}
|
|
25
27
|
try {
|
|
26
28
|
await generateAppsScriptTypes({
|
|
27
29
|
project,
|
|
28
30
|
srcDir,
|
|
29
31
|
outDir,
|
|
30
32
|
outputFile,
|
|
31
|
-
cache
|
|
33
|
+
cache,
|
|
34
|
+
quiet: watch
|
|
32
35
|
});
|
|
33
|
-
|
|
36
|
+
if (watch) {
|
|
37
|
+
consola.success(`Generated AppsScript types${reason}.`);
|
|
38
|
+
} else {
|
|
39
|
+
consola.info("Type generation complete.");
|
|
40
|
+
}
|
|
34
41
|
} catch (e) {
|
|
35
42
|
consola.error(`Type generation failed: ${e.message}`, e);
|
|
36
43
|
}
|
|
@@ -19,21 +19,48 @@ const computeSourceHash = (sourceFiles) => {
|
|
|
19
19
|
}
|
|
20
20
|
return hash.digest("hex");
|
|
21
21
|
};
|
|
22
|
+
const cleanType = (t) => t.replace(/import\(".*?"\)\.default\./g, "").replace(/import\(".*?"\)\./g, "");
|
|
23
|
+
const simplifyType = (type, node) => {
|
|
24
|
+
const aliasSymbol = type.getAliasSymbol();
|
|
25
|
+
if (aliasSymbol && ["Pick", "Omit"].includes(aliasSymbol.getName())) {
|
|
26
|
+
const props = type.getProperties();
|
|
27
|
+
const members = props.map((prop) => {
|
|
28
|
+
const name = prop.getName();
|
|
29
|
+
const declarations = prop.getDeclarations();
|
|
30
|
+
let propType = prop.getTypeAtLocation(node);
|
|
31
|
+
if ((!propType || propType.getText() === "any") && declarations.length > 0) {
|
|
32
|
+
propType = declarations[0].getType();
|
|
33
|
+
}
|
|
34
|
+
const typeText = cleanType(propType.getText(node));
|
|
35
|
+
const isOptional = prop.hasFlags(SymbolFlags.Optional);
|
|
36
|
+
return `${name}${isOptional ? "?" : ""}: ${typeText}`;
|
|
37
|
+
});
|
|
38
|
+
return `{ ${members.join("; ")} }`;
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
22
42
|
const getInterfaceMethodDefinition_ = (name, node) => {
|
|
23
43
|
const typeParameters = node.getTypeParameters?.() ?? [];
|
|
24
44
|
const typeParamsString = typeParameters.length > 0 ? `<${typeParameters.map((tp) => tp.getText()).join(", ")}>` : "";
|
|
25
45
|
const parameters = node.getParameters().map((param) => {
|
|
26
46
|
const paramName = param.getName();
|
|
27
|
-
|
|
47
|
+
let type = param.getTypeNode()?.getText() ?? param.getType().getText(node) ?? "any";
|
|
48
|
+
const simplified = simplifyType(param.getType(), node);
|
|
49
|
+
if (simplified) {
|
|
50
|
+
type = simplified;
|
|
51
|
+
}
|
|
28
52
|
const questionToken = param.hasQuestionToken() ? "?" : "";
|
|
29
53
|
return `${paramName}${questionToken}: ${type}`;
|
|
30
54
|
}).join(", ");
|
|
31
55
|
const returnTypeNode = node.getReturnTypeNode();
|
|
32
56
|
let returnType;
|
|
33
|
-
|
|
57
|
+
const inferredReturnType = node.getReturnType();
|
|
58
|
+
const simplifiedReturn = simplifyType(inferredReturnType, node);
|
|
59
|
+
if (simplifiedReturn) {
|
|
60
|
+
returnType = simplifiedReturn;
|
|
61
|
+
} else if (returnTypeNode != null) {
|
|
34
62
|
returnType = returnTypeNode.getText();
|
|
35
63
|
} else {
|
|
36
|
-
const inferredReturnType = node.getReturnType();
|
|
37
64
|
if (inferredReturnType.isVoid()) {
|
|
38
65
|
returnType = "void";
|
|
39
66
|
} else {
|
|
@@ -54,7 +81,6 @@ const getInterfaceMethodDefinition_ = (name, node) => {
|
|
|
54
81
|
`;
|
|
55
82
|
}
|
|
56
83
|
}
|
|
57
|
-
const cleanType = (t) => t.replace(/import\(".*?"\)\.default\./g, "").replace(/import\(".*?"\)\./g, "");
|
|
58
84
|
const cleanedReturnType = cleanType(returnType);
|
|
59
85
|
const cleanedParameters = parameters.replace(
|
|
60
86
|
/:\s*([^,;)]+)/g,
|
|
@@ -141,12 +167,7 @@ const resolveNodeModuleSpecifier_ = (filePath) => {
|
|
|
141
167
|
if (matchesExportValue_(exportValue, relativePath)) {
|
|
142
168
|
if (key === ".") return packageName;
|
|
143
169
|
const subPath = key.startsWith("./") ? key.slice(2) : key;
|
|
144
|
-
console.log(`[gasnuki] Matched key: ${key}, subPath: ${subPath}`);
|
|
145
170
|
return `${packageName}/${subPath}`;
|
|
146
|
-
} else {
|
|
147
|
-
console.log(
|
|
148
|
-
`[gasnuki] No match for ${key}: ${JSON.stringify(exportValue)} vs ${relativePath} (pkgRoot: ${packageRoot}, file: ${filePath})`
|
|
149
|
-
);
|
|
150
171
|
}
|
|
151
172
|
}
|
|
152
173
|
}
|
|
@@ -168,15 +189,18 @@ const generateAppsScriptTypes = async ({
|
|
|
168
189
|
outDir,
|
|
169
190
|
outputFile,
|
|
170
191
|
projectInstance,
|
|
171
|
-
cache = true
|
|
192
|
+
cache = true,
|
|
172
193
|
// Default to true
|
|
194
|
+
quiet
|
|
173
195
|
}) => {
|
|
174
196
|
const absoluteSrcDir = path.resolve(projectPath, srcDir);
|
|
175
197
|
const absoluteOutDir = path.resolve(projectPath, outDir);
|
|
176
198
|
const absoluteOutputFile = path.resolve(absoluteOutDir, outputFile);
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
199
|
+
if (!quiet) {
|
|
200
|
+
consola.info("Starting AppsScript type generation with gasnuki...");
|
|
201
|
+
consola.info(` AppsScript Source Directory: ${absoluteSrcDir}`);
|
|
202
|
+
consola.info(` Output File: ${absoluteOutputFile}`);
|
|
203
|
+
}
|
|
180
204
|
let tsConfigFilePath = path.resolve(projectPath, "tsconfig.json");
|
|
181
205
|
if (fs.existsSync(path.resolve(projectPath, "tsconfig.app.json"))) {
|
|
182
206
|
tsConfigFilePath = path.resolve(projectPath, "tsconfig.app.json");
|
|
@@ -189,14 +213,18 @@ const generateAppsScriptTypes = async ({
|
|
|
189
213
|
const testFilesPattern = `!${path.join(absoluteSrcDir, "**/*.{test,spec}.ts").replace(/\\/g, "/")}`;
|
|
190
214
|
project.addSourceFilesAtPaths([sourceFilesPattern, testFilesPattern]);
|
|
191
215
|
const sourceFiles = project.getSourceFiles();
|
|
192
|
-
|
|
216
|
+
if (!quiet) {
|
|
217
|
+
consola.info(`Found ${sourceFiles.length} source file(s).`);
|
|
218
|
+
}
|
|
193
219
|
if (cache) {
|
|
194
220
|
const currentHash = computeSourceHash(sourceFiles);
|
|
195
221
|
const cacheKey = absoluteOutputFile;
|
|
196
222
|
if (generationCache.get(cacheKey) === currentHash && fs.existsSync(absoluteOutputFile)) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
223
|
+
if (!quiet) {
|
|
224
|
+
consola.success(
|
|
225
|
+
`Skipping generation: Source files have not changed (Hash: ${currentHash.slice(0, 8)}).`
|
|
226
|
+
);
|
|
227
|
+
}
|
|
200
228
|
return;
|
|
201
229
|
}
|
|
202
230
|
}
|
|
@@ -536,7 +564,9 @@ const generateAppsScriptTypes = async ({
|
|
|
536
564
|
}
|
|
537
565
|
if (!fs.existsSync(absoluteOutDir)) {
|
|
538
566
|
fs.mkdirSync(absoluteOutDir, { recursive: true });
|
|
539
|
-
|
|
567
|
+
if (!quiet) {
|
|
568
|
+
consola.info(`Created output directory: ${absoluteOutDir}`);
|
|
569
|
+
}
|
|
540
570
|
}
|
|
541
571
|
const generatorName = "gasnuki";
|
|
542
572
|
let outputContent = `// Auto-generated by ${generatorName}
|
|
@@ -565,14 +595,18 @@ const generateAppsScriptTypes = async ({
|
|
|
565
595
|
${formattedMethods}
|
|
566
596
|
}
|
|
567
597
|
`;
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
598
|
+
if (!quiet) {
|
|
599
|
+
consola.info(
|
|
600
|
+
`Interface 'ServerScript' type definitions written to ${absoluteOutputFile} (${methodDefinitions.length} function(s), ${exportedTypeDefinitions.length + inlineDefinitions.size} type(s)).`
|
|
601
|
+
);
|
|
602
|
+
}
|
|
571
603
|
} else {
|
|
572
604
|
bodyContent += "export type ServerScripts = {}\n";
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
605
|
+
if (!quiet) {
|
|
606
|
+
consola.info(
|
|
607
|
+
`Interface 'ServerScript' type definitions written to ${absoluteOutputFile} (no functions found).`
|
|
608
|
+
);
|
|
609
|
+
}
|
|
576
610
|
}
|
|
577
611
|
bodyContent += `
|
|
578
612
|
// Auto-generated Types for GoogleAppsScript in client-side code
|
|
@@ -37,21 +37,48 @@ const computeSourceHash = (sourceFiles) => {
|
|
|
37
37
|
}
|
|
38
38
|
return hash.digest("hex");
|
|
39
39
|
};
|
|
40
|
+
const cleanType = (t) => t.replace(/import\(".*?"\)\.default\./g, "").replace(/import\(".*?"\)\./g, "");
|
|
41
|
+
const simplifyType = (type, node) => {
|
|
42
|
+
const aliasSymbol = type.getAliasSymbol();
|
|
43
|
+
if (aliasSymbol && ["Pick", "Omit"].includes(aliasSymbol.getName())) {
|
|
44
|
+
const props = type.getProperties();
|
|
45
|
+
const members = props.map((prop) => {
|
|
46
|
+
const name = prop.getName();
|
|
47
|
+
const declarations = prop.getDeclarations();
|
|
48
|
+
let propType = prop.getTypeAtLocation(node);
|
|
49
|
+
if ((!propType || propType.getText() === "any") && declarations.length > 0) {
|
|
50
|
+
propType = declarations[0].getType();
|
|
51
|
+
}
|
|
52
|
+
const typeText = cleanType(propType.getText(node));
|
|
53
|
+
const isOptional = prop.hasFlags(tsMorph.SymbolFlags.Optional);
|
|
54
|
+
return `${name}${isOptional ? "?" : ""}: ${typeText}`;
|
|
55
|
+
});
|
|
56
|
+
return `{ ${members.join("; ")} }`;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
40
60
|
const getInterfaceMethodDefinition_ = (name, node) => {
|
|
41
61
|
const typeParameters = node.getTypeParameters?.() ?? [];
|
|
42
62
|
const typeParamsString = typeParameters.length > 0 ? `<${typeParameters.map((tp) => tp.getText()).join(", ")}>` : "";
|
|
43
63
|
const parameters = node.getParameters().map((param) => {
|
|
44
64
|
const paramName = param.getName();
|
|
45
|
-
|
|
65
|
+
let type = param.getTypeNode()?.getText() ?? param.getType().getText(node) ?? "any";
|
|
66
|
+
const simplified = simplifyType(param.getType(), node);
|
|
67
|
+
if (simplified) {
|
|
68
|
+
type = simplified;
|
|
69
|
+
}
|
|
46
70
|
const questionToken = param.hasQuestionToken() ? "?" : "";
|
|
47
71
|
return `${paramName}${questionToken}: ${type}`;
|
|
48
72
|
}).join(", ");
|
|
49
73
|
const returnTypeNode = node.getReturnTypeNode();
|
|
50
74
|
let returnType;
|
|
51
|
-
|
|
75
|
+
const inferredReturnType = node.getReturnType();
|
|
76
|
+
const simplifiedReturn = simplifyType(inferredReturnType, node);
|
|
77
|
+
if (simplifiedReturn) {
|
|
78
|
+
returnType = simplifiedReturn;
|
|
79
|
+
} else if (returnTypeNode != null) {
|
|
52
80
|
returnType = returnTypeNode.getText();
|
|
53
81
|
} else {
|
|
54
|
-
const inferredReturnType = node.getReturnType();
|
|
55
82
|
if (inferredReturnType.isVoid()) {
|
|
56
83
|
returnType = "void";
|
|
57
84
|
} else {
|
|
@@ -72,7 +99,6 @@ const getInterfaceMethodDefinition_ = (name, node) => {
|
|
|
72
99
|
`;
|
|
73
100
|
}
|
|
74
101
|
}
|
|
75
|
-
const cleanType = (t) => t.replace(/import\(".*?"\)\.default\./g, "").replace(/import\(".*?"\)\./g, "");
|
|
76
102
|
const cleanedReturnType = cleanType(returnType);
|
|
77
103
|
const cleanedParameters = parameters.replace(
|
|
78
104
|
/:\s*([^,;)]+)/g,
|
|
@@ -159,12 +185,7 @@ const resolveNodeModuleSpecifier_ = (filePath) => {
|
|
|
159
185
|
if (matchesExportValue_(exportValue, relativePath)) {
|
|
160
186
|
if (key === ".") return packageName;
|
|
161
187
|
const subPath = key.startsWith("./") ? key.slice(2) : key;
|
|
162
|
-
console.log(`[gasnuki] Matched key: ${key}, subPath: ${subPath}`);
|
|
163
188
|
return `${packageName}/${subPath}`;
|
|
164
|
-
} else {
|
|
165
|
-
console.log(
|
|
166
|
-
`[gasnuki] No match for ${key}: ${JSON.stringify(exportValue)} vs ${relativePath} (pkgRoot: ${packageRoot}, file: ${filePath})`
|
|
167
|
-
);
|
|
168
189
|
}
|
|
169
190
|
}
|
|
170
191
|
}
|
|
@@ -186,15 +207,18 @@ const generateAppsScriptTypes = async ({
|
|
|
186
207
|
outDir,
|
|
187
208
|
outputFile,
|
|
188
209
|
projectInstance,
|
|
189
|
-
cache = true
|
|
210
|
+
cache = true,
|
|
190
211
|
// Default to true
|
|
212
|
+
quiet
|
|
191
213
|
}) => {
|
|
192
214
|
const absoluteSrcDir = path__namespace.resolve(projectPath, srcDir);
|
|
193
215
|
const absoluteOutDir = path__namespace.resolve(projectPath, outDir);
|
|
194
216
|
const absoluteOutputFile = path__namespace.resolve(absoluteOutDir, outputFile);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
217
|
+
if (!quiet) {
|
|
218
|
+
consola.consola.info("Starting AppsScript type generation with gasnuki...");
|
|
219
|
+
consola.consola.info(` AppsScript Source Directory: ${absoluteSrcDir}`);
|
|
220
|
+
consola.consola.info(` Output File: ${absoluteOutputFile}`);
|
|
221
|
+
}
|
|
198
222
|
let tsConfigFilePath = path__namespace.resolve(projectPath, "tsconfig.json");
|
|
199
223
|
if (fs__namespace.existsSync(path__namespace.resolve(projectPath, "tsconfig.app.json"))) {
|
|
200
224
|
tsConfigFilePath = path__namespace.resolve(projectPath, "tsconfig.app.json");
|
|
@@ -207,14 +231,18 @@ const generateAppsScriptTypes = async ({
|
|
|
207
231
|
const testFilesPattern = `!${path__namespace.join(absoluteSrcDir, "**/*.{test,spec}.ts").replace(/\\/g, "/")}`;
|
|
208
232
|
project.addSourceFilesAtPaths([sourceFilesPattern, testFilesPattern]);
|
|
209
233
|
const sourceFiles = project.getSourceFiles();
|
|
210
|
-
|
|
234
|
+
if (!quiet) {
|
|
235
|
+
consola.consola.info(`Found ${sourceFiles.length} source file(s).`);
|
|
236
|
+
}
|
|
211
237
|
if (cache) {
|
|
212
238
|
const currentHash = computeSourceHash(sourceFiles);
|
|
213
239
|
const cacheKey = absoluteOutputFile;
|
|
214
240
|
if (generationCache.get(cacheKey) === currentHash && fs__namespace.existsSync(absoluteOutputFile)) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
241
|
+
if (!quiet) {
|
|
242
|
+
consola.consola.success(
|
|
243
|
+
`Skipping generation: Source files have not changed (Hash: ${currentHash.slice(0, 8)}).`
|
|
244
|
+
);
|
|
245
|
+
}
|
|
218
246
|
return;
|
|
219
247
|
}
|
|
220
248
|
}
|
|
@@ -554,7 +582,9 @@ const generateAppsScriptTypes = async ({
|
|
|
554
582
|
}
|
|
555
583
|
if (!fs__namespace.existsSync(absoluteOutDir)) {
|
|
556
584
|
fs__namespace.mkdirSync(absoluteOutDir, { recursive: true });
|
|
557
|
-
|
|
585
|
+
if (!quiet) {
|
|
586
|
+
consola.consola.info(`Created output directory: ${absoluteOutDir}`);
|
|
587
|
+
}
|
|
558
588
|
}
|
|
559
589
|
const generatorName = "gasnuki";
|
|
560
590
|
let outputContent = `// Auto-generated by ${generatorName}
|
|
@@ -583,14 +613,18 @@ const generateAppsScriptTypes = async ({
|
|
|
583
613
|
${formattedMethods}
|
|
584
614
|
}
|
|
585
615
|
`;
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
616
|
+
if (!quiet) {
|
|
617
|
+
consola.consola.info(
|
|
618
|
+
`Interface 'ServerScript' type definitions written to ${absoluteOutputFile} (${methodDefinitions.length} function(s), ${exportedTypeDefinitions.length + inlineDefinitions.size} type(s)).`
|
|
619
|
+
);
|
|
620
|
+
}
|
|
589
621
|
} else {
|
|
590
622
|
bodyContent += "export type ServerScripts = {}\n";
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
623
|
+
if (!quiet) {
|
|
624
|
+
consola.consola.info(
|
|
625
|
+
`Interface 'ServerScript' type definitions written to ${absoluteOutputFile} (no functions found).`
|
|
626
|
+
);
|
|
627
|
+
}
|
|
594
628
|
}
|
|
595
629
|
bodyContent += `
|
|
596
630
|
// Auto-generated Types for GoogleAppsScript in client-side code
|
package/dist/vite.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const path = require('node:path');
|
|
4
4
|
const consola = require('consola');
|
|
5
|
-
const config = require('./shared/gasnuki.
|
|
5
|
+
const config = require('./shared/gasnuki.BXbhblFz.cjs');
|
|
6
6
|
require('node:crypto');
|
|
7
7
|
require('node:fs');
|
|
8
8
|
require('ts-morph');
|
|
@@ -36,13 +36,13 @@ function gasnuki(options) {
|
|
|
36
36
|
debounce(async () => {
|
|
37
37
|
const reason = triggeredBy ? ` (triggered by: ${triggeredBy})` : "";
|
|
38
38
|
console.log("");
|
|
39
|
-
consola.consola.info(`[gasnuki] Generating AppsScript types${reason}...`);
|
|
40
39
|
try {
|
|
41
40
|
await config.generateAppsScriptTypes({
|
|
42
41
|
...gasnukiOptions,
|
|
43
|
-
project: projectRoot
|
|
42
|
+
project: projectRoot,
|
|
43
|
+
quiet: true
|
|
44
44
|
});
|
|
45
|
-
consola.consola.success(
|
|
45
|
+
consola.consola.success(`[gasnuki] Generated AppsScript types${reason}.`);
|
|
46
46
|
} catch (e) {
|
|
47
47
|
consola.consola.error(
|
|
48
48
|
`[gasnuki] Type generation failed: ${e.message}`
|
package/dist/vite.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
2
|
import { consola } from 'consola';
|
|
3
|
-
import { l as loadConfig, g as generateAppsScriptTypes } from './shared/gasnuki.
|
|
3
|
+
import { l as loadConfig, g as generateAppsScriptTypes } from './shared/gasnuki.36-kDBNB.mjs';
|
|
4
4
|
import 'node:crypto';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'ts-morph';
|
|
@@ -20,13 +20,13 @@ function gasnuki(options) {
|
|
|
20
20
|
debounce(async () => {
|
|
21
21
|
const reason = triggeredBy ? ` (triggered by: ${triggeredBy})` : "";
|
|
22
22
|
console.log("");
|
|
23
|
-
consola.info(`[gasnuki] Generating AppsScript types${reason}...`);
|
|
24
23
|
try {
|
|
25
24
|
await generateAppsScriptTypes({
|
|
26
25
|
...gasnukiOptions,
|
|
27
|
-
project: projectRoot
|
|
26
|
+
project: projectRoot,
|
|
27
|
+
quiet: true
|
|
28
28
|
});
|
|
29
|
-
consola.success(
|
|
29
|
+
consola.success(`[gasnuki] Generated AppsScript types${reason}.`);
|
|
30
30
|
} catch (e) {
|
|
31
31
|
consola.error(
|
|
32
32
|
`[gasnuki] Type generation failed: ${e.message}`
|