Skip to content

Commit 0c39908

Browse files
authored
Merge pull request #131 from Next2D/develop
Develop
2 parents 73634b5 + 2afbdf3 commit 0c39908

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- uses: actions/setup-node@v4
2020
with:
2121
registry-url: "https://registry.npmjs.org"
22+
- run: npm run release
2223
- run: npm install
2324
- run: npm run publish
2425
- run: cd ~/work/framework/framework/dist && npm publish --access public

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
],
2222
"scripts": {
2323
"lint": "eslint src/**/*.ts",
24+
"release": "node ./scripts/release.js",
2425
"publish": "node ./scripts/clean.js && node ./scripts/version.js && tsc && node ./scripts/publish.js",
2526
"test": "vitest"
2627
},

scripts/publish.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,10 @@ import { join } from "path";
1313
*/
1414
const execute = () =>
1515
{
16-
const packageJson = JSON.parse(
17-
readFileSync(`${process.cwd()}/package.json`, { "encoding": "utf8" })
18-
);
19-
20-
delete packageJson.peerDependencies;
21-
packageJson.dependencies = { "@next2d/player": "*" };
22-
23-
// write package.json
24-
writeFileSync(
25-
join(process.cwd(), "dist/package.json"),
26-
JSON.stringify(packageJson, null, 2)
16+
// package.json file
17+
spawnSync(
18+
`cp -r ${process.cwd()}/package.json ${process.cwd()}/dist/package.json`,
19+
{ "shell": true }
2720
);
2821

2922
// LICENSE

scripts/release.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
3+
"use strict";
4+
5+
const execute = () =>
6+
{
7+
const packageJson = JSON.parse(
8+
readFileSync(`${process.cwd()}/package.json`, { "encoding": "utf8" })
9+
);
10+
11+
delete packageJson.peerDependencies;
12+
packageJson.dependencies = { "@next2d/player": "*" };
13+
14+
// write package.json
15+
writeFileSync(
16+
join(process.cwd(), "package.json"),
17+
JSON.stringify(packageJson, null, 2)
18+
);
19+
};
20+
21+
execute();

0 commit comments

Comments
 (0)