@ciderjs/gasnuki 0.3.1 → 0.3.2

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,6 +1,6 @@
1
1
  # gasnuki
2
2
 
3
- [![Test Coverage](https://img.shields.io/badge/test%20coverage-90.91%25-brightgreen)](https://github.com/luthpg/gasnuki)
3
+ [![Test Coverage](https://img.shields.io/badge/test%20coverage-95.1%25-brightgreen)](https://github.com/luthpg/gasnuki)
4
4
  [![License](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
5
5
  [![npm version](https://img.shields.io/npm/v/@ciderjs/gasnuki.svg)](https://www.npmjs.com/package/@ciderjs/gasnuki)
6
6
  [![GitHub issues](https://img.shields.io/github/issues/luthpg/gasnuki.svg)](https://github.com/luthpg/gasnuki/issues)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ciderjs/gasnuki
2
2
 
3
- [![Test Coverage](https://img.shields.io/badge/test%20coverage-90.91%25-brightgreen)](https://github.com/luthpg/gasnuki)
3
+ [![Test Coverage](https://img.shields.io/badge/test%20coverage-95.1%25-brightgreen)](https://github.com/luthpg/gasnuki)
4
4
  [![License](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
5
5
  [![npm version](https://img.shields.io/npm/v/@ciderjs/gasnuki.svg)](https://www.npmjs.com/package/@ciderjs/gasnuki)
6
6
  [![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.Cbwq1CES.cjs');
7
+ const config = require('./shared/gasnuki.BziruiRW.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.1";
28
+ const version = "0.3.2";
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.Bcijv2Ub.mjs';
5
+ import { l as loadConfig } from './shared/gasnuki.CS6ipBfD.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.1";
12
+ const version = "0.3.2";
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.Cbwq1CES.cjs');
6
+ const config = require('./shared/gasnuki.BziruiRW.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.Bcijv2Ub.mjs';
5
- export { d as defineConfig } from './shared/gasnuki.Bcijv2Ub.mjs';
4
+ import { g as generateAppsScriptTypes } from './shared/gasnuki.CS6ipBfD.mjs';
5
+ export { d as defineConfig } from './shared/gasnuki.CS6ipBfD.mjs';
6
6
  import 'node:fs';
7
7
  import 'ts-morph';
8
8
  import 'jiti';
@@ -92,7 +92,6 @@ const generateAppsScriptTypes = async ({
92
92
  const methodDefinitions = [];
93
93
  const exportedDeclarations = [];
94
94
  const exportedDeclarationNames = /* @__PURE__ */ new Set();
95
- const exportedFunctions = [];
96
95
  for (const sourceFile of sourceFiles) {
97
96
  const filePath = sourceFile.getFilePath().replace(/\\/g, "/");
98
97
  const srcPath = absoluteSrcDir.replace(/\\/g, "/");
@@ -118,7 +117,6 @@ const generateAppsScriptTypes = async ({
118
117
  exportedDeclarations.push(func);
119
118
  exportedDeclarationNames.add(name);
120
119
  methodDefinitions.push(getInterfaceMethodDefinition_(name, func));
121
- exportedFunctions.push(func);
122
120
  }
123
121
  }
124
122
  for (const varStmt of sourceFile.getVariableStatements()) {
@@ -130,7 +128,6 @@ const generateAppsScriptTypes = async ({
130
128
  exportedDeclarations.push(varDecl);
131
129
  exportedDeclarationNames.add(name);
132
130
  methodDefinitions.push(getInterfaceMethodDefinition_(name, funcExpr));
133
- exportedFunctions.push(funcExpr);
134
131
  }
135
132
  }
136
133
  }
@@ -162,38 +159,18 @@ const generateAppsScriptTypes = async ({
162
159
  }
163
160
  }
164
161
  };
165
- const returnValueSymbols = /* @__PURE__ */ new Set();
166
- for (const func of exportedFunctions) {
167
- collectSymbolsFromType(func.getReturnType(), returnValueSymbols);
168
- }
169
162
  const symbolsToProcess = /* @__PURE__ */ new Set();
170
163
  for (const decl of exportedDeclarations) {
171
164
  if (decl.getKind() === tsMorph.SyntaxKind.FunctionDeclaration || decl.getKind() === tsMorph.SyntaxKind.VariableDeclaration && (decl.getInitializer()?.getKind() === tsMorph.SyntaxKind.ArrowFunction || decl.getInitializer()?.getKind() === tsMorph.SyntaxKind.FunctionExpression)) {
172
165
  const func = decl.getKind() === tsMorph.SyntaxKind.FunctionDeclaration ? decl : decl.getInitializer();
173
166
  const parameters = func.getParameters();
174
167
  for (const param of parameters) {
175
- const typeRefs = param.getDescendantsOfKind(tsMorph.SyntaxKind.TypeReference);
176
- for (const typeRef of typeRefs) {
177
- const symbol = typeRef.getType().getAliasSymbol() ?? typeRef.getType().getSymbol();
178
- if (symbol) symbolsToProcess.add(symbol);
179
- }
180
- }
181
- const returnTypeNode = func.getReturnTypeNode();
182
- if (returnTypeNode) {
183
- const typeRefs = returnTypeNode.getDescendantsOfKind(
184
- tsMorph.SyntaxKind.TypeReference
185
- );
186
- for (const typeRef of typeRefs) {
187
- const symbol = typeRef.getType().getAliasSymbol() ?? typeRef.getType().getSymbol();
188
- if (symbol) symbolsToProcess.add(symbol);
189
- }
168
+ collectSymbolsFromType(param.getType(), symbolsToProcess);
190
169
  }
170
+ const returnType = func.getReturnType();
171
+ collectSymbolsFromType(returnType, symbolsToProcess);
191
172
  } else if (decl.getKind() === tsMorph.SyntaxKind.InterfaceDeclaration || decl.getKind() === tsMorph.SyntaxKind.TypeAliasDeclaration) {
192
- const typeRefs = decl.getDescendantsOfKind(tsMorph.SyntaxKind.TypeReference);
193
- for (const typeRef of typeRefs) {
194
- const symbol = typeRef.getType().getAliasSymbol() ?? typeRef.getType().getSymbol();
195
- if (symbol) symbolsToProcess.add(symbol);
196
- }
173
+ collectSymbolsFromType(decl.getType(), symbolsToProcess);
197
174
  }
198
175
  }
199
176
  const importsMap = /* @__PURE__ */ new Map();
@@ -75,7 +75,6 @@ const generateAppsScriptTypes = async ({
75
75
  const methodDefinitions = [];
76
76
  const exportedDeclarations = [];
77
77
  const exportedDeclarationNames = /* @__PURE__ */ new Set();
78
- const exportedFunctions = [];
79
78
  for (const sourceFile of sourceFiles) {
80
79
  const filePath = sourceFile.getFilePath().replace(/\\/g, "/");
81
80
  const srcPath = absoluteSrcDir.replace(/\\/g, "/");
@@ -101,7 +100,6 @@ const generateAppsScriptTypes = async ({
101
100
  exportedDeclarations.push(func);
102
101
  exportedDeclarationNames.add(name);
103
102
  methodDefinitions.push(getInterfaceMethodDefinition_(name, func));
104
- exportedFunctions.push(func);
105
103
  }
106
104
  }
107
105
  for (const varStmt of sourceFile.getVariableStatements()) {
@@ -113,7 +111,6 @@ const generateAppsScriptTypes = async ({
113
111
  exportedDeclarations.push(varDecl);
114
112
  exportedDeclarationNames.add(name);
115
113
  methodDefinitions.push(getInterfaceMethodDefinition_(name, funcExpr));
116
- exportedFunctions.push(funcExpr);
117
114
  }
118
115
  }
119
116
  }
@@ -145,38 +142,18 @@ const generateAppsScriptTypes = async ({
145
142
  }
146
143
  }
147
144
  };
148
- const returnValueSymbols = /* @__PURE__ */ new Set();
149
- for (const func of exportedFunctions) {
150
- collectSymbolsFromType(func.getReturnType(), returnValueSymbols);
151
- }
152
145
  const symbolsToProcess = /* @__PURE__ */ new Set();
153
146
  for (const decl of exportedDeclarations) {
154
147
  if (decl.getKind() === SyntaxKind.FunctionDeclaration || decl.getKind() === SyntaxKind.VariableDeclaration && (decl.getInitializer()?.getKind() === SyntaxKind.ArrowFunction || decl.getInitializer()?.getKind() === SyntaxKind.FunctionExpression)) {
155
148
  const func = decl.getKind() === SyntaxKind.FunctionDeclaration ? decl : decl.getInitializer();
156
149
  const parameters = func.getParameters();
157
150
  for (const param of parameters) {
158
- const typeRefs = param.getDescendantsOfKind(SyntaxKind.TypeReference);
159
- for (const typeRef of typeRefs) {
160
- const symbol = typeRef.getType().getAliasSymbol() ?? typeRef.getType().getSymbol();
161
- if (symbol) symbolsToProcess.add(symbol);
162
- }
163
- }
164
- const returnTypeNode = func.getReturnTypeNode();
165
- if (returnTypeNode) {
166
- const typeRefs = returnTypeNode.getDescendantsOfKind(
167
- SyntaxKind.TypeReference
168
- );
169
- for (const typeRef of typeRefs) {
170
- const symbol = typeRef.getType().getAliasSymbol() ?? typeRef.getType().getSymbol();
171
- if (symbol) symbolsToProcess.add(symbol);
172
- }
151
+ collectSymbolsFromType(param.getType(), symbolsToProcess);
173
152
  }
153
+ const returnType = func.getReturnType();
154
+ collectSymbolsFromType(returnType, symbolsToProcess);
174
155
  } else if (decl.getKind() === SyntaxKind.InterfaceDeclaration || decl.getKind() === SyntaxKind.TypeAliasDeclaration) {
175
- const typeRefs = decl.getDescendantsOfKind(SyntaxKind.TypeReference);
176
- for (const typeRef of typeRefs) {
177
- const symbol = typeRef.getType().getAliasSymbol() ?? typeRef.getType().getSymbol();
178
- if (symbol) symbolsToProcess.add(symbol);
179
- }
156
+ collectSymbolsFromType(decl.getType(), symbolsToProcess);
180
157
  }
181
158
  }
182
159
  const importsMap = /* @__PURE__ */ new Map();
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.Cbwq1CES.cjs');
5
+ const config = require('./shared/gasnuki.BziruiRW.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.Bcijv2Ub.mjs';
3
+ import { l as loadConfig, g as generateAppsScriptTypes } from './shared/gasnuki.CS6ipBfD.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.1",
3
+ "version": "0.3.2",
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",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "devDependencies": {
65
65
  "@biomejs/biome": "^2.2.6",
66
- "@types/node": "^24.8.0",
66
+ "@types/node": "^24.8.1",
67
67
  "@vitest/coverage-v8": "3.2.4",
68
68
  "typescript": "^5.9.3",
69
69
  "unbuild": "^3.6.1",