pkg-pr-new 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -6
- package/index.ts +7 -2
- package/package.json +2 -1
package/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { createHash } from "node:crypto";
|
|
|
6
6
|
import { hash } from "ohash";
|
|
7
7
|
import fsSync from "fs";
|
|
8
8
|
import fs from "fs/promises";
|
|
9
|
+
import { detect } from "detect-package-manager";
|
|
9
10
|
import { getPackageManifest, type PackageManifest } from "query-registry";
|
|
10
11
|
import type { Comment } from "@pkg-pr-new/utils";
|
|
11
12
|
import {
|
|
@@ -169,8 +170,9 @@ const main = defineCommand({
|
|
|
169
170
|
const restore = await writeDeps(templateDir, deps);
|
|
170
171
|
|
|
171
172
|
const gitignorePath = path.join(templateDir, ".gitignore");
|
|
172
|
-
const ig = ignore()
|
|
173
|
-
|
|
173
|
+
const ig = ignore()
|
|
174
|
+
.add("node_modules")
|
|
175
|
+
.add(".git");
|
|
174
176
|
|
|
175
177
|
if (fsSync.existsSync(gitignorePath)) {
|
|
176
178
|
const gitignoreContent = await fs.readFile(gitignorePath, "utf8");
|
|
@@ -181,6 +183,7 @@ const main = defineCommand({
|
|
|
181
183
|
cwd: templateDir,
|
|
182
184
|
dot: true,
|
|
183
185
|
onlyFiles: true,
|
|
186
|
+
ignore: ['node_modules', '.git'], // always ignore node_modules and .git
|
|
184
187
|
});
|
|
185
188
|
|
|
186
189
|
const filteredFiles = files.filter((file) => !ig.ignores(file));
|
|
@@ -271,6 +274,7 @@ const main = defineCommand({
|
|
|
271
274
|
}
|
|
272
275
|
}
|
|
273
276
|
|
|
277
|
+
const packageManager = await detect();
|
|
274
278
|
const res = await fetch(publishUrl, {
|
|
275
279
|
method: "POST",
|
|
276
280
|
headers: {
|
|
@@ -279,6 +283,7 @@ const main = defineCommand({
|
|
|
279
283
|
"sb-key": key,
|
|
280
284
|
"sb-shasums": JSON.stringify(shasums),
|
|
281
285
|
"sb-run-id": GITHUB_RUN_ID,
|
|
286
|
+
"sb-package-manager": packageManager,
|
|
282
287
|
},
|
|
283
288
|
body: formData,
|
|
284
289
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pkg-pr-new",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@jsdevtools/ez-spawn": "^3.0.4",
|
|
20
20
|
"@octokit/action": "^6.1.0",
|
|
21
|
+
"detect-package-manager": "^3.0.2",
|
|
21
22
|
"fast-glob": "^3.3.2",
|
|
22
23
|
"ignore": "^5.3.1",
|
|
23
24
|
"isbinaryfile": "^5.0.2",
|