Skip to content

Commit

Permalink
chore: ignore .vscode dir (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Nov 14, 2023
1 parent 606645e commit d0f8617
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target
.vscode
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"deno.enable": true,
"deno.lint": false,
"deno.unstable": false,
"deno.suggest.imports.hosts": {
"https://deno.land": false
},
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.formatOnSave": true
}
}
30 changes: 18 additions & 12 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ export interface BuildOptions {
* @default true
*/
esModule?: boolean;
/** Skip outputting the canonical TypeScript in the output directory before emitting.
/** Skip running `npm install`.
* @default false
*/
skipSourceOutput?: boolean;
/** Skip running `npm install`
skipNpmInstall?: boolean;
/** Skip outputting the canonical TypeScript in the output directory before emitting.
* @default false
*/
skipNpmInstall?: boolean;
skipSourceOutput?: boolean;
/** Root directory to find test files in. Defaults to the cwd. */
rootTestDir?: string;
/** Glob pattern to use to find tests files. Defaults to `deno test`'s pattern. */
Expand Down Expand Up @@ -233,14 +233,8 @@ export async function build(options: BuildOptions): Promise<void> {
createNpmIgnore();

// install dependencies in order to prepare for checking TS diagnostics
if (!options.skipNpmInstall) log(`Running ${packageManager} install...`);
const npmInstallPromise = options.skipNpmInstall
? Promise.resolve()
: runNpmCommand({
bin: packageManager,
args: ["install"],
cwd: options.outDir,
});
const npmInstallPromise = runNpmInstall();

if (options.typeCheck || options.declaration) {
// Unfortunately this can't be run in parallel to building the project
// in this case because TypeScript will resolve the npm packages when
Expand Down Expand Up @@ -536,6 +530,18 @@ export async function build(options: BuildOptions): Promise<void> {
);
}

function runNpmInstall() {
if (options.skipNpmInstall) {
return Promise.resolve();
}
log(`Running ${packageManager} install...`);
return runNpmCommand({
bin: packageManager,
args: ["install"],
cwd: options.outDir,
});
}

async function transformEntryPoints(): Promise<TransformOutput> {
const { shims, testShims } = shimOptionsToTransformShims(options.shims);
return transform({
Expand Down

0 comments on commit d0f8617

Please sign in to comment.