@escapace/pnpm-pack 0.1.0 → 0.2.0
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/lib/esm/index.mjs +187 -185
- package/lib/esm/index.mjs.map +4 -4
- package/lib/types/pack-cleanup.d.ts +1 -1
- package/lib/types/pack-cleanup.d.ts.map +1 -1
- package/lib/types/pack-package.d.ts.map +1 -1
- package/lib/types/pack-workspace.d.ts.map +1 -1
- package/lib/types/utilities/get-path-directory-workspace.d.ts +1 -1
- package/lib/types/utilities/get-path-directory-workspace.d.ts.map +1 -1
- package/package.json +6 -11
package/lib/esm/index.mjs
CHANGED
|
@@ -8,39 +8,29 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
// src/utilities/get-
|
|
12
|
-
function getNameArchive(value) {
|
|
13
|
-
return `${value.name.replace("@", "").replace("/", "-")}-${value.version}.tgz`;
|
|
14
|
-
}
|
|
15
|
-
var init_get_name_archive = __esm({
|
|
16
|
-
"src/utilities/get-name-archive.ts"() {
|
|
17
|
-
"use strict";
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// src/utilities/get-path-directory-workspace.ts
|
|
11
|
+
// src/utilities/get-path-directory-package.ts
|
|
22
12
|
import assert from "node:assert";
|
|
23
13
|
import { findUp } from "find-up";
|
|
24
|
-
import path from "path";
|
|
25
|
-
async function
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
async function getPathDirectoryPackage(cwd) {
|
|
26
16
|
assert(typeof cwd == "string");
|
|
27
|
-
let
|
|
17
|
+
let pathFilePackageJSON = await findUp("package.json", {
|
|
28
18
|
cwd,
|
|
29
19
|
type: "file"
|
|
30
20
|
});
|
|
31
|
-
return assert(typeof
|
|
21
|
+
return assert(typeof pathFilePackageJSON == "string"), path.dirname(pathFilePackageJSON);
|
|
32
22
|
}
|
|
33
|
-
var
|
|
34
|
-
"src/utilities/get-path-directory-
|
|
23
|
+
var init_get_path_directory_package = __esm({
|
|
24
|
+
"src/utilities/get-path-directory-package.ts"() {
|
|
35
25
|
"use strict";
|
|
36
26
|
}
|
|
37
27
|
});
|
|
38
28
|
|
|
39
29
|
// src/utilities/read-package-json.ts
|
|
40
|
-
import path2 from "path";
|
|
30
|
+
import path2 from "node:path";
|
|
41
31
|
import fse from "fs-extra";
|
|
42
|
-
import assert2 from "assert";
|
|
43
|
-
import { readFile } from "fs/promises";
|
|
32
|
+
import assert2 from "node:assert";
|
|
33
|
+
import { readFile } from "node:fs/promises";
|
|
44
34
|
async function readPackageJSON(directory) {
|
|
45
35
|
let pathPackageJSON = path2.join(directory, "package.json");
|
|
46
36
|
assert2(fse.exists(pathPackageJSON));
|
|
@@ -55,21 +45,158 @@ var init_read_package_json = __esm({
|
|
|
55
45
|
}
|
|
56
46
|
});
|
|
57
47
|
|
|
58
|
-
// src/pack-
|
|
59
|
-
var
|
|
60
|
-
__export(
|
|
61
|
-
|
|
48
|
+
// src/pack-cleanup.ts
|
|
49
|
+
var pack_cleanup_exports = {};
|
|
50
|
+
__export(pack_cleanup_exports, {
|
|
51
|
+
packCleanup: () => packCleanup
|
|
52
|
+
});
|
|
53
|
+
import { writeFile } from "node:fs/promises";
|
|
54
|
+
import path3 from "node:path";
|
|
55
|
+
import process2 from "node:process";
|
|
56
|
+
async function packCleanup() {
|
|
57
|
+
let pathDirectoryPackage = await getPathDirectoryPackage(process2.cwd());
|
|
58
|
+
process2.chdir(pathDirectoryPackage);
|
|
59
|
+
let pathPackageJSON = path3.join(pathDirectoryPackage, "package.json"), packageJSON = await readPackageJSON(pathDirectoryPackage);
|
|
60
|
+
await writeFile(
|
|
61
|
+
pathPackageJSON,
|
|
62
|
+
JSON.stringify(Object.assign(packageJSON, { version: "0.0.0" }), null, 2)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
var init_pack_cleanup = __esm({
|
|
66
|
+
"src/pack-cleanup.ts"() {
|
|
67
|
+
"use strict";
|
|
68
|
+
init_get_path_directory_package();
|
|
69
|
+
init_read_package_json();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// src/utilities/get-name-archive.ts
|
|
74
|
+
function getNameArchive(value) {
|
|
75
|
+
return `${value.name.replace("@", "").replace("/", "-")}-${value.version}.tgz`;
|
|
76
|
+
}
|
|
77
|
+
var init_get_name_archive = __esm({
|
|
78
|
+
"src/utilities/get-name-archive.ts"() {
|
|
79
|
+
"use strict";
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// src/utilities/get-path-directory-workspace.ts
|
|
84
|
+
import assert3 from "node:assert";
|
|
85
|
+
import { findUp as findUp2 } from "find-up";
|
|
86
|
+
import path4 from "node:path";
|
|
87
|
+
async function getPathDirectoryWorkspace(cwd) {
|
|
88
|
+
assert3(typeof cwd == "string");
|
|
89
|
+
let pathFileWorkspaceYaml = await findUp2("pnpm-workspace.yaml", {
|
|
90
|
+
cwd,
|
|
91
|
+
type: "file"
|
|
92
|
+
});
|
|
93
|
+
return pathFileWorkspaceYaml === void 0 ? void 0 : path4.dirname(pathFileWorkspaceYaml);
|
|
94
|
+
}
|
|
95
|
+
var init_get_path_directory_workspace = __esm({
|
|
96
|
+
"src/utilities/get-path-directory-workspace.ts"() {
|
|
97
|
+
"use strict";
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// src/pack-package.ts
|
|
102
|
+
var pack_package_exports = {};
|
|
103
|
+
__export(pack_package_exports, {
|
|
104
|
+
packPackage: () => packPackage
|
|
62
105
|
});
|
|
63
106
|
import arg from "arg";
|
|
64
107
|
import { execa } from "execa";
|
|
65
108
|
import fse2 from "fs-extra";
|
|
66
|
-
import
|
|
67
|
-
import { mkdtemp } from "node:fs/promises";
|
|
109
|
+
import assert4 from "node:assert";
|
|
110
|
+
import { mkdtemp, writeFile as writeFile2 } from "node:fs/promises";
|
|
111
|
+
import os from "node:os";
|
|
112
|
+
import path5 from "node:path";
|
|
113
|
+
import process3 from "node:process";
|
|
68
114
|
import { isNativeError as isNativeError2 } from "node:util/types";
|
|
69
|
-
import os from "os";
|
|
70
|
-
import path3 from "path";
|
|
71
115
|
import semver from "semver";
|
|
72
|
-
|
|
116
|
+
async function packPackage() {
|
|
117
|
+
let error2, pathDirectoryTemporary, options = arg({
|
|
118
|
+
"--no-cleanup": Boolean,
|
|
119
|
+
"--pack-destination": String,
|
|
120
|
+
"--skip-workspace-root": Boolean,
|
|
121
|
+
"--temporary-directory": String,
|
|
122
|
+
"--version": String
|
|
123
|
+
}), cleanup = options["--no-cleanup"] !== !0, pathDirectoryPackage = await getPathDirectoryPackage(process3.cwd()), pathDirectoryRoot = await getPathDirectoryWorkspace(pathDirectoryPackage) ?? pathDirectoryPackage;
|
|
124
|
+
process3.chdir(pathDirectoryPackage);
|
|
125
|
+
let pathDirectoryDestination = path5.resolve(
|
|
126
|
+
pathDirectoryPackage,
|
|
127
|
+
options["--pack-destination"] ?? "lib"
|
|
128
|
+
), pathDirectoryPackageRelative = path5.relative(
|
|
129
|
+
pathDirectoryRoot,
|
|
130
|
+
pathDirectoryPackage
|
|
131
|
+
), isRoot = pathDirectoryPackageRelative === "", pathPackageJSON = path5.join(pathDirectoryPackage, "package.json"), packageJSON = await readPackageJSON(pathDirectoryPackage), version = options["--version"] ?? "0.0.0";
|
|
132
|
+
assert4(typeof semver.valid(version) == "string"), await writeFile2(
|
|
133
|
+
pathPackageJSON,
|
|
134
|
+
JSON.stringify(Object.assign(packageJSON, { version }), null, 2)
|
|
135
|
+
);
|
|
136
|
+
try {
|
|
137
|
+
pathDirectoryTemporary = typeof options["--temporary-directory"] == "string" ? path5.resolve(pathDirectoryPackage, options["--temporary-directory"]) : await mkdtemp(path5.join(os.tmpdir(), "pnpm-pack"));
|
|
138
|
+
let pathDirectoryContext = path5.join(pathDirectoryTemporary, "package"), nameArchive = getNameArchive({ name: packageJSON.name, version }), pathFileArchive = path5.join(pathDirectoryTemporary, nameArchive);
|
|
139
|
+
await execa(
|
|
140
|
+
"pnpm",
|
|
141
|
+
["pack", "--pack-destination", pathDirectoryTemporary],
|
|
142
|
+
{
|
|
143
|
+
stdio: "inherit"
|
|
144
|
+
}
|
|
145
|
+
), assert4(fse2.exists(pathFileArchive));
|
|
146
|
+
let pathDirectoryPackageContext = path5.join(
|
|
147
|
+
pathDirectoryContext,
|
|
148
|
+
pathDirectoryPackageRelative
|
|
149
|
+
);
|
|
150
|
+
await fse2.mkdirp(pathDirectoryPackageContext), await execa(
|
|
151
|
+
"tar",
|
|
152
|
+
[
|
|
153
|
+
"-xf",
|
|
154
|
+
pathFileArchive,
|
|
155
|
+
"--strip-components=1",
|
|
156
|
+
"-C",
|
|
157
|
+
pathDirectoryPackageContext
|
|
158
|
+
],
|
|
159
|
+
{
|
|
160
|
+
stdio: "inherit"
|
|
161
|
+
}
|
|
162
|
+
), isRoot && options["--skip-workspace-root"] === !0 ? await fse2.remove(pathFileArchive) : (await fse2.mkdirp(pathDirectoryPackageContext), await fse2.move(
|
|
163
|
+
pathFileArchive,
|
|
164
|
+
path5.join(pathDirectoryDestination, nameArchive),
|
|
165
|
+
{ overwrite: !0 }
|
|
166
|
+
));
|
|
167
|
+
} catch (error_) {
|
|
168
|
+
error2 = isNativeError2(error_) ? error_ : new Error("Unknown Error");
|
|
169
|
+
}
|
|
170
|
+
return cleanup && (await writeFile2(
|
|
171
|
+
pathPackageJSON,
|
|
172
|
+
JSON.stringify(Object.assign(packageJSON, { version: "0.0.0" }), null, 2)
|
|
173
|
+
), typeof pathDirectoryTemporary == "string" && await fse2.remove(pathDirectoryTemporary)), error2;
|
|
174
|
+
}
|
|
175
|
+
var init_pack_package = __esm({
|
|
176
|
+
"src/pack-package.ts"() {
|
|
177
|
+
"use strict";
|
|
178
|
+
init_get_name_archive();
|
|
179
|
+
init_get_path_directory_package();
|
|
180
|
+
init_get_path_directory_workspace();
|
|
181
|
+
init_read_package_json();
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// src/pack-workspace.ts
|
|
186
|
+
var pack_workspace_exports = {};
|
|
187
|
+
__export(pack_workspace_exports, {
|
|
188
|
+
packWorkspace: () => packWorkspace
|
|
189
|
+
});
|
|
190
|
+
import arg2 from "arg";
|
|
191
|
+
import { execa as execa2 } from "execa";
|
|
192
|
+
import fse3 from "fs-extra";
|
|
193
|
+
import assert5 from "node:assert";
|
|
194
|
+
import { mkdtemp as mkdtemp2 } from "node:fs/promises";
|
|
195
|
+
import { isNativeError as isNativeError3 } from "node:util/types";
|
|
196
|
+
import os2 from "node:os";
|
|
197
|
+
import path6 from "node:path";
|
|
198
|
+
import semver2 from "semver";
|
|
199
|
+
import { fileURLToPath } from "node:url";
|
|
73
200
|
import {
|
|
74
201
|
readWantedLockfileAndAutofixConflicts,
|
|
75
202
|
writeWantedLockfile
|
|
@@ -77,8 +204,8 @@ import {
|
|
|
77
204
|
import { mapValues } from "lodash-es";
|
|
78
205
|
async function packWorkspace() {
|
|
79
206
|
let error2, pathDirectoryTemporary, cwd = await getPathDirectoryWorkspace(process.cwd());
|
|
80
|
-
process.chdir(cwd);
|
|
81
|
-
let options =
|
|
207
|
+
assert5.ok(cwd !== void 0), process.chdir(cwd);
|
|
208
|
+
let options = arg2(
|
|
82
209
|
{
|
|
83
210
|
"--changed-files-ignore-pattern": String,
|
|
84
211
|
"--filter": [String],
|
|
@@ -90,8 +217,8 @@ async function packWorkspace() {
|
|
|
90
217
|
},
|
|
91
218
|
{ permissive: !1 }
|
|
92
219
|
), version = options["--version"] ?? "0.0.0";
|
|
93
|
-
|
|
94
|
-
let pathDirectoryDestination =
|
|
220
|
+
assert5(typeof semver2.valid(version) == "string");
|
|
221
|
+
let pathDirectoryDestination = path6.resolve(
|
|
95
222
|
cwd,
|
|
96
223
|
options["--pack-destination"] ?? "lib"
|
|
97
224
|
), packageJSON = await readPackageJSON(cwd), nameArchive = getNameArchive({ name: packageJSON.name, version }), filters = [
|
|
@@ -109,11 +236,12 @@ async function packWorkspace() {
|
|
|
109
236
|
fileURLToPath(import.meta.url)
|
|
110
237
|
];
|
|
111
238
|
try {
|
|
112
|
-
pathDirectoryTemporary = await
|
|
239
|
+
pathDirectoryTemporary = await mkdtemp2(path6.join(os2.tmpdir(), "pnpm-pack")), assert5(typeof pathDirectoryTemporary == "string"), await execa2(
|
|
113
240
|
"pnpm",
|
|
114
241
|
[
|
|
115
242
|
...pnpmExecArguments,
|
|
116
243
|
"package",
|
|
244
|
+
"--skip-workspace-root",
|
|
117
245
|
"--no-cleanup",
|
|
118
246
|
"--temporary-directory",
|
|
119
247
|
pathDirectoryTemporary,
|
|
@@ -121,52 +249,52 @@ async function packWorkspace() {
|
|
|
121
249
|
version
|
|
122
250
|
].filter((value) => typeof value == "string"),
|
|
123
251
|
{
|
|
124
|
-
|
|
125
|
-
|
|
252
|
+
cwd,
|
|
253
|
+
stdio: "inherit"
|
|
126
254
|
}
|
|
127
255
|
);
|
|
128
|
-
let directoryPathContext =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
256
|
+
let directoryPathContext = path6.join(pathDirectoryTemporary, "package"), pathFileArchive = path6.join(pathDirectoryTemporary, nameArchive);
|
|
257
|
+
assert5(fse3.exists(directoryPathContext)), assert5(fse3.exists(pathFileArchive)), await execa2("pnpm", ["install", "--lockfile-only", "--ignore-scripts"], {
|
|
258
|
+
cwd,
|
|
259
|
+
stdio: "inherit"
|
|
132
260
|
});
|
|
133
261
|
let { lockfile } = await readWantedLockfileAndAutofixConflicts(
|
|
134
262
|
directoryPathContext,
|
|
135
263
|
{ ignoreIncompatible: !1 }
|
|
136
264
|
);
|
|
137
|
-
|
|
265
|
+
assert5(lockfile !== null);
|
|
138
266
|
let importers = mapValues(lockfile.importers, (value) => ({
|
|
139
267
|
...value,
|
|
140
268
|
specifiers: mapValues(value.specifiers, (value2) => value2.startsWith("workspace:") ? version : value2)
|
|
141
269
|
}));
|
|
142
|
-
lockfile.importers = importers, await writeWantedLockfile(directoryPathContext, lockfile), await
|
|
270
|
+
lockfile.importers = importers, await writeWantedLockfile(directoryPathContext, lockfile), await execa2(
|
|
143
271
|
"tar",
|
|
144
272
|
["-czf", pathFileArchive, "-C", pathDirectoryTemporary, "package"],
|
|
145
273
|
{
|
|
146
|
-
|
|
147
|
-
|
|
274
|
+
cwd,
|
|
275
|
+
stdio: "inherit"
|
|
148
276
|
}
|
|
149
|
-
), await
|
|
277
|
+
), await fse3.remove(directoryPathContext), await fse3.mkdirp(pathDirectoryDestination), await fse3.move(
|
|
150
278
|
pathFileArchive,
|
|
151
|
-
|
|
279
|
+
path6.join(pathDirectoryDestination, nameArchive),
|
|
152
280
|
{ overwrite: !0 }
|
|
153
281
|
);
|
|
154
|
-
} catch (
|
|
155
|
-
error2 =
|
|
282
|
+
} catch (error_) {
|
|
283
|
+
error2 = isNativeError3(error_) ? error_ : new Error("Unknown Error");
|
|
156
284
|
}
|
|
157
|
-
return await
|
|
285
|
+
return await execa2(
|
|
158
286
|
"pnpm",
|
|
159
287
|
[...pnpmExecArguments, "cleanup"].filter(
|
|
160
288
|
(value) => typeof value == "string"
|
|
161
289
|
),
|
|
162
290
|
{
|
|
163
|
-
|
|
164
|
-
|
|
291
|
+
cwd,
|
|
292
|
+
stdio: "inherit"
|
|
165
293
|
}
|
|
166
|
-
), await
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}), typeof pathDirectoryTemporary == "string" && await
|
|
294
|
+
), await execa2("pnpm", ["install", "--lockfile-only", "--ignore-scripts"], {
|
|
295
|
+
cwd,
|
|
296
|
+
stdio: "inherit"
|
|
297
|
+
}), typeof pathDirectoryTemporary == "string" && await fse3.remove(pathDirectoryTemporary), error2;
|
|
170
298
|
}
|
|
171
299
|
var init_pack_workspace = __esm({
|
|
172
300
|
"src/pack-workspace.ts"() {
|
|
@@ -177,135 +305,9 @@ var init_pack_workspace = __esm({
|
|
|
177
305
|
}
|
|
178
306
|
});
|
|
179
307
|
|
|
180
|
-
// src/utilities/get-path-directory-package.ts
|
|
181
|
-
import assert4 from "node:assert";
|
|
182
|
-
import { findUp as findUp2 } from "find-up";
|
|
183
|
-
import path4 from "path";
|
|
184
|
-
async function getPathDirectoryPackage(cwd) {
|
|
185
|
-
assert4(typeof cwd == "string");
|
|
186
|
-
let pathFilePackageJSON = await findUp2("package.json", {
|
|
187
|
-
cwd,
|
|
188
|
-
type: "file"
|
|
189
|
-
});
|
|
190
|
-
return assert4(typeof pathFilePackageJSON == "string"), path4.dirname(pathFilePackageJSON);
|
|
191
|
-
}
|
|
192
|
-
var init_get_path_directory_package = __esm({
|
|
193
|
-
"src/utilities/get-path-directory-package.ts"() {
|
|
194
|
-
"use strict";
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
// src/pack-package.ts
|
|
199
|
-
var pack_package_exports = {};
|
|
200
|
-
__export(pack_package_exports, {
|
|
201
|
-
packPackage: () => packPackage
|
|
202
|
-
});
|
|
203
|
-
import arg2 from "arg";
|
|
204
|
-
import { execa as execa2 } from "execa";
|
|
205
|
-
import fse3 from "fs-extra";
|
|
206
|
-
import assert5 from "node:assert";
|
|
207
|
-
import { mkdtemp as mkdtemp2, writeFile } from "node:fs/promises";
|
|
208
|
-
import os2 from "node:os";
|
|
209
|
-
import path5 from "node:path";
|
|
210
|
-
import { isNativeError as isNativeError3 } from "node:util/types";
|
|
211
|
-
import process2 from "process";
|
|
212
|
-
import semver2 from "semver";
|
|
213
|
-
async function packPackage() {
|
|
214
|
-
let error2, pathDirectoryTemporary, options = arg2({
|
|
215
|
-
"--no-cleanup": Boolean,
|
|
216
|
-
"--pack-destination": String,
|
|
217
|
-
"--temporary-directory": String,
|
|
218
|
-
"--version": String
|
|
219
|
-
}), cleanup = options["--no-cleanup"] !== !0, pathDirectoryPackage = await getPathDirectoryPackage(process2.cwd()), pathDirectoryRoot = await getPathDirectoryWorkspace(pathDirectoryPackage);
|
|
220
|
-
process2.chdir(pathDirectoryPackage);
|
|
221
|
-
let pathDirectoryDestination = path5.resolve(
|
|
222
|
-
pathDirectoryPackage,
|
|
223
|
-
options["--pack-destination"] ?? "lib"
|
|
224
|
-
), pathDirectoryPackageRelative = path5.relative(
|
|
225
|
-
pathDirectoryRoot,
|
|
226
|
-
pathDirectoryPackage
|
|
227
|
-
), isRoot = pathDirectoryPackageRelative === "", pathPackageJSON = path5.join(pathDirectoryPackage, "package.json"), packageJSON = await readPackageJSON(pathDirectoryPackage), version = options["--version"] ?? "0.0.0";
|
|
228
|
-
assert5(typeof semver2.valid(version) == "string"), await writeFile(
|
|
229
|
-
pathPackageJSON,
|
|
230
|
-
JSON.stringify(Object.assign(packageJSON, { version }), null, 2)
|
|
231
|
-
);
|
|
232
|
-
try {
|
|
233
|
-
pathDirectoryTemporary = typeof options["--temporary-directory"] == "string" ? path5.resolve(pathDirectoryPackage, options["--temporary-directory"]) : await mkdtemp2(path5.join(os2.tmpdir(), "pnpm-pack"));
|
|
234
|
-
let pathDirectoryContext = path5.join(pathDirectoryTemporary, "package"), nameArchive = getNameArchive({ name: packageJSON.name, version }), pathFileArchive = path5.join(pathDirectoryTemporary, nameArchive);
|
|
235
|
-
await execa2(
|
|
236
|
-
"pnpm",
|
|
237
|
-
["pack", "--pack-destination", pathDirectoryTemporary],
|
|
238
|
-
{
|
|
239
|
-
stdio: "inherit"
|
|
240
|
-
}
|
|
241
|
-
), assert5(fse3.exists(pathFileArchive));
|
|
242
|
-
let pathDirectoryPackageContext = path5.join(
|
|
243
|
-
pathDirectoryContext,
|
|
244
|
-
pathDirectoryPackageRelative
|
|
245
|
-
);
|
|
246
|
-
await fse3.mkdirp(pathDirectoryPackageContext), await execa2(
|
|
247
|
-
"tar",
|
|
248
|
-
[
|
|
249
|
-
"-xf",
|
|
250
|
-
pathFileArchive,
|
|
251
|
-
"--strip-components=1",
|
|
252
|
-
"-C",
|
|
253
|
-
pathDirectoryPackageContext
|
|
254
|
-
],
|
|
255
|
-
{
|
|
256
|
-
stdio: "inherit"
|
|
257
|
-
}
|
|
258
|
-
), isRoot ? await fse3.remove(pathFileArchive) : (await fse3.mkdirp(pathDirectoryPackageContext), await fse3.move(
|
|
259
|
-
pathFileArchive,
|
|
260
|
-
path5.join(pathDirectoryDestination, nameArchive),
|
|
261
|
-
{ overwrite: !0 }
|
|
262
|
-
));
|
|
263
|
-
} catch (e) {
|
|
264
|
-
error2 = isNativeError3(e) ? e : new Error("Unknown Error");
|
|
265
|
-
}
|
|
266
|
-
return cleanup && (await writeFile(
|
|
267
|
-
pathPackageJSON,
|
|
268
|
-
JSON.stringify(Object.assign(packageJSON, { version: "0.0.0" }), null, 2)
|
|
269
|
-
), typeof pathDirectoryTemporary == "string" && await fse3.remove(pathDirectoryTemporary)), error2;
|
|
270
|
-
}
|
|
271
|
-
var init_pack_package = __esm({
|
|
272
|
-
"src/pack-package.ts"() {
|
|
273
|
-
"use strict";
|
|
274
|
-
init_get_name_archive();
|
|
275
|
-
init_get_path_directory_package();
|
|
276
|
-
init_get_path_directory_workspace();
|
|
277
|
-
init_read_package_json();
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
// src/pack-cleanup.ts
|
|
282
|
-
var pack_cleanup_exports = {};
|
|
283
|
-
__export(pack_cleanup_exports, {
|
|
284
|
-
packCleanup: () => packCleanup
|
|
285
|
-
});
|
|
286
|
-
import { writeFile as writeFile2 } from "node:fs/promises";
|
|
287
|
-
import path6 from "node:path";
|
|
288
|
-
import process3 from "process";
|
|
289
|
-
async function packCleanup() {
|
|
290
|
-
let pathDirectoryPackage = await getPathDirectoryPackage(process3.cwd());
|
|
291
|
-
process3.chdir(pathDirectoryPackage);
|
|
292
|
-
let pathPackageJSON = path6.join(pathDirectoryPackage, "package.json"), packageJSON = await readPackageJSON(pathDirectoryPackage);
|
|
293
|
-
await writeFile2(
|
|
294
|
-
pathPackageJSON,
|
|
295
|
-
JSON.stringify(Object.assign(packageJSON, { version: "0.0.0" }), null, 2)
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
var init_pack_cleanup = __esm({
|
|
299
|
-
"src/pack-cleanup.ts"() {
|
|
300
|
-
"use strict";
|
|
301
|
-
init_get_path_directory_package();
|
|
302
|
-
init_read_package_json();
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
|
|
306
308
|
// src/index.ts
|
|
307
309
|
import arg3 from "arg";
|
|
308
|
-
import assert6 from "assert";
|
|
310
|
+
import assert6 from "node:assert";
|
|
309
311
|
|
|
310
312
|
// src/utilities/assert-requirements.ts
|
|
311
313
|
import which from "which";
|
|
@@ -314,7 +316,7 @@ async function assertRequirements() {
|
|
|
314
316
|
}
|
|
315
317
|
|
|
316
318
|
// src/utilities/exit.ts
|
|
317
|
-
import { isNativeError } from "util/types";
|
|
319
|
+
import { isNativeError } from "node:util/types";
|
|
318
320
|
function exit(error2) {
|
|
319
321
|
error2 !== void 0 && (console.error(isNativeError(error2) ? error2.message : "Unknown Error"), process.exit(1));
|
|
320
322
|
}
|
|
@@ -328,9 +330,9 @@ assert6(
|
|
|
328
330
|
command === "workspace" || command === "package" || command === "cleanup"
|
|
329
331
|
);
|
|
330
332
|
var run = await {
|
|
331
|
-
|
|
333
|
+
cleanup: async () => (await Promise.resolve().then(() => (init_pack_cleanup(), pack_cleanup_exports))).packCleanup,
|
|
332
334
|
package: async () => (await Promise.resolve().then(() => (init_pack_package(), pack_package_exports))).packPackage,
|
|
333
|
-
|
|
335
|
+
workspace: async () => (await Promise.resolve().then(() => (init_pack_workspace(), pack_workspace_exports))).packWorkspace
|
|
334
336
|
}[command](), error = await run();
|
|
335
337
|
exit(error);
|
|
336
338
|
//# sourceMappingURL=index.mjs.map
|
package/lib/esm/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/utilities/get-
|
|
4
|
-
"sourcesContent": ["export function getNameArchive(value: { name: string; version: string }) {\n // https://github.com/pnpm/pnpm/blob/6caec8109b563fd27ad262ce06a1f587cebbc044/releasing/plugin-commands-publishing/src/pack.ts#L98C1-L98C100\n return `${value.name.replace('@', '').replace('/', '-')}-${value.version}.tgz`\n}\n", "import assert from 'node:assert'\nimport { findUp } from 'find-up'\nimport path from 'path'\n\nexport async function getPathDirectoryWorkspace(cwd: string) {\n assert(typeof cwd === 'string')\n const pathFileWorkspaceYaml = await findUp('pnpm-workspace.yaml', {\n cwd,\n type: 'file'\n })\n\n assert(typeof pathFileWorkspaceYaml === 'string')\n return path.dirname(pathFileWorkspaceYaml)\n}\n", "import path from 'path'\nimport fse from 'fs-extra'\nimport assert from 'assert'\nimport { readFile } from 'fs/promises'\n\nexport async function readPackageJSON(directory: string) {\n const pathPackageJSON = path.join(directory, 'package.json')\n assert(fse.exists(pathPackageJSON))\n const content = await readFile(pathPackageJSON, 'utf8')\n assert(typeof content === 'string')\n const packageJSON = JSON.parse(content) as { name: string }\n assert(typeof packageJSON === 'object')\n assert(typeof packageJSON.name === 'string')\n\n return packageJSON\n}\n", "import arg from 'arg'\nimport { execa } from 'execa'\nimport fse from 'fs-extra'\nimport assert from 'node:assert'\nimport { mkdtemp } from 'node:fs/promises'\nimport { isNativeError } from 'node:util/types'\nimport os from 'os'\nimport path from 'path'\nimport semver from 'semver'\nimport { fileURLToPath } from 'url'\nimport { getNameArchive } from './utilities/get-name-archive'\nimport { getPathDirectoryWorkspace } from './utilities/get-path-directory-workspace'\nimport { readPackageJSON } from './utilities/read-package-json'\nimport {\n readWantedLockfileAndAutofixConflicts,\n writeWantedLockfile\n} from '@pnpm/lockfile-file'\nimport { mapValues } from 'lodash-es'\n\nexport async function packWorkspace() {\n let error: Error | undefined\n let pathDirectoryTemporary: string | undefined\n\n const cwd = await getPathDirectoryWorkspace(process.cwd())\n process.chdir(cwd)\n\n // https://pnpm.io/filtering\n const options = arg(\n {\n '--changed-files-ignore-pattern': String,\n '--filter': [String],\n '--filter-prod': [String],\n '--pack-destination': String,\n '--test-pattern': String,\n '--version': String,\n '--workspace-concurrency': Number\n },\n { permissive: false }\n )\n\n const version = options['--version'] ?? '0.0.0'\n assert(typeof semver.valid(version) === 'string')\n\n const pathDirectoryDestination = path.resolve(\n cwd,\n options['--pack-destination'] ?? 'lib'\n )\n\n const packageJSON = await readPackageJSON(cwd)\n const nameArchive = getNameArchive({ name: packageJSON.name, version })\n\n const filters = [\n ...(Array.isArray(options['--filter-prod'])\n ? options['--filter-prod'].flatMap((value) => ['--filter-prod', value])\n : []),\n ...(Array.isArray(options['--filter'])\n ? options['--filter'].flatMap((value) => ['--filter', value])\n : [])\n ].filter((value): value is string => typeof value === 'string')\n\n const pnpmExecArguments = [\n '--fail-if-no-match',\n '--workspace-root',\n typeof options['--workspace-concurrency'] === 'number'\n ? `--workspace-concurrency=${options['--workspace-concurrency']}`\n : undefined,\n typeof options['--test-pattern'] === 'string'\n ? `--test-pattern=${options['--test-pattern']}`\n : undefined,\n typeof options['--changed-files-ignore-pattern'] === 'string'\n ? `--changed-files-ignore-pattern=${options['--changed-files-ignore-pattern']}`\n : undefined,\n ...(filters.length === 0 ? ['--filter', '*'] : filters),\n 'exec',\n 'node',\n fileURLToPath(import.meta.url)\n ]\n\n try {\n pathDirectoryTemporary = await mkdtemp(path.join(os.tmpdir(), 'pnpm-pack'))\n\n assert(typeof pathDirectoryTemporary === 'string')\n\n await execa(\n 'pnpm',\n [\n ...pnpmExecArguments,\n 'package',\n '--no-cleanup',\n '--temporary-directory',\n pathDirectoryTemporary,\n '--version',\n version\n ].filter((value): value is string => typeof value === 'string'),\n {\n stdio: 'inherit',\n cwd\n }\n )\n\n const directoryPathContext = path.join(pathDirectoryTemporary, 'package')\n const pathFileArchive = path.join(pathDirectoryTemporary, nameArchive)\n\n assert(fse.exists(directoryPathContext))\n assert(fse.exists(pathFileArchive))\n\n await execa('pnpm', ['install', '--lockfile-only', '--ignore-scripts'], {\n stdio: 'inherit',\n cwd\n })\n\n const { lockfile } = await readWantedLockfileAndAutofixConflicts(\n directoryPathContext,\n { ignoreIncompatible: false }\n )\n\n assert(lockfile !== null)\n\n const importers = mapValues(lockfile.importers, (value) => ({\n ...value,\n specifiers: mapValues(value.specifiers, (value) => {\n if (value.startsWith('workspace:')) {\n return version\n }\n\n return value\n })\n }))\n\n lockfile.importers = importers\n\n await writeWantedLockfile(directoryPathContext, lockfile)\n\n await execa(\n 'tar',\n ['-czf', pathFileArchive, '-C', pathDirectoryTemporary, 'package'],\n {\n stdio: 'inherit',\n cwd\n }\n )\n\n await fse.remove(directoryPathContext)\n await fse.mkdirp(pathDirectoryDestination)\n await fse.move(\n pathFileArchive,\n path.join(pathDirectoryDestination, nameArchive),\n { overwrite: true }\n )\n } catch (e) {\n error = isNativeError(e) ? e : new Error('Unknown Error')\n }\n\n await execa(\n 'pnpm',\n [...pnpmExecArguments, 'cleanup'].filter(\n (value): value is string => typeof value === 'string'\n ),\n {\n stdio: 'inherit',\n cwd\n }\n )\n\n await execa('pnpm', ['install', '--lockfile-only', '--ignore-scripts'], {\n stdio: 'inherit',\n cwd\n })\n\n if (typeof pathDirectoryTemporary === 'string') {\n await fse.remove(pathDirectoryTemporary)\n }\n\n return error\n}\n", "import assert from 'node:assert'\nimport { findUp } from 'find-up'\nimport path from 'path'\n\nexport async function getPathDirectoryPackage(cwd: string) {\n assert(typeof cwd === 'string')\n const pathFilePackageJSON = await findUp('package.json', {\n cwd,\n type: 'file'\n })\n\n assert(typeof pathFilePackageJSON === 'string')\n return path.dirname(pathFilePackageJSON)\n}\n", "import arg from 'arg'\nimport { execa } from 'execa'\nimport fse from 'fs-extra'\nimport assert from 'node:assert'\nimport { mkdtemp, writeFile } from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'\nimport { isNativeError } from 'node:util/types'\nimport process from 'process'\nimport semver from 'semver'\nimport { getNameArchive } from './utilities/get-name-archive'\nimport { getPathDirectoryPackage } from './utilities/get-path-directory-package'\nimport { getPathDirectoryWorkspace } from './utilities/get-path-directory-workspace'\nimport { readPackageJSON } from './utilities/read-package-json'\n\nexport async function packPackage() {\n let error: Error | undefined\n let pathDirectoryTemporary: string | undefined\n\n const options = arg({\n '--no-cleanup': Boolean,\n '--pack-destination': String,\n '--temporary-directory': String,\n '--version': String\n })\n\n const cleanup = options['--no-cleanup'] !== true\n\n const pathDirectoryPackage = await getPathDirectoryPackage(process.cwd())\n const pathDirectoryRoot =\n await getPathDirectoryWorkspace(pathDirectoryPackage)\n\n process.chdir(pathDirectoryPackage)\n\n const pathDirectoryDestination = path.resolve(\n pathDirectoryPackage,\n options['--pack-destination'] ?? 'lib'\n )\n\n const pathDirectoryPackageRelative = path.relative(\n pathDirectoryRoot,\n pathDirectoryPackage\n )\n\n const isRoot = pathDirectoryPackageRelative === ''\n const pathPackageJSON = path.join(pathDirectoryPackage, 'package.json')\n const packageJSON = await readPackageJSON(pathDirectoryPackage)\n\n const version = options['--version'] ?? '0.0.0'\n\n assert(typeof semver.valid(version) === 'string')\n\n await writeFile(\n pathPackageJSON,\n JSON.stringify(Object.assign(packageJSON, { version }), null, 2)\n )\n\n try {\n pathDirectoryTemporary =\n typeof options['--temporary-directory'] === 'string'\n ? path.resolve(pathDirectoryPackage, options['--temporary-directory'])\n : await mkdtemp(path.join(os.tmpdir(), 'pnpm-pack'))\n\n const pathDirectoryContext = path.join(pathDirectoryTemporary, 'package')\n\n // https://github.com/pnpm/pnpm/blob/6caec8109b563fd27ad262ce06a1f587cebbc044/releasing/plugin-commands-publishing/src/pack.ts#L98C1-L98C100\n const nameArchive = getNameArchive({ name: packageJSON.name, version })\n const pathFileArchive = path.join(pathDirectoryTemporary, nameArchive)\n\n await execa(\n 'pnpm',\n ['pack', '--pack-destination', pathDirectoryTemporary],\n {\n stdio: 'inherit'\n }\n )\n assert(fse.exists(pathFileArchive))\n const pathDirectoryPackageContext = path.join(\n pathDirectoryContext,\n pathDirectoryPackageRelative\n )\n await fse.mkdirp(pathDirectoryPackageContext)\n await execa(\n 'tar',\n [\n '-xf',\n pathFileArchive,\n '--strip-components=1',\n '-C',\n pathDirectoryPackageContext\n ],\n {\n stdio: 'inherit'\n }\n )\n\n if (isRoot) {\n await fse.remove(pathFileArchive)\n } else {\n await fse.mkdirp(pathDirectoryPackageContext)\n await fse.move(\n pathFileArchive,\n path.join(pathDirectoryDestination, nameArchive),\n { overwrite: true }\n )\n }\n } catch (e) {\n error = isNativeError(e) ? e : new Error('Unknown Error')\n }\n\n if (cleanup) {\n await writeFile(\n pathPackageJSON,\n JSON.stringify(Object.assign(packageJSON, { version: '0.0.0' }), null, 2)\n )\n\n if (typeof pathDirectoryTemporary === 'string') {\n await fse.remove(pathDirectoryTemporary)\n }\n }\n\n return error\n}\n", "import { writeFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport process from 'process'\nimport { getPathDirectoryPackage } from './utilities/get-path-directory-package'\nimport { readPackageJSON } from './utilities/read-package-json'\n\nexport async function packCleanup() {\n const pathDirectoryPackage = await getPathDirectoryPackage(process.cwd())\n\n process.chdir(pathDirectoryPackage)\n\n const pathPackageJSON = path.join(pathDirectoryPackage, 'package.json')\n const packageJSON = await readPackageJSON(pathDirectoryPackage)\n\n await writeFile(\n pathPackageJSON,\n JSON.stringify(Object.assign(packageJSON, { version: '0.0.0' }), null, 2)\n )\n\n return undefined\n}\n", "import arg from 'arg'\nimport assert from 'assert'\nimport { assertRequirements } from './utilities/assert-requirements'\nimport { exit } from './utilities/exit'\n\nawait assertRequirements()\n\nconst { _ } = arg({}, { permissive: true })\n\nassert((_.length = 1))\nconst command = _[0]\nassert(\n command === 'workspace' || command === 'package' || command === 'cleanup'\n)\n\n// prettier-ignore\nconst run = await ({\n workspace: async () => (await import('./pack-workspace')).packWorkspace,\n package: async () => (await import('./pack-package')).packPackage,\n cleanup: async () => (await import('./pack-cleanup')).packCleanup\n}[command]())\n\nconst error = await run()\nexit(error)\n", "import which from 'which'\n\nexport async function assertRequirements() {\n await which('tar')\n await which('pnpm')\n}\n", "import { isNativeError } from 'util/types'\n\nexport function exit(error: unknown) {\n if (error !== undefined) {\n console.error(isNativeError(error) ? error.message : 'Unknown Error')\n process.exit(1)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;
|
|
6
|
-
"names": ["path", "assert", "
|
|
3
|
+
"sources": ["../../src/utilities/get-path-directory-package.ts", "../../src/utilities/read-package-json.ts", "../../src/pack-cleanup.ts", "../../src/utilities/get-name-archive.ts", "../../src/utilities/get-path-directory-workspace.ts", "../../src/pack-package.ts", "../../src/pack-workspace.ts", "../../src/index.ts", "../../src/utilities/assert-requirements.ts", "../../src/utilities/exit.ts"],
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert'\nimport { findUp } from 'find-up'\nimport path from 'node:path'\n\nexport async function getPathDirectoryPackage(cwd: string) {\n assert(typeof cwd === 'string')\n const pathFilePackageJSON = await findUp('package.json', {\n cwd,\n type: 'file'\n })\n\n assert(typeof pathFilePackageJSON === 'string')\n return path.dirname(pathFilePackageJSON)\n}\n", "import path from 'node:path'\nimport fse from 'fs-extra'\nimport assert from 'node:assert'\nimport { readFile } from 'node:fs/promises'\n\nexport async function readPackageJSON(directory: string) {\n const pathPackageJSON = path.join(directory, 'package.json')\n assert(fse.exists(pathPackageJSON))\n const content = await readFile(pathPackageJSON, 'utf8')\n assert(typeof content === 'string')\n const packageJSON = JSON.parse(content) as { name: string }\n assert(typeof packageJSON === 'object')\n assert(typeof packageJSON.name === 'string')\n\n return packageJSON\n}\n", "import { writeFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { getPathDirectoryPackage } from './utilities/get-path-directory-package'\nimport { readPackageJSON } from './utilities/read-package-json'\n\nexport async function packCleanup() {\n const pathDirectoryPackage = await getPathDirectoryPackage(process.cwd())\n\n process.chdir(pathDirectoryPackage)\n\n const pathPackageJSON = path.join(pathDirectoryPackage, 'package.json')\n const packageJSON = await readPackageJSON(pathDirectoryPackage)\n\n await writeFile(\n pathPackageJSON,\n JSON.stringify(Object.assign(packageJSON, { version: '0.0.0' }), null, 2)\n )\n\n return\n}\n", "export function getNameArchive(value: { name: string; version: string }) {\n // https://github.com/pnpm/pnpm/blob/6caec8109b563fd27ad262ce06a1f587cebbc044/releasing/plugin-commands-publishing/src/pack.ts#L98C1-L98C100\n return `${value.name.replace('@', '').replace('/', '-')}-${value.version}.tgz`\n}\n", "import assert from 'node:assert'\nimport { findUp } from 'find-up'\nimport path from 'node:path'\n\nexport async function getPathDirectoryWorkspace(cwd: string) {\n assert(typeof cwd === 'string')\n const pathFileWorkspaceYaml = await findUp('pnpm-workspace.yaml', {\n cwd,\n type: 'file'\n })\n\n return pathFileWorkspaceYaml === undefined\n ? undefined\n : path.dirname(pathFileWorkspaceYaml)\n}\n", "import arg from 'arg'\nimport { execa } from 'execa'\nimport fse from 'fs-extra'\nimport assert from 'node:assert'\nimport { mkdtemp, writeFile } from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { isNativeError } from 'node:util/types'\nimport semver from 'semver'\nimport { getNameArchive } from './utilities/get-name-archive'\nimport { getPathDirectoryPackage } from './utilities/get-path-directory-package'\nimport { getPathDirectoryWorkspace } from './utilities/get-path-directory-workspace'\nimport { readPackageJSON } from './utilities/read-package-json'\n\nexport async function packPackage() {\n let error: Error | undefined\n let pathDirectoryTemporary: string | undefined\n\n const options = arg({\n '--no-cleanup': Boolean,\n '--pack-destination': String,\n '--skip-workspace-root': Boolean,\n '--temporary-directory': String,\n '--version': String\n })\n\n const cleanup = options['--no-cleanup'] !== true\n\n const pathDirectoryPackage = await getPathDirectoryPackage(process.cwd())\n const pathDirectoryRoot =\n (await getPathDirectoryWorkspace(pathDirectoryPackage)) ??\n pathDirectoryPackage\n\n process.chdir(pathDirectoryPackage)\n\n const pathDirectoryDestination = path.resolve(\n pathDirectoryPackage,\n options['--pack-destination'] ?? 'lib'\n )\n\n const pathDirectoryPackageRelative = path.relative(\n pathDirectoryRoot,\n pathDirectoryPackage\n )\n\n const isRoot = pathDirectoryPackageRelative === ''\n const pathPackageJSON = path.join(pathDirectoryPackage, 'package.json')\n const packageJSON = await readPackageJSON(pathDirectoryPackage)\n\n const version = options['--version'] ?? '0.0.0'\n\n assert(typeof semver.valid(version) === 'string')\n\n await writeFile(\n pathPackageJSON,\n JSON.stringify(Object.assign(packageJSON, { version }), null, 2)\n )\n\n try {\n pathDirectoryTemporary =\n typeof options['--temporary-directory'] === 'string'\n ? path.resolve(pathDirectoryPackage, options['--temporary-directory'])\n : await mkdtemp(path.join(os.tmpdir(), 'pnpm-pack'))\n\n const pathDirectoryContext = path.join(pathDirectoryTemporary, 'package')\n\n // https://github.com/pnpm/pnpm/blob/6caec8109b563fd27ad262ce06a1f587cebbc044/releasing/plugin-commands-publishing/src/pack.ts#L98C1-L98C100\n const nameArchive = getNameArchive({ name: packageJSON.name, version })\n const pathFileArchive = path.join(pathDirectoryTemporary, nameArchive)\n\n await execa(\n 'pnpm',\n ['pack', '--pack-destination', pathDirectoryTemporary],\n {\n stdio: 'inherit'\n }\n )\n assert(fse.exists(pathFileArchive))\n const pathDirectoryPackageContext = path.join(\n pathDirectoryContext,\n pathDirectoryPackageRelative\n )\n await fse.mkdirp(pathDirectoryPackageContext)\n await execa(\n 'tar',\n [\n '-xf',\n pathFileArchive,\n '--strip-components=1',\n '-C',\n pathDirectoryPackageContext\n ],\n {\n stdio: 'inherit'\n }\n )\n\n if (isRoot && options['--skip-workspace-root'] === true) {\n await fse.remove(pathFileArchive)\n } else {\n await fse.mkdirp(pathDirectoryPackageContext)\n await fse.move(\n pathFileArchive,\n path.join(pathDirectoryDestination, nameArchive),\n { overwrite: true }\n )\n }\n } catch (error_) {\n error = isNativeError(error_) ? error_ : new Error('Unknown Error')\n }\n\n if (cleanup) {\n await writeFile(\n pathPackageJSON,\n JSON.stringify(Object.assign(packageJSON, { version: '0.0.0' }), null, 2)\n )\n\n if (typeof pathDirectoryTemporary === 'string') {\n await fse.remove(pathDirectoryTemporary)\n }\n }\n\n return error\n}\n", "import arg from 'arg'\nimport { execa } from 'execa'\nimport fse from 'fs-extra'\nimport assert from 'node:assert'\nimport { mkdtemp } from 'node:fs/promises'\nimport { isNativeError } from 'node:util/types'\nimport os from 'node:os'\nimport path from 'node:path'\nimport semver from 'semver'\nimport { fileURLToPath } from 'node:url'\nimport { getNameArchive } from './utilities/get-name-archive'\nimport { getPathDirectoryWorkspace } from './utilities/get-path-directory-workspace'\nimport { readPackageJSON } from './utilities/read-package-json'\nimport {\n readWantedLockfileAndAutofixConflicts,\n writeWantedLockfile\n} from '@pnpm/lockfile-file'\nimport { mapValues } from 'lodash-es'\n\nexport async function packWorkspace() {\n let error: Error | undefined\n let pathDirectoryTemporary: string | undefined\n\n const cwd = await getPathDirectoryWorkspace(process.cwd())\n\n assert.ok(cwd !== undefined)\n\n process.chdir(cwd)\n\n // https://pnpm.io/filtering\n const options = arg(\n {\n '--changed-files-ignore-pattern': String,\n '--filter': [String],\n '--filter-prod': [String],\n '--pack-destination': String,\n '--test-pattern': String,\n '--version': String,\n '--workspace-concurrency': Number\n },\n { permissive: false }\n )\n\n const version = options['--version'] ?? '0.0.0'\n assert(typeof semver.valid(version) === 'string')\n\n const pathDirectoryDestination = path.resolve(\n cwd,\n options['--pack-destination'] ?? 'lib'\n )\n\n const packageJSON = await readPackageJSON(cwd)\n const nameArchive = getNameArchive({ name: packageJSON.name, version })\n\n const filters = [\n ...(Array.isArray(options['--filter-prod'])\n ? options['--filter-prod'].flatMap((value) => ['--filter-prod', value])\n : []),\n ...(Array.isArray(options['--filter'])\n ? options['--filter'].flatMap((value) => ['--filter', value])\n : [])\n ].filter((value): value is string => typeof value === 'string')\n\n const pnpmExecArguments = [\n '--fail-if-no-match',\n '--workspace-root',\n typeof options['--workspace-concurrency'] === 'number'\n ? `--workspace-concurrency=${options['--workspace-concurrency']}`\n : undefined,\n typeof options['--test-pattern'] === 'string'\n ? `--test-pattern=${options['--test-pattern']}`\n : undefined,\n typeof options['--changed-files-ignore-pattern'] === 'string'\n ? `--changed-files-ignore-pattern=${options['--changed-files-ignore-pattern']}`\n : undefined,\n ...(filters.length === 0 ? ['--filter', '*'] : filters),\n 'exec',\n 'node',\n fileURLToPath(import.meta.url)\n ]\n\n try {\n pathDirectoryTemporary = await mkdtemp(path.join(os.tmpdir(), 'pnpm-pack'))\n\n assert(typeof pathDirectoryTemporary === 'string')\n\n await execa(\n 'pnpm',\n [\n ...pnpmExecArguments,\n 'package',\n '--skip-workspace-root',\n '--no-cleanup',\n '--temporary-directory',\n pathDirectoryTemporary,\n '--version',\n version\n ].filter((value): value is string => typeof value === 'string'),\n {\n cwd,\n stdio: 'inherit'\n }\n )\n\n const directoryPathContext = path.join(pathDirectoryTemporary, 'package')\n const pathFileArchive = path.join(pathDirectoryTemporary, nameArchive)\n\n assert(fse.exists(directoryPathContext))\n assert(fse.exists(pathFileArchive))\n\n await execa('pnpm', ['install', '--lockfile-only', '--ignore-scripts'], {\n cwd,\n stdio: 'inherit'\n })\n\n const { lockfile } = await readWantedLockfileAndAutofixConflicts(\n directoryPathContext,\n { ignoreIncompatible: false }\n )\n\n assert(lockfile !== null)\n\n const importers = mapValues(lockfile.importers, (value) => ({\n ...value,\n specifiers: mapValues(value.specifiers, (value) => {\n if (value.startsWith('workspace:')) {\n return version\n }\n\n return value\n })\n }))\n\n lockfile.importers = importers\n\n await writeWantedLockfile(directoryPathContext, lockfile)\n\n await execa(\n 'tar',\n ['-czf', pathFileArchive, '-C', pathDirectoryTemporary, 'package'],\n {\n cwd,\n stdio: 'inherit'\n }\n )\n\n await fse.remove(directoryPathContext)\n await fse.mkdirp(pathDirectoryDestination)\n await fse.move(\n pathFileArchive,\n path.join(pathDirectoryDestination, nameArchive),\n { overwrite: true }\n )\n } catch (error_) {\n error = isNativeError(error_) ? error_ : new Error('Unknown Error')\n }\n\n await execa(\n 'pnpm',\n [...pnpmExecArguments, 'cleanup'].filter(\n (value): value is string => typeof value === 'string'\n ),\n {\n cwd,\n stdio: 'inherit'\n }\n )\n\n await execa('pnpm', ['install', '--lockfile-only', '--ignore-scripts'], {\n cwd,\n stdio: 'inherit'\n })\n\n if (typeof pathDirectoryTemporary === 'string') {\n await fse.remove(pathDirectoryTemporary)\n }\n\n return error\n}\n", "import arg from 'arg'\nimport assert from 'node:assert'\nimport { assertRequirements } from './utilities/assert-requirements'\nimport { exit } from './utilities/exit'\n\nawait assertRequirements()\n\nconst { _ } = arg({}, { permissive: true })\n\nassert((_.length = 1))\nconst command = _[0]\nassert(\n command === 'workspace' || command === 'package' || command === 'cleanup'\n)\n\n// prettier-ignore\nconst run = await ({\n cleanup: async () => (await import('./pack-cleanup')).packCleanup,\n package: async () => (await import('./pack-package')).packPackage,\n workspace: async () => (await import('./pack-workspace')).packWorkspace\n}[command]())\n\nconst error = await run()\nexit(error)\n", "import which from 'which'\n\nexport async function assertRequirements() {\n await which('tar')\n await which('pnpm')\n}\n", "import { isNativeError } from 'node:util/types'\n\nexport function exit(error: unknown) {\n if (error !== undefined) {\n console.error(isNativeError(error) ? error.message : 'Unknown Error')\n process.exit(1)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAAA,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,OAAO,UAAU;AAEjB,eAAsB,wBAAwB,KAAa;AACzD,SAAO,OAAO,OAAQ,QAAQ;AAC9B,MAAM,sBAAsB,MAAM,OAAO,gBAAgB;AAAA,IACvD;AAAA,IACA,MAAM;AAAA,EACR,CAAC;AAED,gBAAO,OAAO,uBAAwB,QAAQ,GACvC,KAAK,QAAQ,mBAAmB;AACzC;AAbA;AAAA;AAAA;AAAA;AAAA;;;ACAA,OAAOA,WAAU;AACjB,OAAO,SAAS;AAChB,OAAOC,aAAY;AACnB,SAAS,gBAAgB;AAEzB,eAAsB,gBAAgB,WAAmB;AACvD,MAAM,kBAAkBD,MAAK,KAAK,WAAW,cAAc;AAC3D,EAAAC,QAAO,IAAI,OAAO,eAAe,CAAC;AAClC,MAAM,UAAU,MAAM,SAAS,iBAAiB,MAAM;A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AC;AACnBA;AAAA,EACE,YAAY,eAAe,YAAY,aAAa,YAAY;AAClE;AAGA,IAAM,MAAM,MAAO;AAAA,EACjB,SAAS,aAAa,MAAM,2EAA0B;AAAA,EACtD,SAAS,aAAa,MAAM,2EAA0B;AAAA,EACtD,WAAW,aAAa,MAAM,+EAA4B;AAC5D,EAAE,OAAO,EAAE,GAEL,QAAQ,MAAM,IAAI;AACxB,KAAK,KAAK;",
|
|
6
|
+
"names": ["path", "assert", "path", "process", "assert", "findUp", "path", "fse", "assert", "writeFile", "path", "process", "isNativeError", "error", "arg", "execa", "fse", "assert", "mkdtemp", "isNativeError", "os", "path", "semver", "error", "value", "arg", "assert", "error", "arg", "assert"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function packCleanup(): Promise<
|
|
1
|
+
export declare function packCleanup(): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=pack-cleanup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-cleanup.d.ts","sourceRoot":"","sources":["../../src/pack-cleanup.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,
|
|
1
|
+
{"version":3,"file":"pack-cleanup.d.ts","sourceRoot":"","sources":["../../src/pack-cleanup.ts"],"names":[],"mappings":"AAMA,wBAAsB,WAAW,kBAchC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-package.d.ts","sourceRoot":"","sources":["../../src/pack-package.ts"],"names":[],"mappings":"AAeA,wBAAsB,WAAW,+
|
|
1
|
+
{"version":3,"file":"pack-package.d.ts","sourceRoot":"","sources":["../../src/pack-package.ts"],"names":[],"mappings":"AAeA,wBAAsB,WAAW,+BA6GhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-workspace.d.ts","sourceRoot":"","sources":["../../src/pack-workspace.ts"],"names":[],"mappings":"AAmBA,wBAAsB,aAAa,+
|
|
1
|
+
{"version":3,"file":"pack-workspace.d.ts","sourceRoot":"","sources":["../../src/pack-workspace.ts"],"names":[],"mappings":"AAmBA,wBAAsB,aAAa,+BA+JlC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getPathDirectoryWorkspace(cwd: string): Promise<string>;
|
|
1
|
+
export declare function getPathDirectoryWorkspace(cwd: string): Promise<string | undefined>;
|
|
2
2
|
//# sourceMappingURL=get-path-directory-workspace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-path-directory-workspace.d.ts","sourceRoot":"","sources":["../../../src/utilities/get-path-directory-workspace.ts"],"names":[],"mappings":"AAIA,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"get-path-directory-workspace.d.ts","sourceRoot":"","sources":["../../../src/utilities/get-path-directory-workspace.ts"],"names":[],"mappings":"AAIA,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,MAAM,+BAU1D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapace/pnpm-pack",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "escapace",
|
|
7
7
|
"email": "opensource@escapace.com"
|
|
@@ -29,15 +29,11 @@
|
|
|
29
29
|
"@types/node": "20.12.2",
|
|
30
30
|
"@types/semver": "7.5.8",
|
|
31
31
|
"@types/which": "3.0.3",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "7.4.0",
|
|
33
|
-
"@typescript-eslint/parser": "7.4.0",
|
|
34
32
|
"esbuild": "0.20.2",
|
|
35
|
-
"eslint": "
|
|
36
|
-
"eslint-config-escapace": "
|
|
37
|
-
"eslint-config-prettier": "9.1.0",
|
|
38
|
-
"eslint-plugin-editorconfig": "4.0.3",
|
|
39
|
-
"eslint-plugin-no-null": "1.0.2",
|
|
33
|
+
"eslint": "9.0.0",
|
|
34
|
+
"eslint-config-escapace": "4.1.5",
|
|
40
35
|
"fast-glob": "3.3.2",
|
|
36
|
+
"globals": "15.0.0",
|
|
41
37
|
"husky": "9.0.11",
|
|
42
38
|
"is-ci": "3.0.1",
|
|
43
39
|
"lint-staged": "15.2.2",
|
|
@@ -47,8 +43,8 @@
|
|
|
47
43
|
"typescript": "5.4.3"
|
|
48
44
|
},
|
|
49
45
|
"engines": {
|
|
50
|
-
"node": ">=20.
|
|
51
|
-
"pnpm": ">=8.15.
|
|
46
|
+
"node": ">=20.12.0",
|
|
47
|
+
"pnpm": ">=8.15.6"
|
|
52
48
|
},
|
|
53
49
|
"exports": {
|
|
54
50
|
".": {
|
|
@@ -74,7 +70,6 @@
|
|
|
74
70
|
"scripts": {
|
|
75
71
|
"build": "node ./scripts/build.mjs",
|
|
76
72
|
"lint": "ls-lint && eslint 'src/**/*.{js,mjs,cjs,ts,mts,cts}'",
|
|
77
|
-
"release": "node ./scripts/release.mjs",
|
|
78
73
|
"test": "echo ok",
|
|
79
74
|
"typecheck": "tsc --noEmit"
|
|
80
75
|
}
|