Skip to content

Commit cef40e6

Browse files
committed
ci: include over exclude fields for dist/package.json
1 parent 55aa4cf commit cef40e6

4 files changed

Lines changed: 99 additions & 36 deletions

File tree

.github/workflows/publish.yml

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,32 @@ permissions:
1111
jobs:
1212
publish:
1313
runs-on: ubuntu-22.04
14+
environment: production
1415
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v6
17-
18-
- name: Setup pnpm
19-
uses: pnpm/action-setup@v6
20-
21-
- name: Use Node.js 24.x
22-
uses: actions/setup-node@v6
16+
- uses: actions/checkout@v6
17+
- uses: pnpm/action-setup@v6
18+
- uses: actions/setup-node@v6
2319
with:
2420
node-version: 24.x
2521

26-
- name: Install dependencies
27-
run: pnpm install --frozen-lockfile
28-
29-
- name: Build
30-
run: pnpm build
31-
32-
- name: Run tests
33-
run: pnpm test
22+
- run: pnpm install --frozen-lockfile
23+
- run: pnpm build
24+
- run: pnpm test
3425
env:
3526
CI: true
3627

28+
- name: Force upgrade npm to latest
29+
run: npm install -g npm@latest
30+
3731
- name: Publish to NPM
3832
working-directory: './dist/'
3933
run: |
4034
VERSION=${{ github.ref_name }}
4135
CLEAN_VERSION=${VERSION#v}
42-
43-
# Sync version with release tag
4436
npm version $CLEAN_VERSION --no-git-tag-version
45-
46-
# Determine dist-tag
37+
4738
TAG="latest"
48-
if [[ "$VERSION" == *"next"* ]]; then
49-
TAG="next"
50-
elif [[ "$VERSION" == *"rc"* ]]; then
51-
TAG="rc"
52-
fi
53-
39+
[[ "$VERSION" == *"next"* ]] && TAG="next"
40+
[[ "$VERSION" == *"rc"* ]] && TAG="rc"
41+
5442
npm publish --tag $TAG --access public
55-
env:
56-
# for OIDC:
57-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
NPM_CONFIG_PROVENANCE: true

build.mjs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,27 @@ for (const config of configs) {
2626
}
2727

2828
await measure(`package.json → ./dist/package.json`, `created in`, async () => {
29-
const Package = JSON.parse(
29+
const Existing = JSON.parse(
3030
await fs.readFile('./package.json', { encoding: 'utf-8' }),
3131
);
32-
delete Package.devDependencies;
33-
delete Package.scripts;
34-
await fs.writeFile('./dist/package.json', JSON.stringify(Package), {
32+
const Dist = {
33+
name: Existing.name,
34+
version: Existing.version,
35+
repository: Existing.repository,
36+
description: Existing.description,
37+
maintainers: Existing.maintainers,
38+
license: Existing.license,
39+
publishConfig: Existing.publishConfig,
40+
export: Existing.export,
41+
main: Existing.main,
42+
module: Existing.module,
43+
typings: Existing.typings,
44+
type: Existing.type,
45+
files: Existing.files,
46+
peerDependencies: Existing.peerDependencies,
47+
};
48+
49+
await fs.writeFile('./dist/package.json', JSON.stringify(Dist, null, 2), {
3550
encoding: 'utf-8',
3651
});
3752
});

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "@effector/reflect",
33
"version": "0.0.0-real-version-will-be-set-on-ci",
4-
"repository": "effector/reflect",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/effector/reflect.git"
7+
},
58
"description": "☄️ Attach effector stores to react components without hooks",
69
"maintainers": [
710
"Sergey Sova <mail@sergeysova.com> (https://sova.dev)",
@@ -31,7 +34,6 @@
3134
"typings": "index.d.ts",
3235
"files": [
3336
"Readme.md",
34-
"core",
3537
"index.d.ts",
3638
"ssr.d.ts",
3739
"scope.d.ts",
@@ -80,6 +82,7 @@
8082
"effector-react": "^23.3.0",
8183
"eslint": "^8.57.1",
8284
"eslint-kit": "^6.12.0",
85+
"eslint-plugin-jsx-a11y": "^6.10.2",
8386
"fs-extra": "^9.1.0",
8487
"husky": "^8.0.3",
8588
"jsdom": "^23.2.0",
@@ -103,5 +106,11 @@
103106
"effector": "^23.1.0",
104107
"effector-react": "^23.1.0",
105108
"react": ">=16.8.0 <20.0.0"
109+
},
110+
"pnpm": {
111+
"onlyBuiltDependencies": [
112+
"core-js-pure",
113+
"esbuild"
114+
]
106115
}
107116
}

pnpm-lock.yaml

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)