@google/clasp 2.4.2 → 3.0.0-alpha1

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.
Files changed (149) hide show
  1. package/README.md +253 -196
  2. package/build/src/auth/auth.js +176 -0
  3. package/build/src/auth/auth_code_flow.js +36 -0
  4. package/build/src/auth/credential_store.js +1 -0
  5. package/build/src/auth/file_credential_store.js +82 -0
  6. package/build/src/auth/localhost_auth_code_flow.js +62 -0
  7. package/build/src/auth/serverless_auth_code_flow.js +32 -0
  8. package/build/src/commands/clone-script.js +71 -0
  9. package/build/src/commands/create-deployment.js +33 -0
  10. package/build/src/commands/create-script.js +75 -0
  11. package/build/src/commands/create-version.js +31 -0
  12. package/build/src/commands/delete-deployment.js +71 -0
  13. package/build/src/commands/disable-api.js +19 -0
  14. package/build/src/commands/enable-api.js +31 -0
  15. package/build/src/commands/list-apis.js +23 -0
  16. package/build/src/commands/list-deployments.js +30 -0
  17. package/build/src/commands/list-scripts.js +28 -0
  18. package/build/src/commands/list-versions.js +29 -0
  19. package/build/src/commands/login.js +54 -53
  20. package/build/src/commands/logout.js +15 -15
  21. package/build/src/commands/open-apis.js +11 -0
  22. package/build/src/commands/open-container.js +15 -0
  23. package/build/src/commands/open-credentials.js +11 -0
  24. package/build/src/commands/open-logs.js +11 -0
  25. package/build/src/commands/open-script.js +18 -0
  26. package/build/src/commands/open-webapp.js +56 -0
  27. package/build/src/commands/program.js +108 -0
  28. package/build/src/commands/pull.js +19 -18
  29. package/build/src/commands/push.js +64 -74
  30. package/build/src/commands/run-function.js +61 -0
  31. package/build/src/commands/setup-logs.js +12 -0
  32. package/build/src/commands/show-authorized-user.js +18 -0
  33. package/build/src/commands/show-file-status.js +34 -0
  34. package/build/src/commands/tail-logs.js +92 -0
  35. package/build/src/commands/utils.js +82 -0
  36. package/build/src/constants.js +0 -3
  37. package/build/src/{apis.js → core/apis.js} +90 -92
  38. package/build/src/core/clasp.js +171 -0
  39. package/build/src/core/files.js +359 -0
  40. package/build/src/core/functions.js +51 -0
  41. package/build/src/core/logs.js +41 -0
  42. package/build/src/core/manifest.js +1 -0
  43. package/build/src/core/project.js +313 -0
  44. package/build/src/core/services.js +179 -0
  45. package/build/src/core/utils.js +121 -0
  46. package/build/src/index.js +16 -354
  47. package/build/src/intl.js +34 -0
  48. package/docs/README.md +1 -4
  49. package/docs/config-files.md +4 -5
  50. package/docs/run.md +26 -7
  51. package/package.json +87 -51
  52. package/CHANGELOG.md +0 -66
  53. package/build/src/apis.d.ts +0 -34
  54. package/build/src/apis.js.map +0 -1
  55. package/build/src/apiutils.d.ts +0 -16
  56. package/build/src/apiutils.js +0 -81
  57. package/build/src/apiutils.js.map +0 -1
  58. package/build/src/auth.d.ts +0 -34
  59. package/build/src/auth.js +0 -295
  60. package/build/src/auth.js.map +0 -1
  61. package/build/src/clasp-error.d.ts +0 -3
  62. package/build/src/clasp-error.js +0 -10
  63. package/build/src/clasp-error.js.map +0 -1
  64. package/build/src/commands/apis.d.ts +0 -10
  65. package/build/src/commands/apis.js +0 -91
  66. package/build/src/commands/apis.js.map +0 -1
  67. package/build/src/commands/clone.d.ts +0 -13
  68. package/build/src/commands/clone.js +0 -59
  69. package/build/src/commands/clone.js.map +0 -1
  70. package/build/src/commands/create.d.ts +0 -16
  71. package/build/src/commands/create.js +0 -81
  72. package/build/src/commands/create.js.map +0 -1
  73. package/build/src/commands/default.d.ts +0 -8
  74. package/build/src/commands/default.js +0 -10
  75. package/build/src/commands/default.js.map +0 -1
  76. package/build/src/commands/deploy.d.ts +0 -13
  77. package/build/src/commands/deploy.js +0 -51
  78. package/build/src/commands/deploy.js.map +0 -1
  79. package/build/src/commands/deployments.d.ts +0 -5
  80. package/build/src/commands/deployments.js +0 -29
  81. package/build/src/commands/deployments.js.map +0 -1
  82. package/build/src/commands/list.d.ts +0 -9
  83. package/build/src/commands/list.js +0 -34
  84. package/build/src/commands/list.js.map +0 -1
  85. package/build/src/commands/login.d.ts +0 -14
  86. package/build/src/commands/login.js.map +0 -1
  87. package/build/src/commands/logout.d.ts +0 -5
  88. package/build/src/commands/logout.js.map +0 -1
  89. package/build/src/commands/logs.d.ts +0 -17
  90. package/build/src/commands/logs.js +0 -181
  91. package/build/src/commands/logs.js.map +0 -1
  92. package/build/src/commands/open.d.ts +0 -15
  93. package/build/src/commands/open.js +0 -89
  94. package/build/src/commands/open.js.map +0 -1
  95. package/build/src/commands/pull.d.ts +0 -10
  96. package/build/src/commands/pull.js.map +0 -1
  97. package/build/src/commands/push.d.ts +0 -11
  98. package/build/src/commands/push.js.map +0 -1
  99. package/build/src/commands/run.d.ts +0 -14
  100. package/build/src/commands/run.js +0 -130
  101. package/build/src/commands/run.js.map +0 -1
  102. package/build/src/commands/setting.d.ts +0 -8
  103. package/build/src/commands/setting.js +0 -53
  104. package/build/src/commands/setting.js.map +0 -1
  105. package/build/src/commands/status.d.ts +0 -9
  106. package/build/src/commands/status.js +0 -25
  107. package/build/src/commands/status.js.map +0 -1
  108. package/build/src/commands/undeploy.d.ts +0 -9
  109. package/build/src/commands/undeploy.js +0 -55
  110. package/build/src/commands/undeploy.js.map +0 -1
  111. package/build/src/commands/version.d.ts +0 -5
  112. package/build/src/commands/version.js +0 -22
  113. package/build/src/commands/version.js.map +0 -1
  114. package/build/src/commands/versions.d.ts +0 -5
  115. package/build/src/commands/versions.js +0 -41
  116. package/build/src/commands/versions.js.map +0 -1
  117. package/build/src/conf.d.ts +0 -40
  118. package/build/src/conf.js +0 -100
  119. package/build/src/conf.js.map +0 -1
  120. package/build/src/constants.d.ts +0 -6
  121. package/build/src/constants.js.map +0 -1
  122. package/build/src/dotfile.d.ts +0 -50
  123. package/build/src/dotfile.js +0 -71
  124. package/build/src/dotfile.js.map +0 -1
  125. package/build/src/files.d.ts +0 -70
  126. package/build/src/files.js +0 -318
  127. package/build/src/files.js.map +0 -1
  128. package/build/src/index.d.ts +0 -18
  129. package/build/src/index.js.map +0 -1
  130. package/build/src/inquirer.d.ts +0 -82
  131. package/build/src/inquirer.js +0 -111
  132. package/build/src/inquirer.js.map +0 -1
  133. package/build/src/manifest.d.ts +0 -123
  134. package/build/src/manifest.js +0 -142
  135. package/build/src/manifest.js.map +0 -1
  136. package/build/src/messages.d.ts +0 -110
  137. package/build/src/messages.js +0 -161
  138. package/build/src/messages.js.map +0 -1
  139. package/build/src/urls.d.ts +0 -21
  140. package/build/src/urls.js +0 -33
  141. package/build/src/urls.js.map +0 -1
  142. package/build/src/utils.d.ts +0 -102
  143. package/build/src/utils.js +0 -232
  144. package/build/src/utils.js.map +0 -1
  145. package/docs/develop.md +0 -81
  146. package/docs/esmodules.md +0 -81
  147. package/docs/running-locally.md +0 -31
  148. package/docs/settings.md +0 -56
  149. package/docs/typescript.md +0 -354
