Skip to content

Commit

Permalink
🔨 (bin): Improve cache related commands for development flow
Browse files Browse the repository at this point in the history
  • Loading branch information
toridoriv committed Oct 25, 2023
1 parent cee199b commit 7196980
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/commands/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ export function getDependencyFilePaths(isDevelopment: boolean) {
/modules\/.*\.d\.ts/,
];
const skip: RegExp[] = [/node_modules/, /deno\/npm\/registry/];
const exts: string[] = [".ts"];

if (isDevelopment) {
match.push(/prettier\.config/, /scripts\.config/);
exts.push(".mjs");
} else {
skip.push(/bin\//);
}

const options: WalkOptions = {
includeDirs: false,
exts: [".ts"],
exts,
match,
skip,
};
Expand Down
7 changes: 6 additions & 1 deletion bin/commands/generate/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ const LockCommand = new CliffyCommand.Command()
"Use this option to remove all previous cache.",
{ default: false },
)
.option(
"-d, --development [development:boolean]",
"Include development dependencies.",
{ default: false },
)
.action(function main(options) {
removeOldLockFile();
const paths = getDependencyFilePaths(false);
const paths = getDependencyFilePaths(options.development);

if (options.clean) {
removePreviousCache();
Expand Down

0 comments on commit 7196980

Please sign in to comment.