@google/clasp 3.0.3-alpha → 3.0.4-alpha
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.md +8 -9
- package/build/src/commands/program.js +1 -1
- package/build/src/core/files.js +2 -2
- package/package.json +24 -46
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<a href="https://coveralls.io/github/google/clasp?branch=master"><img src="https://coveralls.io/repos/github/google/clasp/badge.svg?branch=master" alt="Coverage Status"></a>
|
|
5
5
|
<a href="https://www.npmjs.com/package/@google/clasp"><img src="https://img.shields.io/npm/v/@google/clasp.svg" alt="npm Version"></a>
|
|
6
6
|
<a href="https://npmcharts.com/compare/@google/clasp?minimal=true"><img src="https://img.shields.io/npm/dw/@google/clasp.svg" alt="npm Downloads"></a>
|
|
7
|
-
<a href="https://david-dm.org/google/clasp" title="dependencies status"><img src="https://david-dm.org/google/clasp/status.svg"/></a>
|
|
8
7
|
<a href="https://github.com/google/gts" title="Code Style: Google"><img src="https://img.shields.io/badge/code%20style-google-blueviolet.svg"/></a>
|
|
9
8
|
|
|
10
9
|
> Develop [Apps Script](https://developers.google.com/apps-script/) projects locally using clasp (**C**ommand **L**ine **A**pps **S**cript **P**rojects).
|
|
@@ -82,7 +81,7 @@ clasp
|
|
|
82
81
|
- [`clasp pull [--versionNumber]`](#pull)
|
|
83
82
|
- [`clasp push [--watch] [--force]`](#push)
|
|
84
83
|
- [`clasp show-file-status [--json]`](#status)
|
|
85
|
-
- [`clasp open-script](#open)
|
|
84
|
+
- [`clasp open-script`](#open)
|
|
86
85
|
- [`clasp list-deployments`](#deployments)
|
|
87
86
|
- [`clasp create-deployment [--versionNumber <version>] [--description <description>] [--deploymentId <id>]`](#deploy)
|
|
88
87
|
- [`clasp delete-deployment [deploymentId] [--all]`](#undeploy)
|
|
@@ -98,7 +97,7 @@ clasp
|
|
|
98
97
|
- [`clasp list-apis`](#apis)
|
|
99
98
|
- [`clasp enable-api<api>`](#apis)
|
|
100
99
|
- [`clasp disable-api <api>`](#apis)
|
|
101
|
-
- [`clasp run-function [function]`](#
|
|
100
|
+
- [`clasp run-function [function]`](#clasp-run)
|
|
102
101
|
|
|
103
102
|
## Guides
|
|
104
103
|
|
|
@@ -144,7 +143,7 @@ Most command require user authorization. Run `clasp login` to authorize access t
|
|
|
144
143
|
|
|
145
144
|
#### Multiple user support
|
|
146
145
|
|
|
147
|
-
Use the global `--user` option to switch between accounts.
|
|
146
|
+
Use the global `--user` option to switch between accounts. This supports both running clasp as different users as well as when invoking the `clasp run-function` command.
|
|
148
147
|
|
|
149
148
|
Examples:
|
|
150
149
|
|
|
@@ -152,7 +151,7 @@ Examples:
|
|
|
152
151
|
clasp login # Saves as default credentials
|
|
153
152
|
clasp clone # User not specified, runs using default credentials
|
|
154
153
|
clasp login --user testaccount # Authorized new named credentials
|
|
155
|
-
|
|
154
|
+
clasp run-function --user testaccount myFunction # Runs function as test account
|
|
156
155
|
```
|
|
157
156
|
|
|
158
157
|
### Bring your own project/credentials
|
|
@@ -161,9 +160,9 @@ While clasp includes a default OAuth client, using your own project is recommend
|
|
|
161
160
|
|
|
162
161
|
1. [Create a new project](https://cloud.google.com/resource-manager/docs/creating-managing-projects) in the Google Cloud Developer Console.
|
|
163
162
|
1. [Create an OAuth client](https://support.google.com/cloud/answer/15549257?hl=en#:~:text=To%20create%20an%20OAuth%202.0,are%20yet%20to%20do%20so.). The client type must be `Desktop Application`. Download and save the generated client secrets file. This is required when authorizing using the`clasp login --creds <filename>` command.
|
|
164
|
-
1. [Enable services](https://cloud.google.com/endpoints/docs/openapi/enable-api). For full
|
|
165
|
-
* Apps
|
|
166
|
-
* Service Usage API - `serviceusage.googleapis.com` (
|
|
163
|
+
1. [Enable services](https://cloud.google.com/endpoints/docs/openapi/enable-api). For full functionality, clasp requires the following:
|
|
164
|
+
* Apps Script API - `script.googleapis.com` (required)
|
|
165
|
+
* Service Usage API - `serviceusage.googleapis.com` (required to list/enable/disable APIs)
|
|
167
166
|
* Google Drive API - `drive.googleapis.com` (required to list scripts, create container-bound scripts)
|
|
168
167
|
- Cloud Logging API - `logging.googleapis.com` (required to read logs)
|
|
169
168
|
|
|
@@ -192,7 +191,7 @@ If your organization restricts authorization for third-party apps, you may eithe
|
|
|
192
191
|
|
|
193
192
|
### Service accounts
|
|
194
193
|
|
|
195
|
-
Use the `--adc` option on any command to read credentials from the
|
|
194
|
+
Use the `--adc` option on any command to read credentials from the environment using Google Cloud's [application default credentials](https://cloud.google.com/docs/authentication/application-default-credentials) mechanism.
|
|
196
195
|
|
|
197
196
|
Note that if using a service account, service accounts can not own scripts. To use a service account to push or pull files from Apps Script, the scripts must be shared with the service account with the appropriate role (e.g. `Editor` in able to push.)
|
|
198
197
|
|
|
@@ -27,7 +27,7 @@ import { command as filesStatusCommand } from './show-file-status.js';
|
|
|
27
27
|
import { command as tailLogsCommand } from './tail-logs.js';
|
|
28
28
|
import { dirname } from 'path';
|
|
29
29
|
import { fileURLToPath } from 'url';
|
|
30
|
-
import { readPackageUpSync } from 'read-
|
|
30
|
+
import { readPackageUpSync } from 'read-package-up';
|
|
31
31
|
import { initAuth } from '../auth/auth.js';
|
|
32
32
|
import { initClaspInstance } from '../core/clasp.js';
|
|
33
33
|
import { intl } from '../intl.js';
|
package/build/src/core/files.js
CHANGED
|
@@ -177,7 +177,7 @@ export class Files {
|
|
|
177
177
|
const localPath = path.relative(process.cwd(), path.join(contentDir, filename));
|
|
178
178
|
const resolvedPath = path.relative(contentDir, localPath);
|
|
179
179
|
const parsedPath = path.parse(resolvedPath);
|
|
180
|
-
let remotePath = path.format({ dir:
|
|
180
|
+
let remotePath = normalizePath(path.format({ dir: parsedPath.dir, name: parsedPath.name }));
|
|
181
181
|
const type = getFileType(localPath, fileExtensionMap);
|
|
182
182
|
if (!type) {
|
|
183
183
|
debug('Ignoring unsupported file %s', localPath);
|
|
@@ -270,7 +270,7 @@ export class Files {
|
|
|
270
270
|
if (dirsWithIncludedFiles.has(dir)) {
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
|
-
excludedPath = `${dir}
|
|
273
|
+
excludedPath = path.normalize(`${dir}/`);
|
|
274
274
|
}
|
|
275
275
|
debug('Found untracked file %s', excludedPath);
|
|
276
276
|
untrackedFiles.add(excludedPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/clasp",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4-alpha",
|
|
4
4
|
"description": "Develop Apps Script Projects locally",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./build/src/index.js",
|
|
@@ -55,81 +55,59 @@
|
|
|
55
55
|
"author": "Grant Timmerman",
|
|
56
56
|
"license": "Apache-2.0",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@formatjs/intl": "^3.1.
|
|
59
|
-
"@messageformat/core": "^3.4.0",
|
|
60
|
-
"@sindresorhus/is": "^7.0.1",
|
|
61
|
-
"@types/debug": "^4.1.12",
|
|
58
|
+
"@formatjs/intl": "^3.1.6",
|
|
62
59
|
"chalk": "^5.4.1",
|
|
63
60
|
"chokidar": "^4.0.3",
|
|
64
61
|
"cli-truncate": "^4.0.0",
|
|
65
|
-
"commander": "^13.
|
|
66
|
-
"debounce": "^2.2.0",
|
|
62
|
+
"commander": "^13.1.0",
|
|
67
63
|
"debug": "^4.4.0",
|
|
68
|
-
"
|
|
69
|
-
"fdir": "^6.4.3",
|
|
64
|
+
"fdir": "^6.4.4",
|
|
70
65
|
"find-up": "^7.0.0",
|
|
71
66
|
"fuzzy": "^0.1.3",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"googleapis": "^144.0.0",
|
|
67
|
+
"google-auth-library": "^9.15.1",
|
|
68
|
+
"googleapis": "^148.0.0",
|
|
75
69
|
"googleapis-common": "7.2.0",
|
|
76
70
|
"inflection": "^3.0.2",
|
|
77
|
-
"inquirer": "^12.
|
|
71
|
+
"inquirer": "^12.6.0",
|
|
78
72
|
"inquirer-autocomplete-standalone": "^0.8.1",
|
|
79
|
-
"log-symbols": "^7.0.0",
|
|
80
73
|
"loud-rejection": "^2.2.0",
|
|
81
|
-
"make-dir": "^5.0.0",
|
|
82
74
|
"micromatch": "^4.0.8",
|
|
83
|
-
"multimatch": "^7.0.0",
|
|
84
|
-
"normalize-newline": "^4.1.0",
|
|
85
75
|
"normalize-path": "^3.0.0",
|
|
86
|
-
"open": "^10.1.
|
|
76
|
+
"open": "^10.1.2",
|
|
87
77
|
"ora": "^8.1.1",
|
|
88
78
|
"p-map": "^7.0.3",
|
|
89
79
|
"picomatch": "^4.0.2",
|
|
90
|
-
"read-
|
|
80
|
+
"read-package-up": "^11.0.0",
|
|
91
81
|
"server-destroy": "^1.0.1",
|
|
92
82
|
"split-lines": "^3.0.0",
|
|
93
|
-
"strip-bom": "^5.0.0"
|
|
94
|
-
"typescript": "^5.7.3"
|
|
83
|
+
"strip-bom": "^5.0.0"
|
|
95
84
|
},
|
|
96
85
|
"devDependencies": {
|
|
97
86
|
"@biomejs/biome": "^1.9.4",
|
|
98
|
-
"@commander-js/extra-typings": "^13.
|
|
99
|
-
"@formatjs/ts-transformer": "^3.13.
|
|
100
|
-
"@
|
|
101
|
-
"@
|
|
102
|
-
"@types/
|
|
103
|
-
"@types/chai-as-promised": "^8.0.1",
|
|
104
|
-
"@types/chai-fs": "^2.0.5",
|
|
105
|
-
"@types/chai-subset": "^1.3.5",
|
|
106
|
-
"@types/debounce": "^1.2.4",
|
|
107
|
-
"@types/fs-extra": "^11.0.4",
|
|
87
|
+
"@commander-js/extra-typings": "^13.1.0",
|
|
88
|
+
"@formatjs/ts-transformer": "^3.13.34",
|
|
89
|
+
"@types/chai": "^5.2.2",
|
|
90
|
+
"@types/chai-as-promised": "^8.0.2",
|
|
91
|
+
"@types/debug": "^4.1.12",
|
|
108
92
|
"@types/micromatch": "^4.0.9",
|
|
109
93
|
"@types/mocha": "^10.0.10",
|
|
110
94
|
"@types/mock-fs": "^4.13.4",
|
|
111
|
-
"@types/node": "^22.
|
|
95
|
+
"@types/node": "^22.15.17",
|
|
112
96
|
"@types/normalize-path": "^3.0.2",
|
|
113
|
-
"@types/picomatch": "^
|
|
97
|
+
"@types/picomatch": "^4.0.0",
|
|
114
98
|
"@types/server-destroy": "^1.0.4",
|
|
115
99
|
"@types/sinon": "^17.0.4",
|
|
116
|
-
"@types/tmp": "^0.2.6",
|
|
117
|
-
"@types/wtfnode": "^0.7.3",
|
|
118
100
|
"c8": "^10.1.3",
|
|
119
|
-
"chai": "^5.
|
|
101
|
+
"chai": "^5.2.0",
|
|
120
102
|
"chai-as-promised": "^8.0.1",
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"nyc": "^17.1.0",
|
|
126
|
-
"sinon": "^19.0.2",
|
|
103
|
+
"mocha": "^11.2.2",
|
|
104
|
+
"mock-fs": "^5.5.0",
|
|
105
|
+
"nock": "^14.0.4",
|
|
106
|
+
"sinon": "^20.0.0",
|
|
127
107
|
"source-map-support": "^0.5.21",
|
|
128
|
-
"tmp": "^0.2.3",
|
|
129
108
|
"ts-node": "^10.9.2",
|
|
130
109
|
"ts-patch": "^3.3.0",
|
|
131
|
-
"type-fest": "^4.
|
|
132
|
-
"
|
|
133
|
-
"wtfnode": "^0.10.0"
|
|
110
|
+
"type-fest": "^4.41.0",
|
|
111
|
+
"typescript": "^5.8.3"
|
|
134
112
|
}
|
|
135
113
|
}
|