@ciderjs/gasnuki 0.3.4 → 0.3.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/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-94.32%25-brightgreen)](https://github.com/luthpg/gasnuki)
4
+ [![Test Coverage](https://img.shields.io/badge/test%20coverage-95.4%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-94.32%25-brightgreen)](https://github.com/luthpg/gasnuki)
4
+ [![Test Coverage](https://img.shields.io/badge/test%20coverage-95.4%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.kBd1L15Q.cjs');
7
+ const config = require('./shared/gasnuki.Cam3UO_N.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.4";
28
+ const version = "0.3.5";
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.C96Q3amR.mjs';
5
+ import { l as loadConfig } from './shared/gasnuki.HyFJZts6.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.4";
12
+ const version = "0.3.5";
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.kBd1L15Q.cjs');
6
+ const config = require('./shared/gasnuki.Cam3UO_N.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.C96Q3amR.mjs';
5
- export { d as defineConfig } from './shared/gasnuki.C96Q3amR.mjs';
4
+ import { g as generateAppsScriptTypes } from './shared/gasnuki.HyFJZts6.mjs';
5
+ export { d as defineConfig } from './shared/gasnuki.HyFJZts6.mjs';
6
6
  import 'node:fs';
7
7
  import 'ts-morph';
8
8
  import 'jiti';
@@ -165,7 +165,6 @@ const generateAppsScriptTypes = async ({
165
165
  for (const typeArg of type.getAliasTypeArguments()) {
166
166
  collectSymbolsFromType(typeArg, foundSymbols);
167
167
  }
168
- return;
169
168
  }
170
169
  const symbol = type.getSymbol();
171
170
  if (symbol && !foundSymbols.has(symbol)) {
@@ -174,6 +173,18 @@ const generateAppsScriptTypes = async ({
174
173
  for (const prop of type.getProperties()) {
175
174
  const propDecl = prop.getDeclarations()[0];
176
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
+ }
187
+ }
177
188
  collectSymbolsFromType(propDecl.getType(), foundSymbols);
178
189
  }
179
190
  }
@@ -269,7 +280,13 @@ const generateAppsScriptTypes = async ({
269
280
  }
270
281
  importsMap.get(modulePath)?.add(symbolName);
271
282
  } else {
272
- const declText = declaration.getText();
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
+ }
289
+ }
273
290
  inlineDefinitions.set(symbolName, declText);
274
291
  }
275
292
  for (const descendant of declaration.getDescendantsOfKind(
@@ -148,7 +148,6 @@ const generateAppsScriptTypes = async ({
148
148
  for (const typeArg of type.getAliasTypeArguments()) {
149
149
  collectSymbolsFromType(typeArg, foundSymbols);
150
150
  }
151
- return;
152
151
  }
153
152
  const symbol = type.getSymbol();
154
153
  if (symbol && !foundSymbols.has(symbol)) {
@@ -157,6 +156,18 @@ const generateAppsScriptTypes = async ({
157
156
  for (const prop of type.getProperties()) {
158
157
  const propDecl = prop.getDeclarations()[0];
159
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
+ }
170
+ }
160
171
  collectSymbolsFromType(propDecl.getType(), foundSymbols);
161
172
  }
162
173
  }
@@ -252,7 +263,13 @@ const generateAppsScriptTypes = async ({
252
263
  }
253
264
  importsMap.get(modulePath)?.add(symbolName);
254
265
  } else {
255
- const declText = declaration.getText();
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
+ }
272
+ }
256
273
  inlineDefinitions.set(symbolName, declText);
257
274
  }
258
275
  for (const descendant of declaration.getDescendantsOfKind(
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.kBd1L15Q.cjs');
5
+ const config = require('./shared/gasnuki.Cam3UO_N.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.C96Q3amR.mjs';
3
+ import { l as loadConfig, g as generateAppsScriptTypes } from './shared/gasnuki.HyFJZts6.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.4",
3
+ "version": "0.3.5",
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",