@fuman/build 0.0.7 → 0.0.8
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/cli/commands/release.d.ts +2 -0
- package/cli/commands/release.js +33 -8
- package/git/github.js +6 -4
- package/jsr/generate-workspace.js +25 -6
- package/jsr/index.d.ts +0 -1
- package/jsr.js +0 -2
- package/package.json +4 -4
- package/versioning/bump-version.js +1 -1
- package/jsr/build-jsr.d.ts +0 -7
- package/jsr/build-jsr.js +0 -146
|
@@ -2,6 +2,7 @@ import { bc } from './_utils.js';
|
|
|
2
2
|
export declare const releaseCli: bc.Command<{
|
|
3
3
|
kind: "auto" | "major" | "minor" | "patch";
|
|
4
4
|
withGithubRelease: boolean;
|
|
5
|
+
gitExtraOrigins: string | undefined;
|
|
5
6
|
githubToken: string | undefined;
|
|
6
7
|
githubRepo: string | undefined;
|
|
7
8
|
githubApiUrl: string | undefined;
|
|
@@ -19,6 +20,7 @@ export declare const releaseCli: bc.Command<{
|
|
|
19
20
|
}, {
|
|
20
21
|
kind: "auto" | "major" | "minor" | "patch";
|
|
21
22
|
withGithubRelease: boolean;
|
|
23
|
+
gitExtraOrigins: string | undefined;
|
|
22
24
|
githubToken: string | undefined;
|
|
23
25
|
githubRepo: string | undefined;
|
|
24
26
|
githubApiUrl: string | undefined;
|
package/cli/commands/release.js
CHANGED
|
@@ -21,6 +21,8 @@ const releaseCli = bc.command({
|
|
|
21
21
|
options: {
|
|
22
22
|
kind: bc.string("kind").desc("release kind").enum("major", "minor", "patch", "auto").default("auto"),
|
|
23
23
|
withGithubRelease: bc.boolean("with-github-release").desc("whether to create a github release (requires GITHUB_TOKEN env var). if false, will only create a commit with the release notes").default(false),
|
|
24
|
+
gitExtraOrigins: bc.string("git-extra-origins").desc("extra git origins to push to (e.g. for mirrors). note that these origins will be force-pushed to"),
|
|
25
|
+
// ...because for some reason forgejo fails to properly push to the mirrors on push :/
|
|
24
26
|
githubToken: bc.string("github-token").desc("github token to use for creating a release (defaults to GITHUB_TOKEN env var)"),
|
|
25
27
|
githubRepo: bc.string("github-repo").desc("github repo to create a release for (defaults to GITHUB_REPOSITORY env var)"),
|
|
26
28
|
githubApiUrl: bc.string("github-api-url").desc("github api url to use for creating a release (for github-compatible apis)"),
|
|
@@ -58,6 +60,7 @@ const releaseCli = bc.command({
|
|
|
58
60
|
workspace: workspaceWithRoot,
|
|
59
61
|
since: prevTag ?? await getFirstCommit(root),
|
|
60
62
|
type: args.kind === "auto" ? void 0 : args.kind,
|
|
63
|
+
all: args.kind !== "auto",
|
|
61
64
|
cwd: root,
|
|
62
65
|
params: config?.versioning,
|
|
63
66
|
dryRun: args.dryRun,
|
|
@@ -90,6 +93,13 @@ const releaseCli = bc.command({
|
|
|
90
93
|
process.exit(1);
|
|
91
94
|
}
|
|
92
95
|
}
|
|
96
|
+
if (!changedPackages.some((pkg) => pkg.json.version === tagName.replace(/^v/, ""))) {
|
|
97
|
+
console.log(`❗ tag ${tagName} does not match any of the package versions. did the previous release complete successfully?`);
|
|
98
|
+
console.log("❗ if so, please verify versions in package.json, tag the commit release and try again");
|
|
99
|
+
if (!args.dryRun) {
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
93
103
|
console.log("");
|
|
94
104
|
console.log("📝 generating changelog...");
|
|
95
105
|
const changelog = prevTag != null ? await generateChangelog({
|
|
@@ -161,6 +171,7 @@ const releaseCli = bc.command({
|
|
|
161
171
|
"--quiet",
|
|
162
172
|
"--allow-dirty",
|
|
163
173
|
...args.dryRun ? ["--dry-run"] : [],
|
|
174
|
+
...args.jsrToken != null ? ["--token", args.jsrToken] : [],
|
|
164
175
|
...args.jsrPublishArgs?.split(" ") ?? []
|
|
165
176
|
], {
|
|
166
177
|
env: {
|
|
@@ -187,11 +198,32 @@ ${changelog}`;
|
|
|
187
198
|
stdio: "inherit",
|
|
188
199
|
throwOnError: true
|
|
189
200
|
});
|
|
190
|
-
await exec(["git", "tag", tagName], {
|
|
201
|
+
await exec(["git", "tag", tagName, "-m", tagName], {
|
|
202
|
+
cwd: root,
|
|
203
|
+
stdio: "inherit",
|
|
204
|
+
throwOnError: true
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
if (!args.dryRun) {
|
|
208
|
+
await exec(["git", "push", "--follow-tags"], {
|
|
191
209
|
cwd: root,
|
|
192
210
|
stdio: "inherit",
|
|
193
211
|
throwOnError: true
|
|
194
212
|
});
|
|
213
|
+
if (args.gitExtraOrigins != null) {
|
|
214
|
+
for (const origin of args.gitExtraOrigins.split(",")) {
|
|
215
|
+
await exec(["git", "push", origin, "--force"], {
|
|
216
|
+
cwd: root,
|
|
217
|
+
stdio: "inherit",
|
|
218
|
+
throwOnError: true
|
|
219
|
+
});
|
|
220
|
+
await exec(["git", "push", origin, "--force", "--tags"], {
|
|
221
|
+
cwd: root,
|
|
222
|
+
stdio: "inherit",
|
|
223
|
+
throwOnError: true
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
195
227
|
}
|
|
196
228
|
if (args.withGithubRelease) {
|
|
197
229
|
if (args.dryRun) {
|
|
@@ -222,13 +254,6 @@ ${changelog}`;
|
|
|
222
254
|
console.log(`\x1B[;32m✅github release created: https://github.com/${repo}/releases/tag/${tagName}\x1B[;0m`);
|
|
223
255
|
}
|
|
224
256
|
}
|
|
225
|
-
if (!args.dryRun) {
|
|
226
|
-
await exec(["git", "push", "--follow-tags"], {
|
|
227
|
-
cwd: root,
|
|
228
|
-
stdio: "inherit",
|
|
229
|
-
throwOnError: true
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
257
|
console.log("");
|
|
233
258
|
console.log("🎉 done!");
|
|
234
259
|
}
|
package/git/github.js
CHANGED
|
@@ -20,16 +20,18 @@ async function createGithubRelease(params) {
|
|
|
20
20
|
tag_name: params.tag,
|
|
21
21
|
name: params.name,
|
|
22
22
|
body: params.body,
|
|
23
|
-
draft: params.draft,
|
|
24
|
-
prerelease: params.prerelease
|
|
23
|
+
draft: params.draft ?? false,
|
|
24
|
+
prerelease: params.prerelease ?? false
|
|
25
25
|
},
|
|
26
26
|
validateResponse: (res) => res.status === 201
|
|
27
27
|
}).parsedJson(z.object({
|
|
28
|
-
id: z.number()
|
|
28
|
+
id: z.number(),
|
|
29
|
+
upload_url: z.string()
|
|
29
30
|
}));
|
|
31
|
+
const uploadUrl = release.upload_url.split("{")[0];
|
|
30
32
|
if (params.artifacts != null && params.artifacts.length > 0) {
|
|
31
33
|
await asyncPool(params.artifacts, async (file) => {
|
|
32
|
-
await ffetch(
|
|
34
|
+
await ffetch(uploadUrl, {
|
|
33
35
|
method: "POST",
|
|
34
36
|
query: { name: file.name },
|
|
35
37
|
headers: {
|
|
@@ -2,6 +2,7 @@ import * as fsp from "node:fs/promises";
|
|
|
2
2
|
import { join, relative } from "node:path";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { asyncPool } from "@fuman/utils";
|
|
5
|
+
import picomatch from "picomatch";
|
|
5
6
|
import { glob } from "tinyglobby";
|
|
6
7
|
import ts from "typescript";
|
|
7
8
|
import { loadBuildConfig } from "../misc/_config.js";
|
|
@@ -62,12 +63,18 @@ async function generateDenoWorkspace(params) {
|
|
|
62
63
|
const packageConfigJsr = packageConfig?.jsr;
|
|
63
64
|
const srcDir = join(packageRoot, normalizeFilePath(packageConfigJsr?.sourceDir ?? rootConfig?.sourceDir ?? ""));
|
|
64
65
|
const excludeFiles = mergeArrays(rootConfig?.exclude, packageConfigJsr?.exclude);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
const exludeFilesPico = picomatch(excludeFiles);
|
|
67
|
+
await fsp.cp(srcDir, packageOutRoot, {
|
|
68
|
+
recursive: true,
|
|
69
|
+
filter(source) {
|
|
70
|
+
if (exludeFilesPico(relative(srcDir, source))) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
70
75
|
});
|
|
76
|
+
const printer = ts.createPrinter();
|
|
77
|
+
const tsFiles = await glob("**/*.ts", { cwd: packageOutRoot });
|
|
71
78
|
await asyncPool(tsFiles, async (filename) => {
|
|
72
79
|
const fullFilePath = join(packageOutRoot, filename);
|
|
73
80
|
let fileContent = await fsp.readFile(fullFilePath, "utf8");
|
|
@@ -121,7 +128,7 @@ async function generateDenoWorkspace(params) {
|
|
|
121
128
|
}
|
|
122
129
|
});
|
|
123
130
|
const hookContext = {
|
|
124
|
-
outDir:
|
|
131
|
+
outDir: packageOutRoot,
|
|
125
132
|
packageDir: packageOutRoot,
|
|
126
133
|
packageName: pkg.json.name,
|
|
127
134
|
packageJson: pkg.json,
|
|
@@ -144,6 +151,8 @@ async function generateDenoWorkspace(params) {
|
|
|
144
151
|
packageJson.version = fixedVersion;
|
|
145
152
|
packageJsonOrig.version = fixedVersion;
|
|
146
153
|
}
|
|
154
|
+
hookContext.packageJson = packageJson;
|
|
155
|
+
await packageConfig?.finalizePackageJson?.(hookContext);
|
|
147
156
|
const denoJson = packageJsonToDeno({
|
|
148
157
|
packageJson,
|
|
149
158
|
packageJsonOrig,
|
|
@@ -152,6 +161,7 @@ async function generateDenoWorkspace(params) {
|
|
|
152
161
|
baseDir: relative(packageRoot, srcDir),
|
|
153
162
|
exclude: excludeFiles
|
|
154
163
|
});
|
|
164
|
+
packageConfig?.jsr?.finalizeDenoJson?.(hookContext, denoJson);
|
|
155
165
|
await fsp.writeFile(join(packageOutRoot, "deno.json"), JSON.stringify(denoJson, null, 4));
|
|
156
166
|
for (const file of mergeArrays(rootConfig?.copyRootFiles, packageConfig?.jsr?.copyRootFiles, ["LICENSE"])) {
|
|
157
167
|
await tryCopy(join(workspaceRoot, file), join(packageOutRoot, file), { recursive: true });
|
|
@@ -159,8 +169,17 @@ async function generateDenoWorkspace(params) {
|
|
|
159
169
|
for (const file of mergeArrays(rootConfig?.copyPackageFiles, packageConfig?.jsr?.copyPackageFiles, ["README.md"])) {
|
|
160
170
|
await tryCopy(join(packageRoot, file), join(packageOutRoot, file), { recursive: true });
|
|
161
171
|
}
|
|
172
|
+
await packageConfig?.jsr?.finalize?.(hookContext);
|
|
162
173
|
}
|
|
163
174
|
await fsp.writeFile(join(outDir, "deno.json"), JSON.stringify(rootDenoJson, null, 4));
|
|
175
|
+
await rootConfig?.finalize?.({
|
|
176
|
+
outDir,
|
|
177
|
+
packageDir: outDir,
|
|
178
|
+
packageName: "<jsr-root>",
|
|
179
|
+
packageJson: {},
|
|
180
|
+
jsr: true,
|
|
181
|
+
typedoc: false
|
|
182
|
+
});
|
|
164
183
|
if (rootConfig?.dryRun !== false || withDryRun) {
|
|
165
184
|
await exec(["deno", "publish", "--dry-run", "-q", "--allow-dirty"], {
|
|
166
185
|
cwd: outDir,
|
package/jsr/index.d.ts
CHANGED
package/jsr.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { runJsrBuild } from "./jsr/build-jsr.js";
|
|
2
1
|
import { packageJsonToDeno } from "./jsr/deno-json.js";
|
|
3
2
|
import { populateFromUpstream } from "./jsr/populate.js";
|
|
4
3
|
import { getModuleCacheDirectory, parseImportSpecifier, splitImportRequest } from "./jsr/utils/external-libs.js";
|
|
@@ -18,6 +17,5 @@ export {
|
|
|
18
17
|
parseImportSpecifier,
|
|
19
18
|
parseJsrJson,
|
|
20
19
|
populateFromUpstream,
|
|
21
|
-
runJsrBuild,
|
|
22
20
|
splitImportRequest
|
|
23
21
|
};
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuman/build",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "utils for building packages and managing monorepos",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@drizzle-team/brocli": "^0.10.2",
|
|
10
|
-
"@fuman/fetch": "^0.0.
|
|
11
|
-
"@fuman/io": "^0.0.
|
|
12
|
-
"@fuman/node": "^0.0.
|
|
10
|
+
"@fuman/fetch": "^0.0.8",
|
|
11
|
+
"@fuman/io": "^0.0.8",
|
|
12
|
+
"@fuman/node": "^0.0.8",
|
|
13
13
|
"@fuman/utils": "^0.0.4",
|
|
14
14
|
"cross-spawn": "^7.0.5",
|
|
15
15
|
"detect-indent": "^7.0.1",
|
|
@@ -75,7 +75,6 @@ async function bumpVersion(params) {
|
|
|
75
75
|
const workspaceVersions = collectVersions(workspace);
|
|
76
76
|
const result = [];
|
|
77
77
|
for (const pkg of changedPackages) {
|
|
78
|
-
if (pkg.json.fuman?.ownVersioning) continue;
|
|
79
78
|
result.push({
|
|
80
79
|
package: pkg,
|
|
81
80
|
prevVersion: asNonNull(pkg.json.version)
|
|
@@ -117,6 +116,7 @@ async function bumpVersion(params) {
|
|
|
117
116
|
packagesToBump.push(findRootPackage(workspace));
|
|
118
117
|
}
|
|
119
118
|
for (const pkg of packagesToBump) {
|
|
119
|
+
if (pkg.json.fuman?.ownVersioning) continue;
|
|
120
120
|
if (!dryRun) {
|
|
121
121
|
const pkgJsonPath = join(pkg.path, "package.json");
|
|
122
122
|
const pkgJsonText = await fsp.readFile(pkgJsonPath, "utf8");
|
package/jsr/build-jsr.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { WorkspacePackage } from '../package-json/collect-package-jsons.js';
|
|
2
|
-
import { JsrConfig } from './config.js';
|
|
3
|
-
export declare function runJsrBuild(params: {
|
|
4
|
-
packageName: string;
|
|
5
|
-
workspacePackages: WorkspacePackage[];
|
|
6
|
-
rootConfig?: JsrConfig;
|
|
7
|
-
}): Promise<void>;
|
package/jsr/build-jsr.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import * as fsp from "node:fs/promises";
|
|
2
|
-
import { join, relative } from "node:path";
|
|
3
|
-
import { asyncPool, asNonNull } from "@fuman/utils";
|
|
4
|
-
import { glob } from "tinyglobby";
|
|
5
|
-
import ts from "typescript";
|
|
6
|
-
import { loadBuildConfig } from "../misc/_config.js";
|
|
7
|
-
import { exec } from "../misc/exec.js";
|
|
8
|
-
import { tryCopy } from "../misc/fs.js";
|
|
9
|
-
import { normalizeFilePath } from "../misc/path.js";
|
|
10
|
-
import { processPackageJson } from "../package-json/process-package-json.js";
|
|
11
|
-
import { findPackageByName, findRootPackage, collectVersions } from "../package-json/utils.js";
|
|
12
|
-
import { packageJsonToDeno } from "./deno-json.js";
|
|
13
|
-
function mergeArrays(a, b, defaultValue = []) {
|
|
14
|
-
if (!a) return b ?? defaultValue;
|
|
15
|
-
if (!b) return a;
|
|
16
|
-
return [...a, ...b];
|
|
17
|
-
}
|
|
18
|
-
async function runJsrBuild(params) {
|
|
19
|
-
const {
|
|
20
|
-
packageName,
|
|
21
|
-
workspacePackages,
|
|
22
|
-
rootConfig
|
|
23
|
-
} = params;
|
|
24
|
-
const ourPackage = findPackageByName(workspacePackages, packageName);
|
|
25
|
-
const rootPackage = findRootPackage(workspacePackages);
|
|
26
|
-
const packageRoot = ourPackage.path;
|
|
27
|
-
const workspaceRoot = rootPackage.path;
|
|
28
|
-
const outDir = join(packageRoot, normalizeFilePath(rootConfig?.outputDir ?? "dist"));
|
|
29
|
-
const packageConfig = await loadBuildConfig(packageRoot);
|
|
30
|
-
const srcDir = join(packageRoot, normalizeFilePath(packageConfig?.jsr?.sourceDir ?? rootConfig?.sourceDir ?? ""));
|
|
31
|
-
const excludeFiles = mergeArrays(rootConfig?.exclude, packageConfig?.jsr?.exclude);
|
|
32
|
-
await fsp.rm(outDir, { recursive: true, force: true });
|
|
33
|
-
await fsp.mkdir(outDir, { recursive: true });
|
|
34
|
-
await asyncPool(await fsp.readdir(srcDir), async (file) => {
|
|
35
|
-
const src = join(srcDir, file);
|
|
36
|
-
if (src === outDir) return;
|
|
37
|
-
await fsp.cp(src, join(outDir, file), { recursive: true });
|
|
38
|
-
});
|
|
39
|
-
const printer = ts.createPrinter();
|
|
40
|
-
const tsFiles = await glob("**/*.ts", {
|
|
41
|
-
cwd: outDir,
|
|
42
|
-
ignore: excludeFiles
|
|
43
|
-
});
|
|
44
|
-
const badImports = [];
|
|
45
|
-
await asyncPool(tsFiles, async (filename) => {
|
|
46
|
-
const fullFilePath = join(outDir, filename);
|
|
47
|
-
let fileContent = await fsp.readFile(fullFilePath, "utf8");
|
|
48
|
-
let changed = false;
|
|
49
|
-
const file = ts.createSourceFile(filename, fileContent, ts.ScriptTarget.ESNext, true);
|
|
50
|
-
let changedTs = false;
|
|
51
|
-
for (const imp of file.statements) {
|
|
52
|
-
if (!ts.isImportDeclaration(imp) && !ts.isExportDeclaration(imp)) {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
if (!imp.moduleSpecifier || !ts.isStringLiteral(imp.moduleSpecifier)) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
const mod = imp.moduleSpecifier.text;
|
|
59
|
-
if (mod[0] !== ".") {
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
if (mod.endsWith(".js")) {
|
|
63
|
-
changedTs = true;
|
|
64
|
-
imp.moduleSpecifier = ts.factory.createStringLiteral(
|
|
65
|
-
mod.replace(/\.js$/, ".ts")
|
|
66
|
-
);
|
|
67
|
-
} else {
|
|
68
|
-
badImports.push(` from ${mod} at ${join(srcDir, filename)}`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (rootConfig?.transformAst?.(file)) {
|
|
72
|
-
changedTs = true;
|
|
73
|
-
}
|
|
74
|
-
if (packageConfig?.jsr?.transformAst?.(file)) {
|
|
75
|
-
changedTs = true;
|
|
76
|
-
}
|
|
77
|
-
if (changedTs) {
|
|
78
|
-
fileContent = printer.printFile(file);
|
|
79
|
-
changed = true;
|
|
80
|
-
}
|
|
81
|
-
if (rootConfig?.transformCode || packageConfig?.jsr?.transformCode) {
|
|
82
|
-
const origFileContent = fileContent;
|
|
83
|
-
if (rootConfig?.transformCode) {
|
|
84
|
-
fileContent = rootConfig.transformCode(filename, fileContent);
|
|
85
|
-
}
|
|
86
|
-
if (packageConfig?.jsr?.transformCode) {
|
|
87
|
-
fileContent = packageConfig.jsr.transformCode(filename, fileContent);
|
|
88
|
-
}
|
|
89
|
-
if (fileContent !== origFileContent) {
|
|
90
|
-
changed = true;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (changed) {
|
|
94
|
-
await fsp.writeFile(fullFilePath, fileContent);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
if (badImports.length > 0) {
|
|
98
|
-
throw new Error(`Found ${badImports.length} invalid imports (you must specify .js extension):
|
|
99
|
-
${badImports.join("\n")}`);
|
|
100
|
-
}
|
|
101
|
-
const hookContext = {
|
|
102
|
-
outDir: "",
|
|
103
|
-
packageDir: ourPackage.path,
|
|
104
|
-
packageName: asNonNull(ourPackage.json.name),
|
|
105
|
-
packageJson: ourPackage.json,
|
|
106
|
-
jsr: true,
|
|
107
|
-
typedoc: false
|
|
108
|
-
};
|
|
109
|
-
packageConfig?.preparePackageJson?.(hookContext);
|
|
110
|
-
const workspaceVersions = collectVersions(workspacePackages);
|
|
111
|
-
const { packageJson, packageJsonOrig } = processPackageJson({
|
|
112
|
-
packageJson: ourPackage.json,
|
|
113
|
-
rootPackageJson: rootPackage.json,
|
|
114
|
-
workspaceVersions,
|
|
115
|
-
// since there's no bundling, we can't drop any deps.
|
|
116
|
-
// we *could* copy them from node_modules and add to the import map,
|
|
117
|
-
// but maybe sometime later
|
|
118
|
-
bundledWorkspaceDeps: [],
|
|
119
|
-
rootFieldsToCopy: ["license"]
|
|
120
|
-
});
|
|
121
|
-
const denoJson = packageJsonToDeno({
|
|
122
|
-
packageJson,
|
|
123
|
-
packageJsonOrig,
|
|
124
|
-
workspaceVersions,
|
|
125
|
-
buildDirName: relative(packageRoot, outDir),
|
|
126
|
-
baseDir: relative(packageRoot, srcDir),
|
|
127
|
-
exclude: excludeFiles
|
|
128
|
-
});
|
|
129
|
-
await fsp.writeFile(join(outDir, "deno.json"), JSON.stringify(denoJson, null, 4));
|
|
130
|
-
for (const file of mergeArrays(rootConfig?.copyRootFiles, packageConfig?.jsr?.copyRootFiles, ["LICENSE"])) {
|
|
131
|
-
await tryCopy(join(workspaceRoot, file), join(outDir, file), { recursive: true });
|
|
132
|
-
}
|
|
133
|
-
for (const file of mergeArrays(rootConfig?.copyPackageFiles, packageConfig?.jsr?.copyPackageFiles, ["README.md"])) {
|
|
134
|
-
await tryCopy(join(packageRoot, file), join(outDir, file), { recursive: true });
|
|
135
|
-
}
|
|
136
|
-
if (!packageConfig?.jsr?.dryRun && !rootConfig?.dryRun) {
|
|
137
|
-
await exec(["deno", "publish", "--dry-run", "-q", "--allow-dirty"], {
|
|
138
|
-
cwd: outDir,
|
|
139
|
-
stdio: "inherit",
|
|
140
|
-
throwOnError: true
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
export {
|
|
145
|
-
runJsrBuild
|
|
146
|
-
};
|