Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status speedup #1013

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .claspignore
Original file line number Diff line number Diff line change
@@ -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/**
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ yarn-debug.log*
yarn-error.log*
.npm
.env
.venv*
.nyc_output
*.lock

Expand Down
140 changes: 100 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/dotfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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, '/');

Expand Down