@@ -1,71 +0,0 @@
1
- /**
2
- * Manages dotfiles. There are 2 types of dotfiles:
3
- *
4
- * Global clasp auth settings:
5
- * - File: ~/.clasp.json
6
- * - Default credentials for clasp projects.
7
- *
8
- * Local clasp auth settings:
9
- * - File: .clasp.json
10
- * - Requires `clasp login --creds creds.json`
11
- *
12
- * This should be the only file that uses DOTFILE.
13
- */
14
- import dotf from 'dotf';
15
- import fs from 'fs-extra';
16
- import path from 'path';
17
- import splitLines from 'split-lines';
18
- import stripBom from 'strip-bom';
19
- import { Conf } from './conf.js';
20
- import { FS_OPTIONS } from './constants.js';
21
- const config = Conf.get();
22
- const defaultClaspignore = `# ignore all files…
23
- **/**
24
-
25
- # except the extensions…
26
- !appsscript.json
27
- !**/*.gs
28
- !**/*.js
29
- !**/*.ts
30
- !**/*.html
31
-
32
- # ignore even valid files if in…
33
- .git/**
34
- node_modules/**
35
- `;
36
- // Methods for retrieving dotfiles.
37
- export const DOTFILE = {
38
- /**
39
- * Reads ignore.resolve() to get a glob pattern of ignored paths.
40
- * @return {Promise<string[]>} A list of file glob patterns
41
- */
42
- IGNORE: async () => {
43
- const ignorePath = config.ignore;
44
- const content = ignorePath && fs.existsSync(ignorePath) ? fs.readFileSync(ignorePath, FS_OPTIONS) : defaultClaspignore;
45
- return splitLines(stripBom(content)).filter((name) => name.length > 0);
46
- },
47
- /**
48
- * Gets the closest DOT.PROJECT.NAME in the parent directory of the directory
49
- * that the command was run in.
50
- * @return {Dotf} A dotf with that dotfile. Null if there is no file
51
- */
52
- PROJECT: () => {
53
- // ! TODO: currently limited if filename doesn't start with a dot '.'
54
- const { dir, base } = path.parse(config.projectConfig);
55
- if (base.startsWith('.')) {
56
- return dotf(dir || '.', base.slice(1));
57
- }
58
- throw new Error('Project file must start with a dot (i.e. .clasp.json)');
59
- },
60
- // Stores {ClaspCredentials}
61
- AUTH: (local) => {
62
- const configPath = local ? config.authLocal : config.auth;
63
- // ! TODO: currently limited if filename doesn't start with a dot '.'
64
- const { dir, base } = path.parse(configPath);
65
- if (base.startsWith('.')) {
66
- return dotf(dir || '.', base.slice(1));
67
- }
68
- throw new Error('Auth file must start with a dot (i.e. .clasp.json)');
69
- },
70
- };
71
- //# sourceMappingURL=dotfile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dotfile.js","sourceRoot":"","sources":["../../src/dotfile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAM1C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAY1B,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;CAa1B,CAAC;AAEF,mCAAmC;AACnC,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB;;;OAGG;IACH,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAA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AC;CACF,CAAC"}
@@ -1,70 +0,0 @@
1
- interface AppsScriptFile {
2
- readonly name: string;
3
- readonly source: string;
4
- readonly type: string;
5
- }
6
- interface ProjectFile {
7
- readonly isIgnored: boolean;
8
- readonly name: string;
9
- readonly source: string;
10
- readonly type: string;
11
- }
12
- /**
13
- * Return an array of `ProjectFile` objects
14
- *
15
- * Recursively finds all files that are part of the current project, including those that are ignored by .claspignore
16
- *
17
- * > Note: content for each file is not returned. Use `getContentOfProjectFiles()` on the resulting array.
18
- *
19
- * @param rootDir the project's `rootDir`
20
- */
21
- export declare const getAllProjectFiles: (rootDir?: string) => Promise<ProjectFile[]>;
22
- export declare const splitProjectFiles: (files: ProjectFile[]) => [ProjectFile[], ProjectFile[]];
23
- export declare const getOrderedProjectFiles: (files: ProjectFile[], filePushOrder: string[] | undefined) => ProjectFile[];
24
- /**
25
- * Gets the local file type from the API FileType.
26
- * @param {string} type The file type returned by Apps Script
27
- * @return {string} The file type
28
- * @see https://developers.google.com/apps-script/api/reference/rest/v1/File#FileType
29
- */
30
- export declare const getLocalFileType: (type: string, fileExtension?: string | undefined) => string;
31
- /**
32
- * Returns true if the user has a clasp project.
33
- * @returns {boolean} If .clasp.json exists.
34
- */
35
- export declare const hasProject: () => boolean;
36
- /**
37
- * @deprecated If the file is valid, add it to our file list.
38
- * We generally want to allow for all file types, including files in node_modules/.
39
- * However, node_modules/@types/ files should be ignored.
40
- */
41
- export declare const isValidFileName: (name: string, type: string, rootDir: string, _normalizedName: string, ignoreMatches: readonly string[]) => boolean;
42
- /**
43
- * Gets the name of the file for Apps Script.
44
- * Formats rootDir/appsscript.json to appsscript.json.
45
- * Preserves subdirectory names in rootDir
46
- * (rootDir/foo/Code.js becomes foo/Code.js)
47
- * @param {string} rootDir The directory to save the project files to.
48
- * @param {string} filePath Path of file that is part of the current project
49
- */
50
- export declare const getAppsScriptFileName: (rootDir: string, filePath: string) => string;
51
- /**
52
- * Fetches the files for a project from the server
53
- * @param {string} scriptId The project script id
54
- * @param {number?} versionNumber The version of files to fetch.
55
- * @returns {AppsScriptFile[]} Fetched files
56
- */
57
- export declare const fetchProject: (scriptId: string, versionNumber?: number | undefined, silent?: boolean) => Promise<AppsScriptFile[]>;
58
- /**
59
- * Writes files locally to `pwd` with dots converted to subdirectories.
60
- * @param {AppsScriptFile[]} Files to wirte
61
- * @param {string?} rootDir The directory to save the project files to. Defaults to `pwd`
62
- */
63
- export declare const writeProjectFiles: (files: AppsScriptFile[], rootDir?: string) => Promise<void>;
64
- /**
65
- * Pushes project files to script.google.com.
66
- * @param {boolean} silent If true, doesn't console.log any success message.
67
- */
68
- export declare const pushFiles: (silent?: boolean) => Promise<void>;
69
- export declare const logFileList: (files: readonly string[]) => void;
70
- export {};
@@ -1,318 +0,0 @@
1
- import fs from 'fs-extra';
2
- import makeDir from 'make-dir';
3
- import multimatch from 'multimatch';
4
- import path from 'path';
5
- import pMap from 'p-map';
6
- import recursive from 'recursive-readdir';
7
- import typescript from 'typescript';
8
- import { loadAPICredentials, script } from './auth.js';
9
- import { ClaspError } from './clasp-error.js';
10
- import { Conf } from './conf.js';
11
- import { FS_OPTIONS, PROJECT_MANIFEST_FILENAME } from './constants.js';
12
- import { DOTFILE } from './dotfile.js';
13
- import { ERROR, LOG } from './messages.js';
14
- import { getApiFileType, getErrorMessage, getProjectSettings, spinner, stopSpinner } from './utils.js';
15
- const { parseConfigFileTextToJson } = typescript;
16
- const config = Conf.get();
17
- async function transpile(source, transpileOptions) {
18
- const ts2gas = await import('ts2gas');
19
- return ts2gas.default(source, transpileOptions);
20
- }
21
- async function projectFileWithContent(file, transpileOptions) {
22
- const content = await fs.readFile(file.name);
23
- let source = content.toString();
24
- let type = getApiFileType(file.name);
25
- if (type === 'TS') {
26
- source = await transpile(source, transpileOptions);
27
- type = 'SERVER_JS';
28
- }
29
- return { ...file, source, type };
30
- }
31
- const ignoredProjectFile = (file) => ({ ...file, source: '', isIgnored: true, type: '' });
32
- const isValidFactory = (rootDir) => {
33
- const validManifestPath = rootDir ? path.join(rootDir, PROJECT_MANIFEST_FILENAME) : PROJECT_MANIFEST_FILENAME;
34
- /**
35
- * Validates a file:
36
- *
37
- * - is a manifest file
38
- * - type is either `SERVER_JS` or `HTML` @see https://developers.google.com/apps-script/api/reference/rest/v1/File
39
- */
40
- return (file) => Boolean(file.type === 'JSON' // Has a type or is appsscript.json
41
- ? (rootDir ? path.normalize(file.name) : file.name) === validManifestPath
42
- : file.type === 'SERVER_JS' || file.type === 'HTML');
43
- };
44
- /**
45
- * Return an array of `ProjectFile` objects
46
- *
47
- * Recursively finds all files that are part of the current project, including those that are ignored by .claspignore
48
- *
49
- * > Note: content for each file is not returned. Use `getContentOfProjectFiles()` on the resulting array.
50
- *
51
- * @param rootDir the project's `rootDir`
52
- */
53
- export const getAllProjectFiles = async (rootDir = path.join('.', '/')) => {
54
- try {
55
- const ignorePatterns = await DOTFILE.IGNORE();
56
- const isIgnored = (file) => multimatch(path.relative(rootDir, file), ignorePatterns, { dot: true }).length > 0;
57
- const isValid = isValidFactory(rootDir);
58
- // Read all filenames as a flattened tree
59
- // Note: filePaths contain relative paths such as "test/bar.ts", "../../src/foo.js"
60
- const files = (await recursive(rootDir)).map((filename) => {
61
- // Replace OS specific path separator to common '/' char for console output
62
- const name = filename.replace(/\\/g, '/');
63
- return { source: '', isIgnored: isIgnored(name), name, type: '' };
64
- });
65
- files.sort((a, b) => a.name.localeCompare(b.name));
66
- const filesWithContent = await getContentOfProjectFiles(files);
67
- return filesWithContent.map((file) => {
68
- // Loop through files that are not ignored from `.claspignore`
69
- if (!file.isIgnored) {
70
- // Prevent node_modules/@types/
71
- if (file.name.includes('node_modules/@types')) {
72
- return ignoredProjectFile(file);
73
- }
74
- // Check if there are files that will conflict if renamed .gs to .js.
75
- // When pushing to Apps Script, these files will overwrite each other.
76
- const parsed = path.parse(file.name);
77
- if (parsed.ext === '.gs') {
78
- const jsFile = `${parsed.dir}/${parsed.name}.js`;
79
- // Can't rename, conflicting files
80
- // Only print error once (for .gs)
81
- if (files.findIndex(otherFile => !otherFile.isIgnored && otherFile.name === jsFile) !== -1) {
82
- throw new ClaspError(ERROR.CONFLICTING_FILE_EXTENSION(`${parsed.dir}/${parsed.name}`));
83
- }
84
- }
85
- return isValid(file) ? file : ignoredProjectFile(file);
86
- }
87
- return file;
88
- });
89
- }
90
- catch (error) {
91
- if (error instanceof ClaspError) {
92
- throw error;
93
- }
94
- // TODO improve error handling
95
- throw error;
96
- }
97
- };
98
- export const splitProjectFiles = (files) => [
99
- files.filter(file => !file.isIgnored),
100
- files.filter(file => file.isIgnored),
101
- ];
102
- async function getContentOfProjectFiles(files) {
103
- const transpileOpttions = getTranspileOptions();
104
- const getContent = (file) => (file.isIgnored ? file : projectFileWithContent(file, transpileOpttions));
105
- return Promise.all(files.map(getContent));
106
- }
107
- async function getAppsScriptFilesFromProjectFiles(files, rootDir) {
108
- const filesWithContent = await getContentOfProjectFiles(files);
109
- return filesWithContent.map(file => {
110
- const { name, source, type } = file;
111
- return {
112
- name: getAppsScriptFileName(rootDir, name),
113
- source,
114
- type, // The file extension
115
- };
116
- });
117
- }
118
- // This statement customizes the order in which the files are pushed.
119
- // It puts the files in the setting's filePushOrder first.
120
- // This is needed because Apps Script blindly executes files in order of creation time.
121
- // The Apps Script API updates the creation time of files.
122
- export const getOrderedProjectFiles = (files, filePushOrder) => {
123
- const orderedFiles = [...files];
124
- if (filePushOrder && filePushOrder.length > 0) {
125
- // stopSpinner();
126
- console.log('Detected filePushOrder setting. Pushing these files first:');
127
- logFileList(filePushOrder);
128
- console.log('');
129
- orderedFiles.sort((a, b) => {
130
- // Get the file order index
131
- const indexA = filePushOrder.indexOf(a.name);
132
- const indexB = filePushOrder.indexOf(b.name);
133
- // If a file path isn't in the filePushOrder array, set the order to +∞.
134
- return (indexA > -1 ? indexA : Number.POSITIVE_INFINITY) - (indexB > -1 ? indexB : Number.POSITIVE_INFINITY);
135
- });
136
- }
137
- return orderedFiles;
138
- };
139
- // // Used to receive files tracked by current project
140
- // type FilesCallback = (error: Error | boolean, result: [string[], string[]], files: Array<AppsScriptFile>) => void;
141
- /**
142
- * Gets the local file type from the API FileType.
143
- * @param {string} type The file type returned by Apps Script
144
- * @return {string} The file type
145
- * @see https://developers.google.com/apps-script/api/reference/rest/v1/File#FileType
146
- */
147
- export const getLocalFileType = (type, fileExtension) => type === 'SERVER_JS' ? fileExtension !== null && fileExtension !== void 0 ? fileExtension : 'js' : type.toLowerCase();
148
- /**
149
- * Returns true if the user has a clasp project.
150
- * @returns {boolean} If .clasp.json exists.
151
- */
152
- export const hasProject = () => config.projectConfig !== undefined && fs.existsSync(config.projectConfig);
153
- /**
154
- * Returns in tsconfig.json.
155
- * @returns {TranspileOptions} if tsconfig.json not exists, return an empty object.
156
- */
157
- const getTranspileOptions = () => {
158
- const tsconfigPath = path.join(config.projectRootDirectory, 'tsconfig.json');
159
- return fs.existsSync(tsconfigPath)
160
- ? {
161
- compilerOptions: parseConfigFileTextToJson(tsconfigPath, fs.readFileSync(tsconfigPath, FS_OPTIONS)).config
162
- .compilerOptions,
163
- }
164
- : {};
165
- };
166
- // /**
167
- // * Recursively finds all files that are part of the current project, and those that are ignored
168
- // * by .claspignore and calls the passed callback function with the file lists.
169
- // * @param {string} rootDir The project's root directory
170
- // * @param {FilesCallBack} callback The callback will be called with the following paramters
171
- // * error: Error if there's an error, otherwise null
172
- // * result: string[][], array of two lists of strings, ie. [validFilePaths,ignoredFilePaths]
173
- // * files?: Array<AppsScriptFile> Array of AppsScriptFile objects used by clasp push
174
- // * @todo Make this function actually return a Promise that can be awaited.
175
- // */
176
- // export const getProjectFiles = async (rootDir: string = path.join('.', '/'), callback: FilesCallback) => {
177
- // try {
178
- // const {filePushOrder} = await getProjectSettings();
179
- // const allFiles = await getAllProjectFiles(rootDir);
180
- // const [filesToPush, filesToIgnore] = splitProjectFiles(allFiles);
181
- // const orderedFiles = getOrderedProjectFiles(filesToPush, filePushOrder);
182
- // callback(
183
- // false,
184
- // [orderedFiles.map(file => file.name), filesToIgnore.map(file => file.name)],
185
- // getAppsScriptFilesFromProjectFiles(orderedFiles, rootDir)
186
- // );
187
- // } catch (error) {
188
- // return callback(error, [[], []], []);
189
- // }
190
- // };
191
- /**
192
- * @deprecated If the file is valid, add it to our file list.
193
- * We generally want to allow for all file types, including files in node_modules/.
194
- * However, node_modules/@types/ files should be ignored.
195
- */
196
- export const isValidFileName = (name, type, rootDir, _normalizedName, ignoreMatches) => {
197
- const isValid = isValidFactory(rootDir);
198
- return Boolean(!name.includes('node_modules/@types') && // Prevent node_modules/@types/
199
- isValid({ source: '', isIgnored: false, name, type }) &&
200
- !ignoreMatches.includes(name) // Must be SERVER_JS or HTML. https://developers.google.com/apps-script/api/reference/rest/v1/File
201
- );
202
- };
203
- /**
204
- * Gets the name of the file for Apps Script.
205
- * Formats rootDir/appsscript.json to appsscript.json.
206
- * Preserves subdirectory names in rootDir
207
- * (rootDir/foo/Code.js becomes foo/Code.js)
208
- * @param {string} rootDir The directory to save the project files to.
209
- * @param {string} filePath Path of file that is part of the current project
210
- */
211
- export const getAppsScriptFileName = (rootDir, filePath) => {
212
- const nameWithoutExt = filePath.slice(0, -path.extname(filePath).length);
213
- // Replace OS specific path separator to common '/' char
214
- return (rootDir ? path.relative(rootDir, nameWithoutExt) : nameWithoutExt).replace(/\\/g, '/');
215
- };
216
- /**
217
- * Fetches the files for a project from the server
218
- * @param {string} scriptId The project script id
219
- * @param {number?} versionNumber The version of files to fetch.
220
- * @returns {AppsScriptFile[]} Fetched files
221
- */
222
- export const fetchProject = async (scriptId, versionNumber, silent = false) => {
223
- await loadAPICredentials();
224
- spinner.start();
225
- let response;
226
- try {
227
- response = await script.projects.getContent({ scriptId, versionNumber });
228
- }
229
- catch (error) {
230
- if (error instanceof ClaspError) {
231
- throw error;
232
- }
233
- if (error.statusCode === 404) {
234
- throw new ClaspError(ERROR.SCRIPT_ID_INCORRECT(scriptId));
235
- }
236
- throw new ClaspError(ERROR.SCRIPT_ID);
237
- }
238
- stopSpinner();
239
- const { files } = response.data;
240
- if (!files) {
241
- throw new ClaspError(ERROR.SCRIPT_ID_INCORRECT(scriptId));
242
- }
243
- if (!silent) {
244
- console.log(LOG.CLONE_SUCCESS(files.length));
245
- }
246
- return files;
247
- };
248
- /**
249
- * Writes files locally to `pwd` with dots converted to subdirectories.
250
- * @param {AppsScriptFile[]} Files to wirte
251
- * @param {string?} rootDir The directory to save the project files to. Defaults to `pwd`
252
- */
253
- export const writeProjectFiles = async (files, rootDir = '') => {
254
- var _a;
255
- try {
256
- const { fileExtension } = await getProjectSettings();
257
- const mapper = async (file) => {
258
- var _a;
259
- const filePath = `${file.name}.${getLocalFileType(file.type, fileExtension)}`;
260
- const truePath = `${rootDir || '.'}/${filePath}`;
261
- try {
262
- await makeDir(path.dirname(truePath));
263
- await fs.writeFile(truePath, file.source);
264
- }
265
- catch (error) {
266
- throw new ClaspError((_a = getErrorMessage(error)) !== null && _a !== void 0 ? _a : ERROR.FS_FILE_WRITE);
267
- }
268
- // Log only filename if pulling to root (Code.gs vs ./Code.gs)
269
- console.log(`└─ ${rootDir ? truePath : filePath}`);
270
- };
271
- const fileList = files.filter(file => file.source); // Disallow empty files
272
- fileList.sort((a, b) => a.name.localeCompare(b.name));
273
- await pMap(fileList, mapper);
274
- }
275
- catch (error) {
276
- if (error instanceof ClaspError) {
277
- throw error;
278
- }
279
- throw new ClaspError((_a = getErrorMessage(error)) !== null && _a !== void 0 ? _a : ERROR.FS_DIR_WRITE);
280
- }
281
- };
282
- /**
283
- * Pushes project files to script.google.com.
284
- * @param {boolean} silent If true, doesn't console.log any success message.
285
- */
286
- export const pushFiles = async (silent = false) => {
287
- const { filePushOrder, scriptId, rootDir } = await getProjectSettings();
288
- if (scriptId) {
289
- const [toPush] = splitProjectFiles(await getAllProjectFiles(rootDir));
290
- if (toPush.length > 0) {
291
- const orderedFiles = getOrderedProjectFiles(toPush, filePushOrder);
292
- const files = await getAppsScriptFilesFromProjectFiles(orderedFiles, rootDir !== null && rootDir !== void 0 ? rootDir : path.join('.', '/'));
293
- const filenames = orderedFiles.map(file => file.name);
294
- // Start pushing.
295
- try {
296
- await script.projects.updateContent({ scriptId, requestBody: { scriptId, files } });
297
- }
298
- catch (error) {
299
- console.error(LOG.PUSH_FAILURE);
300
- console.error(error);
301
- }
302
- finally {
303
- stopSpinner();
304
- // No error
305
- if (!silent) {
306
- logFileList(filenames);
307
- console.log(LOG.PUSH_SUCCESS(filenames.length));
308
- }
309
- }
310
- }
311
- else {
312
- stopSpinner();
313
- console.log(LOG.PUSH_NO_FILES);
314
- }
315
- }
316
- };
317
- export const logFileList = (files) => console.log(files.map(file => `└─ ${file}`).join('\n'));
318
- //# sourceMappingURL=files.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAC,kBAAkB,EAAE,MAAM,EAAC,MAAM,WAAW,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAE,yBAAyB,EAAC,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,KAAK,EAAE,GAAG,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,YAAY,CAAC;AAIrG,MAAM,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AC,CAAC;aACtB;oBAAS;gBACR,WAAW,EAAE,CAAC;gBAEd,WAAW;gBACX,IAAI,CAAC,MAAM,EAAE;oBACX,WAAW,CAAC,SAAS,CAAC,CAAC;oBACvB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;iBACjD;aACF;SACF;aAAM;YACL,WAAW,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;SAChC;KACF;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * @license
4
- * Copyright Google Inc.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * https://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- export {};
@@ -1 +0,0 @@
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;A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O,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,82 +0,0 @@
1
- import { script_v1 as scriptV1 } from 'googleapis';
2
- import type { ReadonlyDeep } from 'type-fest';
3
- export declare type functionNameSource = (answers: {
4
- readonly functionName: string;
5
- }, input?: string | undefined) => Promise<string[]>;
6
- /**
7
- * Inquirer prompt for a functionName.
8
- * @returns {Promise<{ functionName: string }>} A promise for an object with the `functionName` property.
9
- */
10
- export declare const functionNamePrompt: (source: functionNameSource) => Promise<{
11
- functionName: string;
12
- }> & {
13
- ui: import("inquirer/lib/ui/prompt");
14
- };
15
- export interface DeploymentIdPromptChoice {
16
- name: string;
17
- value: scriptV1.Schema$Deployment;
18
- }
19
- /**
20
- * Inquirer prompt for a deployment Id.
21
- * @param {DeploymentIdChoice[]} choices An array of `DeploymentIdChoice` objects.
22
- * @returns {Promise<{ deploymentId: string }>} A promise for an object with the `deploymentId` property.
23
- */
24
- export declare const deploymentIdPrompt: (choices: ReadonlyArray<ReadonlyDeep<DeploymentIdPromptChoice>>) => Promise<{
25
- deployment: scriptV1.Schema$Deployment;
26
- }> & {
27
- ui: import("inquirer/lib/ui/prompt");
28
- };
29
- /**
30
- * Inquirer prompt for a project description.
31
- * @returns {Promise<{ description: string }>} A promise for an object with the `description` property.
32
- */
33
- export declare const descriptionPrompt: () => Promise<{
34
- description: string;
35
- }> & {
36
- ui: import("inquirer/lib/ui/prompt");
37
- };
38
- export interface PromptAnswers {
39
- doAuth: boolean;
40
- localhost: boolean;
41
- }
42
- /**
43
- * Inquirer prompt for overwriting a manifest.
44
- * @returns {Promise<{ overwrite: boolean }>} A promise for an object with the `overwrite` property.
45
- */
46
- export declare const overwritePrompt: () => Promise<{
47
- overwrite: boolean;
48
- }> & {
49
- ui: import("inquirer/lib/ui/prompt");
50
- };
51
- /**
52
- * Inquirer prompt for project Id.
53
- * @returns {Promise<{ projectId: string }>} A promise for an object with the `projectId` property.
54
- */
55
- export declare const projectIdPrompt: () => Promise<{
56
- readonly projectId: string;
57
- }> & {
58
- ui: import("inquirer/lib/ui/prompt");
59
- };
60
- export interface ScriptIdPrompt {
61
- name: string;
62
- value: string;
63
- }
64
- /**
65
- * Inquirer prompt for script Id.
66
- * @param {ScriptIdPrompt[]} fileIds An array of `ScriptIdPrompt` objects.
67
- * @returns {Promise<{scriptId: string;}>} A promise for an object with the `scriptId` property.
68
- */
69
- export declare const scriptIdPrompt: (fileIds: ReadonlyArray<Readonly<ScriptIdPrompt>>) => Promise<{
70
- scriptId: string;
71
- }> & {
72
- ui: import("inquirer/lib/ui/prompt");
73
- };
74
- /**
75
- * Inquirer prompt for script type.
76
- * @returns {Promise<{ type: string }>} A promise for an object with the `type` property.
77
- */
78
- export declare const scriptTypePrompt: () => Promise<{
79
- type: string;
80
- }> & {
81
- ui: import("inquirer/lib/ui/prompt");
82
- };