Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisl9029 committed Aug 7, 2024
1 parent 1e99a0f commit 8852368
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swc/core",
"version": "1.7.7-nightly-20240806.4-10",
"version": "1.7.7-nightly-20240806.4-11",
"description": "Super-fast alternative for babel",
"homepage": "https://swc.rs",
"main": "./index.js",
Expand Down
26 changes: 25 additions & 1 deletion packages/core/scripts/update-package-jsons.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
import * as fs from "fs/promises";

const path = "./package.json";
const packageJsonCore = JSON.parse(
await fs.readFile(path, {
encoding: "utf-8",
}),
);

await fs.writeFile(
path,
JSON.stringify(
{
...packageJsonCore,
name:
"@lewisl9029/swc-core" + packageJsonCore.name.slice("@swc/core".length),
repository: {
...packageJsonCore.repository,
url: "git+https://github.com/reflame/swc.git",
},
},
null,
2,
),
);

const paths = [
"./package.json",
...(await fs.readdir("./scripts/npm")).map(
(directory) => `./scripts/npm/${directory}/package.json`,
),
Expand All @@ -22,6 +45,7 @@ await Promise.all(
...packageJson,
name:
"@lewisl9029/swc-core" + packageJson.name.slice("@swc/core".length),
version: packageJsonCore.version,
repository: {
...packageJson.repository,
url: "git+https://github.com/reflame/swc.git",
Expand Down

0 comments on commit 8852368

Please sign in to comment.