@google/clasp 2.4.1 → 2.4.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/CHANGELOG.md +7 -0
- package/README.md +3 -3
- package/build/src/apiutils.js +4 -8
- package/build/src/apiutils.js.map +1 -1
- package/build/src/auth.js +3 -5
- package/build/src/auth.js.map +1 -1
- package/build/src/commands/apis.js +9 -8
- package/build/src/commands/apis.js.map +1 -1
- package/build/src/commands/clone.js +1 -2
- package/build/src/commands/clone.js.map +1 -1
- package/build/src/commands/create.js +5 -5
- package/build/src/commands/create.js.map +1 -1
- package/build/src/commands/default.d.ts +1 -1
- package/build/src/commands/default.js.map +1 -1
- package/build/src/commands/deploy.js +1 -2
- package/build/src/commands/deploy.js.map +1 -1
- package/build/src/commands/deployments.js +1 -2
- package/build/src/commands/deployments.js.map +1 -1
- package/build/src/commands/list.js +2 -3
- package/build/src/commands/list.js.map +1 -1
- package/build/src/commands/login.js +1 -2
- package/build/src/commands/login.js.map +1 -1
- package/build/src/commands/logout.js +8 -7
- package/build/src/commands/logout.js.map +1 -1
- package/build/src/commands/logs.js +6 -6
- package/build/src/commands/logs.js.map +1 -1
- package/build/src/commands/open.js +1 -1
- package/build/src/commands/open.js.map +1 -1
- package/build/src/commands/pull.js +1 -2
- package/build/src/commands/pull.js.map +1 -1
- package/build/src/commands/push.js +6 -7
- package/build/src/commands/push.js.map +1 -1
- package/build/src/commands/run.js +1 -2
- package/build/src/commands/run.js.map +1 -1
- package/build/src/commands/status.d.ts +1 -1
- package/build/src/commands/status.js +3 -4
- package/build/src/commands/status.js.map +1 -1
- package/build/src/commands/undeploy.js +1 -2
- package/build/src/commands/undeploy.js.map +1 -1
- package/build/src/commands/version.js +1 -2
- package/build/src/commands/version.js.map +1 -1
- package/build/src/commands/versions.js +3 -4
- package/build/src/commands/versions.js.map +1 -1
- package/build/src/conf.js +4 -9
- package/build/src/conf.js.map +1 -1
- package/build/src/dotfile.js +2 -2
- package/build/src/dotfile.js.map +1 -1
- package/build/src/files.js +4 -7
- package/build/src/files.js.map +1 -1
- package/build/src/index.d.ts +16 -0
- package/build/src/index.js +33 -42
- package/build/src/index.js.map +1 -1
- package/build/src/inquirer.js.map +1 -1
- package/build/src/manifest.js +6 -8
- package/build/src/manifest.js.map +1 -1
- package/build/src/utils.d.ts +1 -2
- package/build/src/utils.js +10 -9
- package/build/src/utils.js.map +1 -1
- package/docs/esmodules.md +4 -4
- package/package.json +26 -26
package/build/src/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import why from 'wtfnode'; // should be your first require
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
4
|
* Copyright Google Inc.
|
|
@@ -19,11 +18,12 @@ import why from 'wtfnode'; // should be your first require
|
|
|
19
18
|
/**
|
|
20
19
|
* clasp - The Apps Script CLI
|
|
21
20
|
*/
|
|
22
|
-
import
|
|
21
|
+
import { program } from 'commander';
|
|
23
22
|
import loudRejection from 'loud-rejection';
|
|
24
23
|
import { dirname } from 'path';
|
|
25
24
|
import { readPackageUpSync } from 'read-pkg-up';
|
|
26
25
|
import { fileURLToPath } from 'url';
|
|
26
|
+
import fs from 'fs-extra';
|
|
27
27
|
import { ClaspError } from './clasp-error.js';
|
|
28
28
|
import apis from './commands/apis.js';
|
|
29
29
|
import clone from './commands/clone.js';
|
|
@@ -47,9 +47,7 @@ import versions from './commands/versions.js';
|
|
|
47
47
|
import { Conf } from './conf.js';
|
|
48
48
|
import { PROJECT_NAME } from './constants.js';
|
|
49
49
|
import { spinner, stopSpinner } from './utils.js';
|
|
50
|
-
import fs from 'fs-extra';
|
|
51
50
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
52
|
-
let beforeExit = () => { };
|
|
53
51
|
// instantiate the config singleton (and loads environment variables as a side effect)
|
|
54
52
|
const config = Conf.get();
|
|
55
53
|
// Ensure any unhandled exception won't go unnoticed
|
|
@@ -59,34 +57,34 @@ const manifest = readPackageUpSync({ cwd: __dirname });
|
|
|
59
57
|
/**
|
|
60
58
|
* Set global CLI configurations
|
|
61
59
|
*/
|
|
62
|
-
|
|
60
|
+
program.storeOptionsAsProperties(false);
|
|
63
61
|
/**
|
|
64
62
|
* Displays clasp version
|
|
65
63
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
program.version(manifest ? manifest.packageJson.version : 'unknown', '-v, --version', 'output the current version');
|
|
65
|
+
program.name(PROJECT_NAME).usage('<command> [options]').description(`${PROJECT_NAME} - The Apps Script CLI`);
|
|
68
66
|
/**
|
|
69
67
|
* Path to an auth file, or to a folder with a '.clasprc.json' file.
|
|
70
68
|
*/
|
|
71
|
-
|
|
69
|
+
program
|
|
72
70
|
.option('-A, --auth <file>', "path to an auth file or a folder with a '.clasprc.json' file.")
|
|
73
|
-
.on('option:auth', auth => {
|
|
71
|
+
.on('option:auth', (auth) => {
|
|
74
72
|
config.auth = auth;
|
|
75
73
|
});
|
|
76
74
|
/**
|
|
77
75
|
* Path to an ignore file, or to a folder with a '.claspignore'.
|
|
78
76
|
*/
|
|
79
|
-
|
|
77
|
+
program
|
|
80
78
|
.option('-I, --ignore <file>', "path to an ignore file or a folder with a '.claspignore' file.")
|
|
81
|
-
.on('option:ignore', ignore => {
|
|
79
|
+
.on('option:ignore', (ignore) => {
|
|
82
80
|
config.ignore = ignore;
|
|
83
81
|
});
|
|
84
82
|
/**
|
|
85
83
|
* Path to a project file, or to a folder with a '.clasp.json'.
|
|
86
84
|
*/
|
|
87
|
-
|
|
85
|
+
program
|
|
88
86
|
.option('-P, --project <file>', "path to a project file or to a folder with a '.clasp.json' file.")
|
|
89
|
-
.on('option:project', path => {
|
|
87
|
+
.on('option:project', (path) => {
|
|
90
88
|
const stats = fs.lstatSync(path);
|
|
91
89
|
if (stats.isDirectory()) {
|
|
92
90
|
config.projectRootDirectory = path;
|
|
@@ -95,12 +93,6 @@ commander
|
|
|
95
93
|
config.projectConfig = path;
|
|
96
94
|
}
|
|
97
95
|
});
|
|
98
|
-
/**
|
|
99
|
-
* Display some debugging info upon exit.
|
|
100
|
-
*/
|
|
101
|
-
commander.option('-W, --why', 'Display some debugging info upon exit.').on('option:why', () => {
|
|
102
|
-
beforeExit = why.dump;
|
|
103
|
-
});
|
|
104
96
|
/**
|
|
105
97
|
* Logs the user in. Saves the client credentials to an rc file.
|
|
106
98
|
* @name login
|
|
@@ -110,7 +102,7 @@ commander.option('-W, --why', 'Display some debugging info upon exit.').on('opti
|
|
|
110
102
|
* @example login --creds credentials.json (uses your credentials file).
|
|
111
103
|
* @see test
|
|
112
104
|
*/
|
|
113
|
-
|
|
105
|
+
program
|
|
114
106
|
.command('login')
|
|
115
107
|
.description('Log in to script.google.com')
|
|
116
108
|
.option('--no-localhost', 'Do not run a local server, manually enter code instead')
|
|
@@ -122,7 +114,7 @@ commander
|
|
|
122
114
|
* @name logout
|
|
123
115
|
* @example logout
|
|
124
116
|
*/
|
|
125
|
-
|
|
117
|
+
program.command('logout').description('Log out').action(logout);
|
|
126
118
|
/**
|
|
127
119
|
* Creates a new script project.
|
|
128
120
|
* @name create
|
|
@@ -138,7 +130,7 @@ commander.command('logout').description('Log out').action(logout);
|
|
|
138
130
|
* @example create "My Script" "1D_Gxyv*****************************NXO7o"
|
|
139
131
|
* @see https://developers.google.com/apps-script/api/reference/rest/v1/projects/create
|
|
140
132
|
*/
|
|
141
|
-
|
|
133
|
+
program
|
|
142
134
|
.command('create')
|
|
143
135
|
.description('Create a script')
|
|
144
136
|
.option('--type <type>', 'Creates a new Apps Script project attached to a new Document, Spreadsheet, Presentation, Form, or as a standalone script, web app, or API.')
|
|
@@ -152,7 +144,7 @@ commander
|
|
|
152
144
|
* @param {string?} [versionNumber] The version of the script to clone.
|
|
153
145
|
* @param {string?} [--rootDir] Local root directory that store your project files.
|
|
154
146
|
*/
|
|
155
|
-
|
|
147
|
+
program
|
|
156
148
|
.command('clone [scriptId] [versionNumber]')
|
|
157
149
|
.description('Clone a project')
|
|
158
150
|
.option('--rootDir <rootDir>', 'Local root directory in which clasp will store your project files.')
|
|
@@ -163,7 +155,7 @@ commander
|
|
|
163
155
|
* @name pull
|
|
164
156
|
* @example pull
|
|
165
157
|
*/
|
|
166
|
-
|
|
158
|
+
program
|
|
167
159
|
.command('pull')
|
|
168
160
|
.description('Fetch a remote project')
|
|
169
161
|
.option('--versionNumber <version>', 'The version number of the project to retrieve.')
|
|
@@ -179,7 +171,7 @@ commander
|
|
|
179
171
|
* @example push --force
|
|
180
172
|
* @example push --watch
|
|
181
173
|
*/
|
|
182
|
-
|
|
174
|
+
program
|
|
183
175
|
.command('push')
|
|
184
176
|
.description('Update the remote project')
|
|
185
177
|
.option('-f, --force', 'Forcibly overwrites the remote manifest.')
|
|
@@ -194,7 +186,7 @@ commander
|
|
|
194
186
|
* - That are ignored (filename matches a glob pattern in the ignore file)
|
|
195
187
|
* @example status
|
|
196
188
|
*/
|
|
197
|
-
|
|
189
|
+
program
|
|
198
190
|
.command('status')
|
|
199
191
|
.description('Lists files that will be pushed by clasp')
|
|
200
192
|
.option('--json', 'Show status in JSON form')
|
|
@@ -206,7 +198,7 @@ commander
|
|
|
206
198
|
* @example open
|
|
207
199
|
* @example open [scriptId]
|
|
208
200
|
*/
|
|
209
|
-
|
|
201
|
+
program
|
|
210
202
|
.command('open [scriptId]')
|
|
211
203
|
.description('Open a script')
|
|
212
204
|
.option('--webapp', 'Open web application in the browser')
|
|
@@ -219,7 +211,7 @@ commander
|
|
|
219
211
|
* @name deployments
|
|
220
212
|
* @example deployments
|
|
221
213
|
*/
|
|
222
|
-
|
|
214
|
+
program.command('deployments').description('List deployment ids of a script').action(deployments);
|
|
223
215
|
/**
|
|
224
216
|
* Creates a version and deploys a script.
|
|
225
217
|
* The response gives the version of the deployment.
|
|
@@ -230,7 +222,7 @@ commander.command('deployments').description('List deployment ids of a script').
|
|
|
230
222
|
* @example deploy --deploymentId 123 (create new version)
|
|
231
223
|
* @example deploy -V 7 -d "Updates sidebar logo." -i 456
|
|
232
224
|
*/
|
|
233
|
-
|
|
225
|
+
program
|
|
234
226
|
.command('deploy')
|
|
235
227
|
.description('Deploy a project')
|
|
236
228
|
.option('-V, --versionNumber <version>', 'The project version') // We can't use `version` in subcommand
|
|
@@ -246,7 +238,7 @@ commander
|
|
|
246
238
|
* @example "undeploy 123"
|
|
247
239
|
* @example "undeploy --all"
|
|
248
240
|
*/
|
|
249
|
-
|
|
241
|
+
program
|
|
250
242
|
.command('undeploy [deploymentId]')
|
|
251
243
|
.description('Undeploy a deployment of a project')
|
|
252
244
|
.option('-a, --all', 'Undeploy all deployments')
|
|
@@ -258,20 +250,20 @@ commander
|
|
|
258
250
|
* @example version
|
|
259
251
|
* @example version "Bump the version."
|
|
260
252
|
*/
|
|
261
|
-
|
|
253
|
+
program.command('version [description]').description('Creates an immutable version of the script').action(version);
|
|
262
254
|
/**
|
|
263
255
|
* List versions of a script.
|
|
264
256
|
* @name versions
|
|
265
257
|
* @example versions
|
|
266
258
|
*/
|
|
267
|
-
|
|
259
|
+
program.command('versions').description('List versions of a script').action(versions);
|
|
268
260
|
/**
|
|
269
261
|
* Lists your most recent 10 Apps Script projects.
|
|
270
262
|
* @name list
|
|
271
263
|
* @example list # helloworld1 - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...
|
|
272
264
|
* @todo Add --all flag to list all projects.
|
|
273
265
|
*/
|
|
274
|
-
|
|
266
|
+
program
|
|
275
267
|
.command('list')
|
|
276
268
|
.description('List App Scripts projects')
|
|
277
269
|
.option('--noShorten', 'Do not shorten long names', false)
|
|
@@ -283,7 +275,7 @@ commander
|
|
|
283
275
|
* @param {boolean?} open Open StackDriver logs in a browser.
|
|
284
276
|
* @param {boolean?} setup Setup StackDriver logs.
|
|
285
277
|
*/
|
|
286
|
-
|
|
278
|
+
program
|
|
287
279
|
.command('logs')
|
|
288
280
|
.description('Shows the StackDriver logs')
|
|
289
281
|
.option('--json', 'Show logs in JSON form')
|
|
@@ -304,7 +296,7 @@ commander
|
|
|
304
296
|
* @see https://developers.google.com/apps-script/api/reference/rest/v1/scripts/run
|
|
305
297
|
* @requires `clasp login --creds` to be run beforehand.
|
|
306
298
|
*/
|
|
307
|
-
|
|
299
|
+
program
|
|
308
300
|
.command('run [functionName]')
|
|
309
301
|
.description('Run a function in your Apps Scripts project')
|
|
310
302
|
.option('--nondev', 'Run script function in non-devMode')
|
|
@@ -317,7 +309,7 @@ commander
|
|
|
317
309
|
* @example apis list
|
|
318
310
|
* @example apis enable drive
|
|
319
311
|
*/
|
|
320
|
-
|
|
312
|
+
program
|
|
321
313
|
.command('apis')
|
|
322
314
|
.description(`List, enable, or disable APIs
|
|
323
315
|
list
|
|
@@ -336,7 +328,7 @@ commander
|
|
|
336
328
|
* @example setting scriptId
|
|
337
329
|
* @example setting scriptId new-id
|
|
338
330
|
*/
|
|
339
|
-
|
|
331
|
+
program
|
|
340
332
|
.command('setting [settingKey] [newValue]')
|
|
341
333
|
.alias('settings')
|
|
342
334
|
.description('Update <settingKey> in .clasp.json')
|
|
@@ -345,12 +337,12 @@ commander
|
|
|
345
337
|
* All other commands are given a help message.
|
|
346
338
|
* @example random
|
|
347
339
|
*/
|
|
348
|
-
|
|
340
|
+
program.command('*', { isDefault: true }).description('Any other command is not supported').action(defaultCmd);
|
|
349
341
|
/**
|
|
350
342
|
* @internal
|
|
351
343
|
* Displays clasp paths
|
|
352
344
|
*/
|
|
353
|
-
|
|
345
|
+
program
|
|
354
346
|
.command('paths')
|
|
355
347
|
.description('List current config files path')
|
|
356
348
|
.action(() => {
|
|
@@ -361,12 +353,12 @@ commander
|
|
|
361
353
|
const [_bin, _sourcePath, ...args] = process.argv;
|
|
362
354
|
// Defaults to help if commands are not provided
|
|
363
355
|
if (args.length === 0) {
|
|
364
|
-
|
|
356
|
+
program.outputHelp();
|
|
365
357
|
}
|
|
366
358
|
(async () => {
|
|
367
359
|
try {
|
|
368
360
|
// User input is provided from the process' arguments
|
|
369
|
-
await
|
|
361
|
+
await program.parseAsync(process.argv);
|
|
370
362
|
stopSpinner();
|
|
371
363
|
}
|
|
372
364
|
catch (error) {
|
|
@@ -385,6 +377,5 @@ if (args.length === 0) {
|
|
|
385
377
|
}
|
|
386
378
|
}
|
|
387
379
|
spinner.clear();
|
|
388
|
-
beforeExit();
|
|
389
380
|
})();
|
|
390
381
|
//# sourceMappingURL=index.js.map
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAA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C;AAEL,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AAClD,gDAAgD;AAChD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;IACrB,OAAO,CAAC,UAAU,EAAE,CAAC;CACtB;AAED,CAAC,KAAK,IAAI,EAAE;IACV,IAAI;QACF,qDAAqD;QACrD,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,WAAW,EAAE,CAAC;KACf;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,UAAU,EAAE;YAC/B,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC9B;aAAM,IAAI,KAAK,YAAY,KAAK,EAAE;YACjC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC9B;aAAM;YACL,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;SACvC;KACF;IAED,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inquirer.js","sourceRoot":"","sources":["../../src/inquirer.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,YAAY,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"inquirer.js","sourceRoot":"","sources":["../../src/inquirer.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAG5D,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;A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ChB;CACF,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAClC,MAAM,CAA+B;IACnC;QACE,OAAO,EAAE,GAAG,GAAG,CAAC,cAAc,EAAE;QAChC,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,OAAO;KACd;CACF,CAAC,CAAC;AAOL;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgD,EAAE,EAAE,CACjF,MAAM,CAAqB;IACzB;QACE,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,GAAG,CAAC,qBAAqB;QAClC,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,MAAM,CAAiB;IACrB;QACE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,GAAgC,CAAC,CAAC;QAC7F,OAAO,EAAE,GAAG,CAAC,sBAAsB;QACnC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAC"}
|
package/build/src/manifest.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import fs from 'fs-extra';
|
|
2
1
|
import path from 'path';
|
|
2
|
+
import is from '@sindresorhus/is';
|
|
3
|
+
import fs from 'fs-extra';
|
|
3
4
|
import { PUBLIC_ADVANCED_SERVICES as publicAdvancedServices } from './apis.js';
|
|
4
5
|
import { ClaspError } from './clasp-error.js';
|
|
5
6
|
import { Conf } from './conf.js';
|
|
@@ -7,10 +8,10 @@ import { FS_OPTIONS, PROJECT_MANIFEST_FILENAME } from './constants.js';
|
|
|
7
8
|
import { ERROR } from './messages.js';
|
|
8
9
|
import { getProjectSettings, parseJsonOrDie } from './utils.js';
|
|
9
10
|
const config = Conf.get();
|
|
10
|
-
|
|
11
|
+
/** Gets the path to manifest for given `rootDir` */
|
|
11
12
|
const getManifestPath = (rootDir) => path.join(rootDir, PROJECT_MANIFEST_FILENAME);
|
|
12
13
|
/** Gets the `rootDir` from given project */
|
|
13
|
-
const getRootDir = (
|
|
14
|
+
const getRootDir = ({ rootDir }) => is.string(rootDir) ? rootDir : config.projectRootDirectory;
|
|
14
15
|
/**
|
|
15
16
|
* Checks if the rootDir appears to be a valid project.
|
|
16
17
|
*
|
|
@@ -54,10 +55,7 @@ const writeManifest = async (manifest) => {
|
|
|
54
55
|
/**
|
|
55
56
|
* Returns true if the manifest is valid.
|
|
56
57
|
*/
|
|
57
|
-
export const isValidManifest = async (manifest) =>
|
|
58
|
-
const value = manifest !== null && manifest !== void 0 ? manifest : (await getManifest());
|
|
59
|
-
return value !== null && typeof value !== undefined;
|
|
60
|
-
};
|
|
58
|
+
export const isValidManifest = async (manifest) => !is.nullOrUndefined(manifest !== null && manifest !== void 0 ? manifest : (await getManifest()));
|
|
61
59
|
/**
|
|
62
60
|
* Ensures the manifest is correct for running a function.
|
|
63
61
|
* The manifest must include:
|
|
@@ -67,7 +65,7 @@ export const isValidManifest = async (manifest) => {
|
|
|
67
65
|
*/
|
|
68
66
|
export const isValidRunManifest = async () => {
|
|
69
67
|
const value = await getManifest();
|
|
70
|
-
return Boolean(isValidManifest(value) && value.executionApi && value.executionApi.access);
|
|
68
|
+
return Boolean((await isValidManifest(value)) && value.executionApi && value.executionApi.access);
|
|
71
69
|
};
|
|
72
70
|
/**
|
|
73
71
|
* Reads manifest file from project root dir.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;A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AqB;IACrB,IAAI,MAAM,EAAE;QACV,2DAA2D;QAC3D,eAAe,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAE,CAAC,CAAC;KAChG;IAED,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,CAAC,uBAAuB,GAAG,eAAe,CAAC;IAChE,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC"}
|
package/build/src/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { script_v1 as scriptV1 } from 'googleapis';
|
|
2
|
-
import ora from 'ora';
|
|
3
2
|
import type { ClaspToken, ProjectSettings } from './dotfile';
|
|
4
3
|
/**
|
|
5
4
|
* The installed credentials. This is a file downloaded from console.developers.google.com
|
|
@@ -32,7 +31,7 @@ export declare const hasOauthClientSettings: (local?: boolean) => boolean;
|
|
|
32
31
|
* @returns {Promise<ClaspToken>} A promise to get the rc file as object.
|
|
33
32
|
*/
|
|
34
33
|
export declare const getOAuthSettings: (local: boolean) => Promise<ClaspToken>;
|
|
35
|
-
export declare const spinner: ora.Ora;
|
|
34
|
+
export declare const spinner: import("ora").Ora;
|
|
36
35
|
/** Stops the spinner if it is spinning */
|
|
37
36
|
export declare const stopSpinner: () => void;
|
|
38
37
|
export declare const getErrorMessage: (value: any) => any;
|
package/build/src/utils.js
CHANGED
|
@@ -36,7 +36,7 @@ export const getOAuthSettings = async (local) => {
|
|
|
36
36
|
var _a;
|
|
37
37
|
try {
|
|
38
38
|
const result = DOTFILE.AUTH(local).read();
|
|
39
|
-
return result;
|
|
39
|
+
return await result;
|
|
40
40
|
}
|
|
41
41
|
catch (error) {
|
|
42
42
|
throw new ClaspError((_a = getErrorMessage(error)) !== null && _a !== void 0 ? _a : ERROR.NO_CREDENTIALS(local));
|
|
@@ -56,20 +56,20 @@ export const getErrorMessage = (value) => {
|
|
|
56
56
|
if (value && typeof value.error === 'string') {
|
|
57
57
|
return JSON.parse(value.error).error;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
if ((value === null || value === void 0 ? void 0 : value.statusCode) === 401 || ((value === null || value === void 0 ? void 0 : value.error) && value.error.error && value.error.error.code === 401)) {
|
|
60
60
|
// TODO check if local creds exist:
|
|
61
61
|
// localOathSettingsExist() ? ERROR.UNAUTHENTICATED : ERROR.UNAUTHENTICATED_LOCAL
|
|
62
62
|
return ERROR.UNAUTHENTICATED;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
if (value && ((value.error && value.error.code === 403) || value.code === 403)) {
|
|
65
65
|
// TODO check if local creds exist:
|
|
66
66
|
// localOathSettingsExist() ? ERROR.PERMISSION_DENIED : ERROR.PERMISSION_DENIED_LOCAL
|
|
67
67
|
return ERROR.PERMISSION_DENIED;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
if (value && value.code === 429) {
|
|
70
70
|
return ERROR.RATE_LIMIT;
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
if (value === null || value === void 0 ? void 0 : value.error) {
|
|
73
73
|
return `~~ API ERROR (${value.statusCode || value.error.code})=\n${value.error}`;
|
|
74
74
|
}
|
|
75
75
|
return undefined;
|
|
@@ -82,13 +82,13 @@ export const getErrorMessage = (value) => {
|
|
|
82
82
|
* @return {string} The URL of the web application in the online script editor.
|
|
83
83
|
*/
|
|
84
84
|
export const getWebApplicationURL = (value) => {
|
|
85
|
-
var _a;
|
|
85
|
+
var _a, _b;
|
|
86
86
|
const { entryPoints = [] } = value;
|
|
87
87
|
const entryPoint = entryPoints.find((entryPoint) => entryPoint.entryPointType === 'WEB_APP');
|
|
88
88
|
if (entryPoint) {
|
|
89
|
-
return entryPoint.webApp
|
|
89
|
+
return (_a = entryPoint.webApp) === null || _a === void 0 ? void 0 : _a.url;
|
|
90
90
|
}
|
|
91
|
-
throw new ClaspError(ERROR.NO_WEBAPP((
|
|
91
|
+
throw new ClaspError(ERROR.NO_WEBAPP((_b = value.deploymentId) !== null && _b !== void 0 ? _b : ''));
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
94
|
* Gets default project name.
|
|
@@ -106,7 +106,7 @@ export const getDefaultProjectName = () => capitalize(path.basename(config.proje
|
|
|
106
106
|
export const getProjectSettings = async () => {
|
|
107
107
|
const dotfile = DOTFILE.PROJECT();
|
|
108
108
|
try {
|
|
109
|
-
if (dotfile.exists()) {
|
|
109
|
+
if (await dotfile.exists()) {
|
|
110
110
|
// Found a dotfile, but does it have the settings, or is it corrupted?
|
|
111
111
|
try {
|
|
112
112
|
const settings = await dotfile.read();
|
|
@@ -203,6 +203,7 @@ export const getProjectId = async (promptUser = true) => {
|
|
|
203
203
|
if (error instanceof ClaspError) {
|
|
204
204
|
throw error;
|
|
205
205
|
}
|
|
206
|
+
// TODO: better error handling
|
|
206
207
|
throw new ClaspError(error.message);
|
|
207
208
|
}
|
|
208
209
|
};
|
package/build/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,OAAO,CAAC;AAEzB,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,KAAK,EAAE,GAAG,EAAC,MAAM,eAAe,CAAC;AAIzC,MAAM,MAAM,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AE,CAAC;KACxC;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,YAAY,UAAU,EAAE;YAC/B,MAAM,KAAK,CAAC;SACb;QAED,8BAA8B;QAC9B,MAAM,IAAI,UAAU,CAAE,KAAa,CAAC,OAAO,CAAC,CAAC;KAC9C;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAI,KAAa,EAAK,EAAE;IACpD,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAC;KAC/B;IAAC,MAAM;QACN,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;KAC1C;AACH,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,MAAc,EAAE,EAAE,CACzD,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAC,uBAAuB,EAAE,IAAI,EAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"}
|
package/docs/esmodules.md
CHANGED
|
@@ -12,9 +12,9 @@ import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
|
12
12
|
|
|
13
13
|
const extensions = [".ts", ".js"];
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const preventTreeShakingPlugin = () => {
|
|
16
16
|
return {
|
|
17
|
-
name: 'no-
|
|
17
|
+
name: 'no-treeshaking',
|
|
18
18
|
resolveId(id, importer) {
|
|
19
19
|
if (!importer) {
|
|
20
20
|
// let's not theeshake entry points, as we're not exporting anything in Apps Script files
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
format: "esm",
|
|
33
33
|
},
|
|
34
34
|
plugins: [
|
|
35
|
-
|
|
35
|
+
preventTreeShakingPlugin(),
|
|
36
36
|
nodeResolve({
|
|
37
37
|
extensions,
|
|
38
38
|
}),
|
|
@@ -78,4 +78,4 @@ node_modules/**
|
|
|
78
78
|
|
|
79
79
|
Now you can push using your normal `clasp push`-command!
|
|
80
80
|
|
|
81
|
-
This should be enough to start developing a project using ES Modules. A complete example repo can be cloned from [atti187/esmodules](https://github.com/atti187/esmodules).
|
|
81
|
+
This should be enough to start developing a project using ES Modules. A complete example repo can be cloned from [atti187/esmodules](https://github.com/atti187/esmodules).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/clasp",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Develop Apps Script Projects locally",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./build/src/index.js",
|
|
@@ -60,18 +60,19 @@
|
|
|
60
60
|
"author": "Grant Timmerman",
|
|
61
61
|
"license": "Apache-2.0",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
63
|
+
"@sindresorhus/is": "^4.0.1",
|
|
64
|
+
"chalk": "^4.1.2",
|
|
65
|
+
"chokidar": "^3.5.2",
|
|
66
|
+
"cli-truncate": "^3.0.0",
|
|
67
|
+
"commander": "^8.1.0",
|
|
67
68
|
"debounce": "^1.2.1",
|
|
68
|
-
"dotf": "^2.0.
|
|
69
|
-
"find-up": "^
|
|
69
|
+
"dotf": "^2.0.2",
|
|
70
|
+
"find-up": "^6.0.0",
|
|
70
71
|
"fs-extra": "^10.0.0",
|
|
71
72
|
"fuzzy": "^0.1.3",
|
|
72
|
-
"google-auth-library": "^7.
|
|
73
|
-
"googleapis": "^
|
|
74
|
-
"inquirer": "^8.1.
|
|
73
|
+
"google-auth-library": "^7.6.2",
|
|
74
|
+
"googleapis": "^84.0.0",
|
|
75
|
+
"inquirer": "^8.1.2",
|
|
75
76
|
"inquirer-autocomplete-prompt-ipt": "^2.0.0",
|
|
76
77
|
"is-reachable": "^5.0.0",
|
|
77
78
|
"log-symbols": "^5.0.0",
|
|
@@ -79,36 +80,35 @@
|
|
|
79
80
|
"make-dir": "^3.1.0",
|
|
80
81
|
"multimatch": "^5.0.0",
|
|
81
82
|
"normalize-newline": "^4.1.0",
|
|
82
|
-
"open": "^8.2.
|
|
83
|
-
"ora": "^
|
|
84
|
-
"p-map": "^5.
|
|
83
|
+
"open": "^8.2.1",
|
|
84
|
+
"ora": "^6.0.0",
|
|
85
|
+
"p-map": "^5.1.0",
|
|
85
86
|
"read-pkg-up": "^8.0.0",
|
|
86
87
|
"recursive-readdir": "^2.2.2",
|
|
87
88
|
"server-destroy": "^1.0.1",
|
|
88
89
|
"split-lines": "^3.0.0",
|
|
89
90
|
"strip-bom": "^5.0.0",
|
|
90
|
-
"ts2gas": "^4.
|
|
91
|
-
"typescript": "^4.
|
|
92
|
-
"wtfnode": "^0.8.4"
|
|
91
|
+
"ts2gas": "^4.2.0",
|
|
92
|
+
"typescript": "^4.4.2"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@types/chai": "^4.2.
|
|
95
|
+
"@types/chai": "^4.2.21",
|
|
96
96
|
"@types/debounce": "^1.2.0",
|
|
97
|
-
"@types/fs-extra": "^9.0.
|
|
98
|
-
"@types/inquirer": "^7.3.
|
|
99
|
-
"@types/mocha": "^
|
|
100
|
-
"@types/node": "^12.20.
|
|
97
|
+
"@types/fs-extra": "^9.0.12",
|
|
98
|
+
"@types/inquirer": "^7.3.3",
|
|
99
|
+
"@types/mocha": "^9.0.0",
|
|
100
|
+
"@types/node": "^12.20.21",
|
|
101
101
|
"@types/recursive-readdir": "^2.2.0",
|
|
102
102
|
"@types/server-destroy": "^1.0.1",
|
|
103
|
-
"@types/tmp": "^0.2.
|
|
103
|
+
"@types/tmp": "^0.2.1",
|
|
104
104
|
"@types/wtfnode": "^0.7.0",
|
|
105
105
|
"chai": "^4.3.4",
|
|
106
|
-
"coveralls": "^3.1.
|
|
106
|
+
"coveralls": "^3.1.1",
|
|
107
107
|
"gts": "^3.1.0",
|
|
108
|
-
"mocha": "^9.
|
|
108
|
+
"mocha": "^9.1.1",
|
|
109
109
|
"nyc": "^15.1.0",
|
|
110
|
-
"prettier": "^2.3.
|
|
110
|
+
"prettier": "^2.3.2",
|
|
111
111
|
"tmp": "^0.2.1",
|
|
112
|
-
"type-fest": "^1.
|
|
112
|
+
"type-fest": "^2.1.0"
|
|
113
113
|
}
|
|
114
114
|
}
|