rhine-var 0.10.5 → 0.11.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/.github/workflows/release.yml +137 -137
- package/LICENSE +201 -201
- package/README.md +224 -224
- package/README_zh.md +243 -243
- package/bun.lock +991 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +72 -72
- package/playground/general/index.mjs +19 -19
- package/playground/general/package.json +12 -12
- package/playground/next/next.config.mjs +4 -4
- package/playground/next/package.json +17 -17
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
name: Auto Release and Publish via package version
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
paths:
|
|
8
|
-
- 'package.json'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
|
|
12
|
-
Version:
|
|
13
|
-
name: Analysis Version
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
outputs:
|
|
16
|
-
version_changed: ${{ steps.detect.outputs.version_changed }}
|
|
17
|
-
current_version: ${{ steps.detect.outputs.current_version }}
|
|
18
|
-
steps:
|
|
19
|
-
- name: Checkout Code
|
|
20
|
-
uses: actions/checkout@v4
|
|
21
|
-
with:
|
|
22
|
-
fetch-depth: 2
|
|
23
|
-
|
|
24
|
-
- name: Detect version change
|
|
25
|
-
id: detect
|
|
26
|
-
run: |
|
|
27
|
-
CURRENT_VERSION=$(jq -r .version package.json)
|
|
28
|
-
echo "Current version: $CURRENT_VERSION"
|
|
29
|
-
|
|
30
|
-
git checkout HEAD~1 -- package.json 2>/dev/null || true
|
|
31
|
-
PREVIOUS_VERSION=$(jq -r .version package.json 2>/dev/null || echo "0.0.0")
|
|
32
|
-
echo "Previous version: $PREVIOUS_VERSION"
|
|
33
|
-
|
|
34
|
-
if [[ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]]; then
|
|
35
|
-
echo "version_changed=true" >> $GITHUB_OUTPUT
|
|
36
|
-
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
37
|
-
else
|
|
38
|
-
echo "version_changed=false" >> $GITHUB_OUTPUT
|
|
39
|
-
fi
|
|
40
|
-
|
|
41
|
-
Release:
|
|
42
|
-
name: Release and Tag
|
|
43
|
-
needs: Version
|
|
44
|
-
if: ${{ needs.Version.outputs.version_changed == 'true' }}
|
|
45
|
-
runs-on: ubuntu-latest
|
|
46
|
-
steps:
|
|
47
|
-
- name: Checkout Code
|
|
48
|
-
uses: actions/checkout@v4
|
|
49
|
-
|
|
50
|
-
- name: Create Release and Tag
|
|
51
|
-
uses: actions/create-release@v1
|
|
52
|
-
env:
|
|
53
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
54
|
-
with:
|
|
55
|
-
tag_name: v${{ needs.Version.outputs.current_version }}
|
|
56
|
-
release_name: v${{ needs.Version.outputs.current_version }}
|
|
57
|
-
body: "Install: https://www.npmjs.com/package/rhine-var"
|
|
58
|
-
draft: false
|
|
59
|
-
prerelease: false
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Publish:
|
|
63
|
-
name: Publish to NPM
|
|
64
|
-
needs: Version
|
|
65
|
-
if: ${{ needs.Version.outputs.version_changed == 'true' }}
|
|
66
|
-
runs-on: ubuntu-latest
|
|
67
|
-
steps:
|
|
68
|
-
|
|
69
|
-
- name: Checkout Code
|
|
70
|
-
uses: actions/checkout@v4
|
|
71
|
-
|
|
72
|
-
- name: Setup Node.js Environment
|
|
73
|
-
uses: actions/setup-node@v4
|
|
74
|
-
with:
|
|
75
|
-
node-version: "20"
|
|
76
|
-
registry-url: https://registry.npmjs.org/
|
|
77
|
-
cache: "yarn"
|
|
78
|
-
|
|
79
|
-
- name: Install Dependencies
|
|
80
|
-
run: yarn install --frozen-lockfile
|
|
81
|
-
|
|
82
|
-
- name: Run Unit Tests
|
|
83
|
-
run: yarn test
|
|
84
|
-
|
|
85
|
-
- name: Build Project
|
|
86
|
-
run: yarn build
|
|
87
|
-
|
|
88
|
-
- name: Publish to NPM
|
|
89
|
-
run: npm publish
|
|
90
|
-
env:
|
|
91
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
92
|
-
|
|
93
|
-
Packages:
|
|
94
|
-
name: Publish to GitHub
|
|
95
|
-
needs: Version
|
|
96
|
-
if: ${{ needs.Version.outputs.version_changed == 'true' }}
|
|
97
|
-
runs-on: ubuntu-latest
|
|
98
|
-
permissions:
|
|
99
|
-
contents: read
|
|
100
|
-
packages: write
|
|
101
|
-
steps:
|
|
102
|
-
|
|
103
|
-
- name: Checkout Code
|
|
104
|
-
uses: actions/checkout@v4
|
|
105
|
-
|
|
106
|
-
- name: Setup Node.js Environment
|
|
107
|
-
uses: actions/setup-node@v4
|
|
108
|
-
with:
|
|
109
|
-
node-version: "20"
|
|
110
|
-
cache: "yarn"
|
|
111
|
-
|
|
112
|
-
- name: Install Dependencies
|
|
113
|
-
run: yarn install --frozen-lockfile
|
|
114
|
-
|
|
115
|
-
- name: Run Unit Tests
|
|
116
|
-
run: yarn test
|
|
117
|
-
|
|
118
|
-
- name: Build Project
|
|
119
|
-
run: yarn build
|
|
120
|
-
|
|
121
|
-
- name: Add scope to package.json
|
|
122
|
-
run: |
|
|
123
|
-
sudo apt-get install -y jq
|
|
124
|
-
cp package.json package.json.bak
|
|
125
|
-
jq '.name = "@RhineAI/\(.name)" | .repository.url = "git+https://github.com/RhineAI/rhine-var.git"' package.json > package.json.tmp
|
|
126
|
-
mv package.json.tmp package.json
|
|
127
|
-
jq empty package.json
|
|
128
|
-
|
|
129
|
-
- name: Configure npm Registry
|
|
130
|
-
run: |
|
|
131
|
-
npm config set @RhineAI:registry=https://npm.pkg.github.com
|
|
132
|
-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
|
|
133
|
-
|
|
134
|
-
- name: Publish to Github
|
|
135
|
-
run: npm publish
|
|
136
|
-
env:
|
|
137
|
-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
1
|
+
name: Auto Release and Publish via package version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- 'package.json'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
|
|
12
|
+
Version:
|
|
13
|
+
name: Analysis Version
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
outputs:
|
|
16
|
+
version_changed: ${{ steps.detect.outputs.version_changed }}
|
|
17
|
+
current_version: ${{ steps.detect.outputs.current_version }}
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout Code
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 2
|
|
23
|
+
|
|
24
|
+
- name: Detect version change
|
|
25
|
+
id: detect
|
|
26
|
+
run: |
|
|
27
|
+
CURRENT_VERSION=$(jq -r .version package.json)
|
|
28
|
+
echo "Current version: $CURRENT_VERSION"
|
|
29
|
+
|
|
30
|
+
git checkout HEAD~1 -- package.json 2>/dev/null || true
|
|
31
|
+
PREVIOUS_VERSION=$(jq -r .version package.json 2>/dev/null || echo "0.0.0")
|
|
32
|
+
echo "Previous version: $PREVIOUS_VERSION"
|
|
33
|
+
|
|
34
|
+
if [[ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]]; then
|
|
35
|
+
echo "version_changed=true" >> $GITHUB_OUTPUT
|
|
36
|
+
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
37
|
+
else
|
|
38
|
+
echo "version_changed=false" >> $GITHUB_OUTPUT
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
Release:
|
|
42
|
+
name: Release and Tag
|
|
43
|
+
needs: Version
|
|
44
|
+
if: ${{ needs.Version.outputs.version_changed == 'true' }}
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
steps:
|
|
47
|
+
- name: Checkout Code
|
|
48
|
+
uses: actions/checkout@v4
|
|
49
|
+
|
|
50
|
+
- name: Create Release and Tag
|
|
51
|
+
uses: actions/create-release@v1
|
|
52
|
+
env:
|
|
53
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
54
|
+
with:
|
|
55
|
+
tag_name: v${{ needs.Version.outputs.current_version }}
|
|
56
|
+
release_name: v${{ needs.Version.outputs.current_version }}
|
|
57
|
+
body: "Install: https://www.npmjs.com/package/rhine-var"
|
|
58
|
+
draft: false
|
|
59
|
+
prerelease: false
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
Publish:
|
|
63
|
+
name: Publish to NPM
|
|
64
|
+
needs: Version
|
|
65
|
+
if: ${{ needs.Version.outputs.version_changed == 'true' }}
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
|
|
69
|
+
- name: Checkout Code
|
|
70
|
+
uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Setup Node.js Environment
|
|
73
|
+
uses: actions/setup-node@v4
|
|
74
|
+
with:
|
|
75
|
+
node-version: "20"
|
|
76
|
+
registry-url: https://registry.npmjs.org/
|
|
77
|
+
cache: "yarn"
|
|
78
|
+
|
|
79
|
+
- name: Install Dependencies
|
|
80
|
+
run: yarn install --frozen-lockfile
|
|
81
|
+
|
|
82
|
+
- name: Run Unit Tests
|
|
83
|
+
run: yarn test
|
|
84
|
+
|
|
85
|
+
- name: Build Project
|
|
86
|
+
run: yarn build
|
|
87
|
+
|
|
88
|
+
- name: Publish to NPM
|
|
89
|
+
run: npm publish
|
|
90
|
+
env:
|
|
91
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
92
|
+
|
|
93
|
+
Packages:
|
|
94
|
+
name: Publish to GitHub
|
|
95
|
+
needs: Version
|
|
96
|
+
if: ${{ needs.Version.outputs.version_changed == 'true' }}
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
permissions:
|
|
99
|
+
contents: read
|
|
100
|
+
packages: write
|
|
101
|
+
steps:
|
|
102
|
+
|
|
103
|
+
- name: Checkout Code
|
|
104
|
+
uses: actions/checkout@v4
|
|
105
|
+
|
|
106
|
+
- name: Setup Node.js Environment
|
|
107
|
+
uses: actions/setup-node@v4
|
|
108
|
+
with:
|
|
109
|
+
node-version: "20"
|
|
110
|
+
cache: "yarn"
|
|
111
|
+
|
|
112
|
+
- name: Install Dependencies
|
|
113
|
+
run: yarn install --frozen-lockfile
|
|
114
|
+
|
|
115
|
+
- name: Run Unit Tests
|
|
116
|
+
run: yarn test
|
|
117
|
+
|
|
118
|
+
- name: Build Project
|
|
119
|
+
run: yarn build
|
|
120
|
+
|
|
121
|
+
- name: Add scope to package.json
|
|
122
|
+
run: |
|
|
123
|
+
sudo apt-get install -y jq
|
|
124
|
+
cp package.json package.json.bak
|
|
125
|
+
jq '.name = "@RhineAI/\(.name)" | .repository.url = "git+https://github.com/RhineAI/rhine-var.git"' package.json > package.json.tmp
|
|
126
|
+
mv package.json.tmp package.json
|
|
127
|
+
jq empty package.json
|
|
128
|
+
|
|
129
|
+
- name: Configure npm Registry
|
|
130
|
+
run: |
|
|
131
|
+
npm config set @RhineAI:registry=https://npm.pkg.github.com
|
|
132
|
+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
|
|
133
|
+
|
|
134
|
+
- name: Publish to Github
|
|
135
|
+
run: npm publish
|
|
136
|
+
env:
|
|
137
|
+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|