diff --git a/.claspignore b/.claspignore new file mode 100644 index 00000000..ec576b4c --- /dev/null +++ b/.claspignore @@ -0,0 +1,16 @@ +# ignore all files… +**/** + +# except the extensions… +!appsscript.json +!**/*.gs +!**/*.js +!**/*.ts +!**/*.html + +# ignore even valid files if in… +.git/** +node_modules/** + +# and Python virtual environments +.venv/** diff --git a/.gitignore b/.gitignore index d52acf36..2d7e6217 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ yarn-debug.log* yarn-error.log* .npm .env +.venv* .nyc_output *.lock diff --git a/package-lock.json b/package-lock.json index 72078dc5..f5bdf2fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "commander": "^8.1.0", "debounce": "^1.2.1", "dotf": "^2.0.2", + "fdir": "^6.1.1", "find-up": "^6.0.0", "fs-extra": "^10.0.0", "fuzzy": "^0.1.3", @@ -34,7 +35,6 @@ "ora": "^6.0.0", "p-map": "^5.1.0", "read-pkg-up": "^8.0.0", - "recursive-readdir": "^2.2.2", "server-destroy": "^1.0.1", "split-lines": "^3.0.0", "strip-bom": "^5.0.0", @@ -51,7 +51,7 @@ "@types/inquirer": "^7.3.3", "@types/mocha": "^9.0.0", "@types/node": "^12.20.21", - "@types/recursive-readdir": "^2.2.0", + "@types/picomatch": "^2.3.4", "@types/server-destroy": "^1.0.1", "@types/tmp": "^0.2.1", "@types/wtfnode": "^0.7.0", @@ -921,14 +921,12 @@ "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" }, - "node_modules/@types/recursive-readdir": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@types/recursive-readdir/-/recursive-readdir-2.2.0.tgz", - "integrity": "sha512-HGk753KRu2N4mWduovY4BLjYq4jTOL29gV2OfGdGxHcPSWGFkC5RRIdk+VTs5XmYd7MVAD+JwKrcb5+5Y7FOCg==", + "node_modules/@types/picomatch": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.4.tgz", + "integrity": "sha512-0so8lU8O5zatZS/2Fi4zrwks+vZv7e0dygrgEZXljODXBig97l4cPQD+9LabXfGJOWwoRkTVz6Q4edZvD12UOA==", "dev": true, - "dependencies": { - "@types/node": "*" - } + "license": "MIT" }, "node_modules/@types/responselike": { "version": "1.0.0", @@ -1387,6 +1385,18 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", @@ -2945,6 +2955,20 @@ "reusify": "^1.0.4" } }, + "node_modules/fdir": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.1.1.tgz", + "integrity": "sha512-QfKBVg453Dyn3mr0Q0O+Tkr1r79lOTAKSi9f/Ot4+qVEwxWhav2Z+SudrG9vQjM2aYRMQQZ2/Q1zdA8ACM1pDg==", + "license": "MIT", + "peerDependencies": { + "picomatch": "3.x" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -4908,6 +4932,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mime-db": { "version": "1.47.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", @@ -6150,11 +6187,14 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-3.0.1.tgz", + "integrity": "sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==", + "license": "MIT", + "optional": true, + "peer": true, "engines": { - "node": ">=8.6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -6558,15 +6598,16 @@ "node": ">=8.10.0" } }, - "node_modules/recursive-readdir": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", - "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", - "dependencies": { - "minimatch": "^3.0.5" - }, + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", "engines": { - "node": ">=6.0.0" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/redent": { @@ -8470,14 +8511,11 @@ "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" }, - "@types/recursive-readdir": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@types/recursive-readdir/-/recursive-readdir-2.2.0.tgz", - "integrity": "sha512-HGk753KRu2N4mWduovY4BLjYq4jTOL29gV2OfGdGxHcPSWGFkC5RRIdk+VTs5XmYd7MVAD+JwKrcb5+5Y7FOCg==", - "dev": true, - "requires": { - "@types/node": "*" - } + "@types/picomatch": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.4.tgz", + "integrity": "sha512-0so8lU8O5zatZS/2Fi4zrwks+vZv7e0dygrgEZXljODXBig97l4cPQD+9LabXfGJOWwoRkTVz6Q4edZvD12UOA==", + "dev": true }, "@types/responselike": { "version": "1.0.0", @@ -8784,6 +8822,13 @@ "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" + }, + "dependencies": { + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + } } }, "append-transform": { @@ -9934,6 +9979,12 @@ "reusify": "^1.0.4" } }, + "fdir": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.1.1.tgz", + "integrity": "sha512-QfKBVg453Dyn3mr0Q0O+Tkr1r79lOTAKSi9f/Ot4+qVEwxWhav2Z+SudrG9vQjM2aYRMQQZ2/Q1zdA8ACM1pDg==", + "requires": {} + }, "figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -11364,6 +11415,14 @@ "requires": { "braces": "^3.0.1", "picomatch": "^2.2.3" + }, + "dependencies": { + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + } } }, "mime-db": { @@ -12264,9 +12323,11 @@ "dev": true }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-3.0.1.tgz", + "integrity": "sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==", + "optional": true, + "peer": true }, "pkg-dir": { "version": "4.2.0", @@ -12535,14 +12596,13 @@ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "requires": { "picomatch": "^2.2.1" - } - }, - "recursive-readdir": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", - "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", - "requires": { - "minimatch": "^3.0.5" + }, + "dependencies": { + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + } } }, "redent": { diff --git a/package.json b/package.json index 5c103d4f..496aea14 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "commander": "^8.1.0", "debounce": "^1.2.1", "dotf": "^2.0.2", + "fdir": "^6.1.1", "find-up": "^6.0.0", "fs-extra": "^10.0.0", "fuzzy": "^0.1.3", @@ -85,7 +86,6 @@ "ora": "^6.0.0", "p-map": "^5.1.0", "read-pkg-up": "^8.0.0", - "recursive-readdir": "^2.2.2", "server-destroy": "^1.0.1", "split-lines": "^3.0.0", "strip-bom": "^5.0.0", @@ -99,7 +99,7 @@ "@types/inquirer": "^7.3.3", "@types/mocha": "^9.0.0", "@types/node": "^12.20.21", - "@types/recursive-readdir": "^2.2.0", + "@types/picomatch": "^2.3.4", "@types/server-destroy": "^1.0.1", "@types/tmp": "^0.2.1", "@types/wtfnode": "^0.7.0", diff --git a/src/dotfile.ts b/src/dotfile.ts index 7c3a102a..4b65c638 100644 --- a/src/dotfile.ts +++ b/src/dotfile.ts @@ -49,6 +49,9 @@ const defaultClaspignore = `# ignore all files… # ignore even valid files if in… .git/** node_modules/** + +# and Python virtual environments +.venv/** `; // Methods for retrieving dotfiles. diff --git a/src/files.ts b/src/files.ts index cac6213c..69ec4609 100644 --- a/src/files.ts +++ b/src/files.ts @@ -4,7 +4,7 @@ import makeDir from 'make-dir'; import multimatch from 'multimatch'; import path from 'path'; import pMap from 'p-map'; -import recursive from 'recursive-readdir'; +import {fdir} from 'fdir'; import typescript from 'typescript'; import {GaxiosError} from 'gaxios'; @@ -90,7 +90,8 @@ export const getAllProjectFiles = async (rootDir: string = path.join('.', '/')): // Read all filenames as a flattened tree // Note: filePaths contain relative paths such as "test/bar.ts", "../../src/foo.js" - const files: ProjectFile[] = (await recursive(rootDir)).map((filename): ProjectFile => { + const filelist = await new fdir().withBasePath().crawl(rootDir).withPromise(); + const files: ProjectFile[] = filelist.map((filename): ProjectFile => { // Replace OS specific path separator to common '/' char for console output const name = filename.replace(/\\/g, '/');