@ciderjs/gasnuki 0.3.5 → 0.3.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/README.ja.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @ciderjs/gasnuki
2
2
 
3
3
  [![README-en](https://img.shields.io/badge/English-blue?logo=ReadMe)](./README.md)
4
- [![Test Coverage](https://img.shields.io/badge/test%20coverage-95.4%25-brightgreen)](https://github.com/luthpg/gasnuki)
4
+ [![Test Coverage](https://img.shields.io/badge/test%20coverage-93.77%25-brightgreen)](https://github.com/luthpg/gasnuki)
5
5
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
  [![npm version](https://img.shields.io/npm/v/@ciderjs/gasnuki.svg)](https://www.npmjs.com/package/@ciderjs/gasnuki)
7
7
  [![GitHub issues](https://img.shields.io/github/issues/luthpg/gasnuki.svg)](https://github.com/luthpg/gasnuki/issues)
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @ciderjs/gasnuki
2
2
 
3
3
  [![README-ja](https://img.shields.io/badge/日本語-blue?logo=ReadMe)](./README.ja.md)
4
- [![Test Coverage](https://img.shields.io/badge/test%20coverage-95.4%25-brightgreen)](https://github.com/luthpg/gasnuki)
4
+ [![Test Coverage](https://img.shields.io/badge/test%20coverage-93.77%25-brightgreen)](https://github.com/luthpg/gasnuki)
5
5
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
  [![npm version](https://img.shields.io/npm/v/@ciderjs/gasnuki.svg)](https://www.npmjs.com/package/@ciderjs/gasnuki)
7
7
  [![GitHub issues](https://img.shields.io/github/issues/luthpg/gasnuki.svg)](https://github.com/luthpg/gasnuki/issues)
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.Cam3UO_N.cjs');
7
+ const config = require('./shared/gasnuki.CooUv3Bz.cjs');
8
8
  require('chokidar');
9
9
  require('consola');
10
10
  require('node:fs');
@@ -25,7 +25,7 @@ function _interopNamespaceCompat(e) {
25
25
 
26
26
  const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
27
27
 
28
- const version = "0.3.5";
28
+ const version = "0.3.7";
29
29
 
30
30
  const parseArgs = async (command) => {
31
31
  const cliOpts = command.opts();
package/dist/cli.mjs CHANGED
@@ -2,14 +2,14 @@
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.HyFJZts6.mjs';
5
+ import { l as loadConfig } from './shared/gasnuki.Md02V2Fd.mjs';
6
6
  import 'chokidar';
7
7
  import 'consola';
8
8
  import 'node:fs';
9
9
  import 'ts-morph';
10
10
  import 'jiti';
11
11
 
12
- const version = "0.3.5";
12
+ const version = "0.3.7";
13
13
 
14
14
  const parseArgs = async (command) => {
15
15
  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.Cam3UO_N.cjs');
6
+ const config = require('./shared/gasnuki.CooUv3Bz.cjs');
7
7
  require('node:fs');
8
8
  require('ts-morph');
9
9
  require('jiti');
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.HyFJZts6.mjs';
5
- export { d as defineConfig } from './shared/gasnuki.HyFJZts6.mjs';
4
+ import { g as generateAppsScriptTypes } from './shared/gasnuki.Md02V2Fd.mjs';
5
+ export { d as defineConfig } from './shared/gasnuki.Md02V2Fd.mjs';
6
6
  import 'node:fs';
7
7
  import 'ts-morph';
8
8
  import 'jiti';
@@ -58,7 +58,15 @@ const getInterfaceMethodDefinition_ = (name, node) => {
58
58
  `;
59
59
  }
60
60
  }
61
- return `${jsDocString}${name}${typeParamsString}(${parameters}): ${returnType};`;
61
+ const cleanType = (t) => t.replace(/import\(.*?\)\./g, "");
62
+ const cleanedReturnType = cleanType(returnType);
63
+ const cleanedParameters = parameters.replace(
64
+ /:\s*([^,;)]+)/g,
65
+ (_match, p1) => {
66
+ return `: ${cleanType(p1)}`;
67
+ }
68
+ );
69
+ return `${jsDocString}${name}${typeParamsString}(${cleanedParameters}): ${cleanedReturnType};`;
62
70
  };
63
71
  const SIMPLE_TRIGGER_FUNCTION_NAMES = [
64
72
  "onOpen",
@@ -161,32 +169,55 @@ const generateAppsScriptTypes = async ({
161
169
  if (foundSymbols.has(aliasSymbol)) {
162
170
  return;
163
171
  }
164
- foundSymbols.add(aliasSymbol);
165
- for (const typeArg of type.getAliasTypeArguments()) {
166
- collectSymbolsFromType(typeArg, foundSymbols);
172
+ const declarations = aliasSymbol.getDeclarations();
173
+ if (declarations.length > 0) {
174
+ const sourceFilePath = declarations[0].getSourceFile().getFilePath();
175
+ const isExternal = sourceFilePath.includes("node_modules") || !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(path__namespace.join(projectPath, srcDir).replace(/\\/g, "/"));
176
+ if (isExternal) {
177
+ foundSymbols.add(aliasSymbol);
178
+ for (const typeArg of type.getAliasTypeArguments()) {
179
+ collectSymbolsFromType(typeArg, foundSymbols);
180
+ }
181
+ return;
182
+ }
167
183
  }
168
184
  }
169
185
  const symbol = type.getSymbol();
170
- if (symbol && !foundSymbols.has(symbol)) {
171
- foundSymbols.add(symbol);
172
- if (type.isObject()) {
173
- for (const prop of type.getProperties()) {
174
- const propDecl = prop.getDeclarations()[0];
175
- if (propDecl) {
176
- const compilerNode = propDecl.compilerNode;
177
- if (
178
- // @ts-expect-error - avoiding full type checks for perf, checking kind directly
179
- compilerNode.name && // @ts-expect-error - avoiding full type checks for perf, checking kind directly
180
- compilerNode.name.kind === tsMorph.SyntaxKind.ComputedPropertyName
181
- ) {
182
- const expression = propDecl.getNameNode().getExpression();
183
- const symbol2 = expression.getSymbol();
184
- if (symbol2 && !foundSymbols.has(symbol2)) {
185
- foundSymbols.add(symbol2);
186
- }
186
+ let shouldTraverseProperties = true;
187
+ if (symbol) {
188
+ if (foundSymbols.has(symbol)) {
189
+ shouldTraverseProperties = false;
190
+ } else {
191
+ foundSymbols.add(symbol);
192
+ const declarations = symbol.getDeclarations();
193
+ if (declarations.length > 0) {
194
+ const sourceFilePath = declarations[0].getSourceFile().getFilePath();
195
+ const isExternal = sourceFilePath.includes("node_modules") || !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(
196
+ path__namespace.join(projectPath, srcDir).replace(/\\/g, "/")
197
+ );
198
+ if (isExternal) {
199
+ shouldTraverseProperties = false;
200
+ }
201
+ }
202
+ }
203
+ }
204
+ if (shouldTraverseProperties && type.isObject()) {
205
+ for (const prop of type.getProperties()) {
206
+ const propDecl = prop.getDeclarations()[0];
207
+ if (propDecl) {
208
+ const compilerNode = propDecl.compilerNode;
209
+ if (
210
+ // @ts-expect-error - avoiding full type checks for perf, checking kind directly
211
+ compilerNode.name && // @ts-expect-error - avoiding full type checks for perf, checking kind directly
212
+ compilerNode.name.kind === tsMorph.SyntaxKind.ComputedPropertyName
213
+ ) {
214
+ const expression = propDecl.getNameNode().getExpression();
215
+ const symbol2 = expression.getSymbol();
216
+ if (symbol2 && !foundSymbols.has(symbol2)) {
217
+ foundSymbols.add(symbol2);
187
218
  }
188
- collectSymbolsFromType(propDecl.getType(), foundSymbols);
189
219
  }
220
+ collectSymbolsFromType(propDecl.getType(), foundSymbols);
190
221
  }
191
222
  }
192
223
  }
@@ -240,16 +271,35 @@ const generateAppsScriptTypes = async ({
240
271
  if (!declaration) {
241
272
  continue;
242
273
  }
243
- if (declaration.getKind() === tsMorph.SyntaxKind.MethodSignature || declaration.getKind() === tsMorph.SyntaxKind.PropertySignature || declaration.getKind() === tsMorph.SyntaxKind.MethodDeclaration || declaration.getKind() === tsMorph.SyntaxKind.PropertyDeclaration) {
244
- continue;
274
+ const allowedKinds = [
275
+ tsMorph.SyntaxKind.InterfaceDeclaration,
276
+ tsMorph.SyntaxKind.TypeAliasDeclaration,
277
+ tsMorph.SyntaxKind.EnumDeclaration,
278
+ tsMorph.SyntaxKind.ClassDeclaration,
279
+ tsMorph.SyntaxKind.ModuleDeclaration
280
+ ];
281
+ if (!allowedKinds.includes(declaration.getKind())) {
282
+ if (declaration.getKind() === tsMorph.SyntaxKind.VariableDeclaration) {
283
+ const typeNode = declaration.getTypeNode();
284
+ const isUniqueSymbol = typeNode?.getText().includes("unique symbol");
285
+ if (!isUniqueSymbol) {
286
+ continue;
287
+ }
288
+ } else {
289
+ continue;
290
+ }
245
291
  }
246
292
  const sourceFile = declaration.getSourceFile();
247
293
  const sourceFilePath = sourceFile.getFilePath();
248
294
  if (/[/\\]typescript[/\\]lib[/\\]/.test(sourceFilePath)) {
249
295
  continue;
250
296
  }
251
- if (sourceFilePath.includes("node_modules")) {
252
- if (functionSignatureSymbols.has(symbol)) {
297
+ const isExternal = sourceFilePath.includes("node_modules") || !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(path__namespace.join(projectPath, srcDir).replace(/\\/g, "/"));
298
+ if (isExternal) {
299
+ if (sourceFilePath.includes("node_modules")) {
300
+ if (!functionSignatureSymbols.has(symbol)) {
301
+ continue;
302
+ }
253
303
  const packageName = getPackageNameFromNodeModulesPath_(sourceFilePath);
254
304
  if (packageName) {
255
305
  processedSymbols.add(symbolName);
@@ -258,37 +308,34 @@ const generateAppsScriptTypes = async ({
258
308
  }
259
309
  importsMap.get(packageName)?.add(symbolName);
260
310
  }
311
+ } else {
312
+ let modulePath = path__namespace.relative(absoluteOutDir, sourceFilePath).replace(/\\/g, "/");
313
+ modulePath = modulePath.replace(/\.(d\.)?ts$/, "");
314
+ if (modulePath.endsWith("/index")) {
315
+ modulePath = modulePath.slice(0, -6);
316
+ }
317
+ if (modulePath === "index" || modulePath === "") {
318
+ modulePath = ".";
319
+ }
320
+ if (!modulePath.startsWith(".")) {
321
+ modulePath = `./${modulePath}`;
322
+ }
323
+ if (!importsMap.has(modulePath)) {
324
+ importsMap.set(modulePath, /* @__PURE__ */ new Set());
325
+ }
326
+ importsMap.get(modulePath)?.add(symbolName);
261
327
  }
262
328
  continue;
263
329
  }
264
330
  processedSymbols.add(symbolName);
265
- const isExternal = !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(path__namespace.join(projectPath, srcDir).replace(/\\/g, "/"));
266
- if (isExternal) {
267
- let modulePath = path__namespace.relative(absoluteOutDir, sourceFilePath).replace(/\\/g, "/");
268
- modulePath = modulePath.replace(/\.(d\.)?ts$/, "");
269
- if (modulePath.endsWith("/index")) {
270
- modulePath = modulePath.slice(0, -6);
271
- }
272
- if (modulePath === "index" || modulePath === "") {
273
- modulePath = ".";
274
- }
275
- if (!modulePath.startsWith(".")) {
276
- modulePath = `./${modulePath}`;
277
- }
278
- if (!importsMap.has(modulePath)) {
279
- importsMap.set(modulePath, /* @__PURE__ */ new Set());
280
- }
281
- importsMap.get(modulePath)?.add(symbolName);
282
- } else {
283
- let declText = declaration.getText();
284
- if (declaration.getKind() === tsMorph.SyntaxKind.VariableDeclaration) {
285
- const variableStatement = declaration.getParent()?.getParent();
286
- if (variableStatement && variableStatement.getKind() === tsMorph.SyntaxKind.VariableStatement) {
287
- declText = variableStatement.getText();
288
- }
331
+ let declText = declaration.getText();
332
+ if (declaration.getKind() === tsMorph.SyntaxKind.VariableDeclaration) {
333
+ const variableStatement = declaration.getParent()?.getParent();
334
+ if (variableStatement && variableStatement.getKind() === tsMorph.SyntaxKind.VariableStatement) {
335
+ declText = variableStatement.getText();
289
336
  }
290
- inlineDefinitions.set(symbolName, declText);
291
337
  }
338
+ inlineDefinitions.set(symbolName, declText);
292
339
  for (const descendant of declaration.getDescendantsOfKind(
293
340
  tsMorph.SyntaxKind.TypeReference
294
341
  )) {
@@ -41,7 +41,15 @@ const getInterfaceMethodDefinition_ = (name, node) => {
41
41
  `;
42
42
  }
43
43
  }
44
- return `${jsDocString}${name}${typeParamsString}(${parameters}): ${returnType};`;
44
+ const cleanType = (t) => t.replace(/import\(.*?\)\./g, "");
45
+ const cleanedReturnType = cleanType(returnType);
46
+ const cleanedParameters = parameters.replace(
47
+ /:\s*([^,;)]+)/g,
48
+ (_match, p1) => {
49
+ return `: ${cleanType(p1)}`;
50
+ }
51
+ );
52
+ return `${jsDocString}${name}${typeParamsString}(${cleanedParameters}): ${cleanedReturnType};`;
45
53
  };
46
54
  const SIMPLE_TRIGGER_FUNCTION_NAMES = [
47
55
  "onOpen",
@@ -144,32 +152,55 @@ const generateAppsScriptTypes = async ({
144
152
  if (foundSymbols.has(aliasSymbol)) {
145
153
  return;
146
154
  }
147
- foundSymbols.add(aliasSymbol);
148
- for (const typeArg of type.getAliasTypeArguments()) {
149
- collectSymbolsFromType(typeArg, foundSymbols);
155
+ const declarations = aliasSymbol.getDeclarations();
156
+ if (declarations.length > 0) {
157
+ const sourceFilePath = declarations[0].getSourceFile().getFilePath();
158
+ const isExternal = sourceFilePath.includes("node_modules") || !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(path.join(projectPath, srcDir).replace(/\\/g, "/"));
159
+ if (isExternal) {
160
+ foundSymbols.add(aliasSymbol);
161
+ for (const typeArg of type.getAliasTypeArguments()) {
162
+ collectSymbolsFromType(typeArg, foundSymbols);
163
+ }
164
+ return;
165
+ }
150
166
  }
151
167
  }
152
168
  const symbol = type.getSymbol();
153
- if (symbol && !foundSymbols.has(symbol)) {
154
- foundSymbols.add(symbol);
155
- if (type.isObject()) {
156
- for (const prop of type.getProperties()) {
157
- const propDecl = prop.getDeclarations()[0];
158
- if (propDecl) {
159
- const compilerNode = propDecl.compilerNode;
160
- if (
161
- // @ts-expect-error - avoiding full type checks for perf, checking kind directly
162
- compilerNode.name && // @ts-expect-error - avoiding full type checks for perf, checking kind directly
163
- compilerNode.name.kind === SyntaxKind.ComputedPropertyName
164
- ) {
165
- const expression = propDecl.getNameNode().getExpression();
166
- const symbol2 = expression.getSymbol();
167
- if (symbol2 && !foundSymbols.has(symbol2)) {
168
- foundSymbols.add(symbol2);
169
- }
169
+ let shouldTraverseProperties = true;
170
+ if (symbol) {
171
+ if (foundSymbols.has(symbol)) {
172
+ shouldTraverseProperties = false;
173
+ } else {
174
+ foundSymbols.add(symbol);
175
+ const declarations = symbol.getDeclarations();
176
+ if (declarations.length > 0) {
177
+ const sourceFilePath = declarations[0].getSourceFile().getFilePath();
178
+ const isExternal = sourceFilePath.includes("node_modules") || !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(
179
+ path.join(projectPath, srcDir).replace(/\\/g, "/")
180
+ );
181
+ if (isExternal) {
182
+ shouldTraverseProperties = false;
183
+ }
184
+ }
185
+ }
186
+ }
187
+ if (shouldTraverseProperties && type.isObject()) {
188
+ for (const prop of type.getProperties()) {
189
+ const propDecl = prop.getDeclarations()[0];
190
+ if (propDecl) {
191
+ const compilerNode = propDecl.compilerNode;
192
+ if (
193
+ // @ts-expect-error - avoiding full type checks for perf, checking kind directly
194
+ compilerNode.name && // @ts-expect-error - avoiding full type checks for perf, checking kind directly
195
+ compilerNode.name.kind === SyntaxKind.ComputedPropertyName
196
+ ) {
197
+ const expression = propDecl.getNameNode().getExpression();
198
+ const symbol2 = expression.getSymbol();
199
+ if (symbol2 && !foundSymbols.has(symbol2)) {
200
+ foundSymbols.add(symbol2);
170
201
  }
171
- collectSymbolsFromType(propDecl.getType(), foundSymbols);
172
202
  }
203
+ collectSymbolsFromType(propDecl.getType(), foundSymbols);
173
204
  }
174
205
  }
175
206
  }
@@ -223,16 +254,35 @@ const generateAppsScriptTypes = async ({
223
254
  if (!declaration) {
224
255
  continue;
225
256
  }
226
- if (declaration.getKind() === SyntaxKind.MethodSignature || declaration.getKind() === SyntaxKind.PropertySignature || declaration.getKind() === SyntaxKind.MethodDeclaration || declaration.getKind() === SyntaxKind.PropertyDeclaration) {
227
- continue;
257
+ const allowedKinds = [
258
+ SyntaxKind.InterfaceDeclaration,
259
+ SyntaxKind.TypeAliasDeclaration,
260
+ SyntaxKind.EnumDeclaration,
261
+ SyntaxKind.ClassDeclaration,
262
+ SyntaxKind.ModuleDeclaration
263
+ ];
264
+ if (!allowedKinds.includes(declaration.getKind())) {
265
+ if (declaration.getKind() === SyntaxKind.VariableDeclaration) {
266
+ const typeNode = declaration.getTypeNode();
267
+ const isUniqueSymbol = typeNode?.getText().includes("unique symbol");
268
+ if (!isUniqueSymbol) {
269
+ continue;
270
+ }
271
+ } else {
272
+ continue;
273
+ }
228
274
  }
229
275
  const sourceFile = declaration.getSourceFile();
230
276
  const sourceFilePath = sourceFile.getFilePath();
231
277
  if (/[/\\]typescript[/\\]lib[/\\]/.test(sourceFilePath)) {
232
278
  continue;
233
279
  }
234
- if (sourceFilePath.includes("node_modules")) {
235
- if (functionSignatureSymbols.has(symbol)) {
280
+ const isExternal = sourceFilePath.includes("node_modules") || !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(path.join(projectPath, srcDir).replace(/\\/g, "/"));
281
+ if (isExternal) {
282
+ if (sourceFilePath.includes("node_modules")) {
283
+ if (!functionSignatureSymbols.has(symbol)) {
284
+ continue;
285
+ }
236
286
  const packageName = getPackageNameFromNodeModulesPath_(sourceFilePath);
237
287
  if (packageName) {
238
288
  processedSymbols.add(symbolName);
@@ -241,37 +291,34 @@ const generateAppsScriptTypes = async ({
241
291
  }
242
292
  importsMap.get(packageName)?.add(symbolName);
243
293
  }
294
+ } else {
295
+ let modulePath = path.relative(absoluteOutDir, sourceFilePath).replace(/\\/g, "/");
296
+ modulePath = modulePath.replace(/\.(d\.)?ts$/, "");
297
+ if (modulePath.endsWith("/index")) {
298
+ modulePath = modulePath.slice(0, -6);
299
+ }
300
+ if (modulePath === "index" || modulePath === "") {
301
+ modulePath = ".";
302
+ }
303
+ if (!modulePath.startsWith(".")) {
304
+ modulePath = `./${modulePath}`;
305
+ }
306
+ if (!importsMap.has(modulePath)) {
307
+ importsMap.set(modulePath, /* @__PURE__ */ new Set());
308
+ }
309
+ importsMap.get(modulePath)?.add(symbolName);
244
310
  }
245
311
  continue;
246
312
  }
247
313
  processedSymbols.add(symbolName);
248
- const isExternal = !sourceFilePath.replace(/\\/g, "/").startsWith(absoluteSrcDir.replace(/\\/g, "/")) && !sourceFilePath.replace(/\\/g, "/").startsWith(path.join(projectPath, srcDir).replace(/\\/g, "/"));
249
- if (isExternal) {
250
- let modulePath = path.relative(absoluteOutDir, sourceFilePath).replace(/\\/g, "/");
251
- modulePath = modulePath.replace(/\.(d\.)?ts$/, "");
252
- if (modulePath.endsWith("/index")) {
253
- modulePath = modulePath.slice(0, -6);
254
- }
255
- if (modulePath === "index" || modulePath === "") {
256
- modulePath = ".";
257
- }
258
- if (!modulePath.startsWith(".")) {
259
- modulePath = `./${modulePath}`;
260
- }
261
- if (!importsMap.has(modulePath)) {
262
- importsMap.set(modulePath, /* @__PURE__ */ new Set());
263
- }
264
- importsMap.get(modulePath)?.add(symbolName);
265
- } else {
266
- let declText = declaration.getText();
267
- if (declaration.getKind() === SyntaxKind.VariableDeclaration) {
268
- const variableStatement = declaration.getParent()?.getParent();
269
- if (variableStatement && variableStatement.getKind() === SyntaxKind.VariableStatement) {
270
- declText = variableStatement.getText();
271
- }
314
+ let declText = declaration.getText();
315
+ if (declaration.getKind() === SyntaxKind.VariableDeclaration) {
316
+ const variableStatement = declaration.getParent()?.getParent();
317
+ if (variableStatement && variableStatement.getKind() === SyntaxKind.VariableStatement) {
318
+ declText = variableStatement.getText();
272
319
  }
273
- inlineDefinitions.set(symbolName, declText);
274
320
  }
321
+ inlineDefinitions.set(symbolName, declText);
275
322
  for (const descendant of declaration.getDescendantsOfKind(
276
323
  SyntaxKind.TypeReference
277
324
  )) {
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.Cam3UO_N.cjs');
5
+ const config = require('./shared/gasnuki.CooUv3Bz.cjs');
6
6
  require('node:fs');
7
7
  require('ts-morph');
8
8
  require('jiti');
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.HyFJZts6.mjs';
3
+ import { l as loadConfig, g as generateAppsScriptTypes } from './shared/gasnuki.Md02V2Fd.mjs';
4
4
  import 'node:fs';
5
5
  import 'ts-morph';
6
6
  import 'jiti';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciderjs/gasnuki",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Type definitions and utilities for Google Apps Script client-side API",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",