Skip to content

Commit

Permalink
Prefer pnpm for tarball packing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Jan 25, 2024
1 parent 1e78599 commit 4a9e458
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/dtslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"eslint-plugin-import": "^2.29.1",
"semver": "^7.5.4",
"strip-json-comments": "^3.1.1",
"tar": "^6.2.0"
"tar": "^6.2.0",
"which": "^4.0.0"
},
"peerDependencies": {
"typescript": ">= 3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.7.0-dev || >= 3.8.0-dev || >= 3.9.0-dev || >= 4.0.0-dev || >=5.0.0-dev"
Expand All @@ -47,6 +48,7 @@
"@types/semver": "^7.5.5",
"@types/strip-json-comments": "^3.0.0",
"@types/tar": "^6.1.9",
"@types/which": "^3.0.3",
"typescript": "^5.3.3"
},
"engines": {
Expand Down
10 changes: 6 additions & 4 deletions packages/dtslint/src/checks.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import * as header from "@definitelytyped/header-parser";
import { AllTypeScriptVersion } from "@definitelytyped/typescript-versions";
import { deepEquals } from "@definitelytyped/utils";
import fs from "fs";
import { join as joinPaths, dirname } from "path";
import { dirname, join as joinPaths } from "path";
import { CompilerOptions } from "typescript";
import { deepEquals } from "@definitelytyped/utils";

import { readJson, packageNameFromPath } from "./util";
import { execFileSync, execSync } from "child_process";
import which from "which";
import { packageNameFromPath, readJson } from "./util";
export function checkPackageJson(
dirPath: string,
typesVersions: readonly AllTypeScriptVersion[],
Expand Down Expand Up @@ -143,7 +144,8 @@ export function runAreTheTypesWrong(dirPath: string, implementationTarballPath:
const tarballName = `types-${mangledName}-${packageJsonContent.version}.tgz`;
const attwPackageJsonPath = require.resolve("@arethetypeswrong/cli/package.json");
const attwBinPath = joinPaths(dirname(attwPackageJsonPath), readJson(attwPackageJsonPath).bin.attw);
execSync("npm pack", { cwd: dirPath, stdio: "ignore", env: { ...process.env, COREPACK_ENABLE_STRICT: "0" } });
const npmPath = which.sync("pnpm", { nothrow: true }) || which.sync("npm");
execSync(`${npmPath} pack`, { cwd: dirPath, stdio: "ignore", env: { ...process.env, COREPACK_ENABLE_STRICT: "0" } });
try {
const output = execFileSync(
attwBinPath,
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 4a9e458

Please sign in to comment.