@rimori/client 2.4.0-next.6 → 2.4.0-next.7
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/package.json +5 -1
- package/.github/workflows/create-release-branch.yml +0 -226
- package/.github/workflows/pre-release.yml +0 -126
- package/.github/workflows/release-on-merge.yml +0 -195
- package/.prettierignore +0 -35
- package/eslint.config.js +0 -53
- package/example/docs/devdocs.md +0 -241
- package/example/docs/overview.md +0 -29
- package/example/docs/userdocs.md +0 -126
- package/example/rimori.config.ts +0 -91
- package/example/worker/vite.config.ts +0 -26
- package/example/worker/worker.ts +0 -11
- package/prettier.config.js +0 -8
- package/src/cli/scripts/init/dev-registration.ts +0 -191
- package/src/cli/scripts/init/env-setup.ts +0 -44
- package/src/cli/scripts/init/file-operations.ts +0 -58
- package/src/cli/scripts/init/html-cleaner.ts +0 -45
- package/src/cli/scripts/init/main.ts +0 -176
- package/src/cli/scripts/init/package-setup.ts +0 -113
- package/src/cli/scripts/init/router-transformer.ts +0 -332
- package/src/cli/scripts/init/tailwind-config.ts +0 -66
- package/src/cli/scripts/init/vite-config.ts +0 -73
- package/src/cli/scripts/release/detect-translation-languages.ts +0 -37
- package/src/cli/scripts/release/release-config-upload.ts +0 -119
- package/src/cli/scripts/release/release-db-update.ts +0 -97
- package/src/cli/scripts/release/release-file-upload.ts +0 -138
- package/src/cli/scripts/release/release.ts +0 -85
- package/src/cli/types/DatabaseTypes.ts +0 -125
- package/src/controller/AIController.ts +0 -295
- package/src/controller/AccomplishmentController.ts +0 -188
- package/src/controller/AudioController.ts +0 -64
- package/src/controller/ObjectController.ts +0 -120
- package/src/controller/SettingsController.ts +0 -186
- package/src/controller/SharedContentController.ts +0 -365
- package/src/controller/TranslationController.ts +0 -136
- package/src/controller/VoiceController.ts +0 -33
- package/src/fromRimori/EventBus.ts +0 -382
- package/src/fromRimori/PluginTypes.ts +0 -214
- package/src/fromRimori/readme.md +0 -2
- package/src/index.ts +0 -19
- package/src/plugin/CommunicationHandler.ts +0 -291
- package/src/plugin/Logger.ts +0 -394
- package/src/plugin/RimoriClient.ts +0 -199
- package/src/plugin/StandaloneClient.ts +0 -127
- package/src/plugin/module/AIModule.ts +0 -77
- package/src/plugin/module/DbModule.ts +0 -67
- package/src/plugin/module/EventModule.ts +0 -192
- package/src/plugin/module/ExerciseModule.ts +0 -131
- package/src/plugin/module/PluginModule.ts +0 -114
- package/src/utils/difficultyConverter.ts +0 -15
- package/src/utils/endpoint.ts +0 -3
- package/src/worker/WorkerSetup.ts +0 -35
- package/tsconfig.json +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimori/client",
|
|
3
|
-
"version": "2.4.0-next.
|
|
3
|
+
"version": "2.4.0-next.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"rimori-init": "./dist/cli/scripts/init/main.js"
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
16
20
|
"exports": {
|
|
17
21
|
".": {
|
|
18
22
|
"types": "./dist/index.d.ts",
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
name: Create Release Branch
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
inputs:
|
|
6
|
-
base_branch:
|
|
7
|
-
description: 'Base branch to create release from'
|
|
8
|
-
required: true
|
|
9
|
-
default: 'main'
|
|
10
|
-
type: string
|
|
11
|
-
|
|
12
|
-
env:
|
|
13
|
-
SLACK_CHANNEL_ID: C09FDPQ8XPB
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
create-release-branch:
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
permissions:
|
|
19
|
-
contents: write
|
|
20
|
-
pull-requests: write
|
|
21
|
-
|
|
22
|
-
steps:
|
|
23
|
-
- name: Checkout repository
|
|
24
|
-
uses: actions/checkout@v4
|
|
25
|
-
with:
|
|
26
|
-
fetch-depth: 0
|
|
27
|
-
token: ${{ secrets.PAT_TOKEN }}
|
|
28
|
-
|
|
29
|
-
- name: Setup Node.js
|
|
30
|
-
uses: actions/setup-node@v4
|
|
31
|
-
with:
|
|
32
|
-
node-version: '20'
|
|
33
|
-
cache: 'yarn'
|
|
34
|
-
|
|
35
|
-
- name: Checkout base branch
|
|
36
|
-
run: |
|
|
37
|
-
BASE_BRANCH="${{ inputs.base_branch }}"
|
|
38
|
-
git checkout $BASE_BRANCH
|
|
39
|
-
git pull origin $BASE_BRANCH
|
|
40
|
-
|
|
41
|
-
- name: Get current version
|
|
42
|
-
id: get_version
|
|
43
|
-
run: |
|
|
44
|
-
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
45
|
-
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
46
|
-
echo "Current version: $CURRENT_VERSION"
|
|
47
|
-
|
|
48
|
-
- name: Bump minor version
|
|
49
|
-
id: bump_version
|
|
50
|
-
run: |
|
|
51
|
-
CURRENT_VERSION="${{ steps.get_version.outputs.current_version }}"
|
|
52
|
-
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
|
|
53
|
-
MAJOR=${VERSION_PARTS[0]}
|
|
54
|
-
MINOR=${VERSION_PARTS[1]}
|
|
55
|
-
PATCH=${VERSION_PARTS[2]}
|
|
56
|
-
|
|
57
|
-
NEW_MINOR=$((MINOR + 1))
|
|
58
|
-
NEW_VERSION="$MAJOR.$NEW_MINOR.0"
|
|
59
|
-
|
|
60
|
-
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
61
|
-
echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION"
|
|
62
|
-
|
|
63
|
-
- name: Get git commit messages
|
|
64
|
-
id: get_commits
|
|
65
|
-
run: |
|
|
66
|
-
BASE_BRANCH="${{ inputs.base_branch }}"
|
|
67
|
-
# Get commits since last tag, or last 20 commits if no tag exists
|
|
68
|
-
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
69
|
-
if [ -z "$LAST_TAG" ]; then
|
|
70
|
-
COMMITS=$(git log $BASE_BRANCH --pretty=format:"- %s (%h)" --no-merges | head -20)
|
|
71
|
-
else
|
|
72
|
-
COMMITS=$(git log $LAST_TAG..$BASE_BRANCH --pretty=format:"- %s (%h)" --no-merges)
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
if [ -z "$COMMITS" ]; then
|
|
76
|
-
COMMITS="- No commits found"
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
echo "commits<<EOF" >> $GITHUB_OUTPUT
|
|
80
|
-
echo "$COMMITS" >> $GITHUB_OUTPUT
|
|
81
|
-
echo "EOF" >> $GITHUB_OUTPUT
|
|
82
|
-
|
|
83
|
-
- name: Create release branch
|
|
84
|
-
run: |
|
|
85
|
-
NEW_VERSION="${{ steps.bump_version.outputs.new_version }}"
|
|
86
|
-
BRANCH_NAME="release/v$NEW_VERSION"
|
|
87
|
-
git checkout -b $BRANCH_NAME
|
|
88
|
-
echo "Created branch: $BRANCH_NAME"
|
|
89
|
-
|
|
90
|
-
- name: Update package.json version
|
|
91
|
-
run: |
|
|
92
|
-
NEW_VERSION="${{ steps.bump_version.outputs.new_version }}"
|
|
93
|
-
# Use node to update package.json to preserve formatting
|
|
94
|
-
node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.version = '$NEW_VERSION'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');"
|
|
95
|
-
|
|
96
|
-
- name: Commit version bump
|
|
97
|
-
run: |
|
|
98
|
-
NEW_VERSION="${{ steps.bump_version.outputs.new_version }}"
|
|
99
|
-
git config user.name "github-actions[bot]"
|
|
100
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
101
|
-
git add package.json
|
|
102
|
-
git commit -m "chore: bump version to $NEW_VERSION"
|
|
103
|
-
|
|
104
|
-
- name: Push release branch
|
|
105
|
-
run: |
|
|
106
|
-
BRANCH_NAME="release/v${{ steps.bump_version.outputs.new_version }}"
|
|
107
|
-
git push origin $BRANCH_NAME
|
|
108
|
-
|
|
109
|
-
- name: Create Pull Request
|
|
110
|
-
id: create_pr
|
|
111
|
-
env:
|
|
112
|
-
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
113
|
-
run: |
|
|
114
|
-
NEW_VERSION="${{ steps.bump_version.outputs.new_version }}"
|
|
115
|
-
BRANCH_NAME="release/v$NEW_VERSION"
|
|
116
|
-
BASE_BRANCH="${{ inputs.base_branch }}"
|
|
117
|
-
COMMITS="${{ steps.get_commits.outputs.commits }}"
|
|
118
|
-
|
|
119
|
-
PR_BODY="## Release v${NEW_VERSION}
|
|
120
|
-
|
|
121
|
-
This PR bumps the version to **v${NEW_VERSION}**.
|
|
122
|
-
|
|
123
|
-
### Recent Changes
|
|
124
|
-
|
|
125
|
-
${COMMITS}
|
|
126
|
-
|
|
127
|
-
### Next Steps
|
|
128
|
-
- Review and merge this PR
|
|
129
|
-
- The release workflow will automatically create a prerelease when merged to main"
|
|
130
|
-
|
|
131
|
-
PR_URL=$(gh pr create \
|
|
132
|
-
--base "$BASE_BRANCH" \
|
|
133
|
-
--head "$BRANCH_NAME" \
|
|
134
|
-
--title "Release v$NEW_VERSION" \
|
|
135
|
-
--body "$PR_BODY")
|
|
136
|
-
|
|
137
|
-
PR_NUMBER=$(echo "$PR_URL" | grep -o '[0-9]*$')
|
|
138
|
-
echo "pull-request-number=$PR_NUMBER" >> $GITHUB_OUTPUT
|
|
139
|
-
echo "pull-request-url=$PR_URL" >> $GITHUB_OUTPUT
|
|
140
|
-
echo "Created PR: $PR_URL"
|
|
141
|
-
|
|
142
|
-
- name: Send Slack notification - Success
|
|
143
|
-
if: success()
|
|
144
|
-
uses: slackapi/slack-github-action@v1.24.0
|
|
145
|
-
with:
|
|
146
|
-
channel-id: ${{ env.SLACK_CHANNEL_ID }}
|
|
147
|
-
payload: |
|
|
148
|
-
{
|
|
149
|
-
"text": "✅ Rimori-Client Release Branch Created",
|
|
150
|
-
"blocks": [
|
|
151
|
-
{
|
|
152
|
-
"type": "header",
|
|
153
|
-
"text": {
|
|
154
|
-
"type": "plain_text",
|
|
155
|
-
"text": "✅ rimori-client Release Branch Created"
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"type": "section",
|
|
160
|
-
"fields": [
|
|
161
|
-
{
|
|
162
|
-
"type": "mrkdwn",
|
|
163
|
-
"text": "*Version:*\nv${{ steps.bump_version.outputs.new_version }}"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"type": "mrkdwn",
|
|
167
|
-
"text": "*Branch:*\n`release/v${{ steps.bump_version.outputs.new_version }}`"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"type": "mrkdwn",
|
|
171
|
-
"text": "*PR:*\n#${{ steps.create_pr.outputs.pull-request-number }}"
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"type": "section",
|
|
177
|
-
"text": {
|
|
178
|
-
"type": "mrkdwn",
|
|
179
|
-
"text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>"
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
]
|
|
183
|
-
}
|
|
184
|
-
env:
|
|
185
|
-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
186
|
-
|
|
187
|
-
- name: Send Slack notification - Failure
|
|
188
|
-
if: failure()
|
|
189
|
-
uses: slackapi/slack-github-action@v1.24.0
|
|
190
|
-
with:
|
|
191
|
-
channel-id: ${{ env.SLACK_CHANNEL_ID }}
|
|
192
|
-
payload: |
|
|
193
|
-
{
|
|
194
|
-
"text": "❌ rimori-client Release Branch Creation Failed",
|
|
195
|
-
"blocks": [
|
|
196
|
-
{
|
|
197
|
-
"type": "header",
|
|
198
|
-
"text": {
|
|
199
|
-
"type": "plain_text",
|
|
200
|
-
"text": "❌ rimori-client Release Branch Creation Failed"
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"type": "section",
|
|
205
|
-
"fields": [
|
|
206
|
-
{
|
|
207
|
-
"type": "mrkdwn",
|
|
208
|
-
"text": "*Version:*\nv${{ steps.bump_version.outputs.new_version }}"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"type": "mrkdwn",
|
|
212
|
-
"text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>"
|
|
213
|
-
}
|
|
214
|
-
]
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"type": "section",
|
|
218
|
-
"text": {
|
|
219
|
-
"type": "mrkdwn",
|
|
220
|
-
"text": "⚠️ *Action Required:* Review the pipeline failures and fix the issues before retrying."
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
]
|
|
224
|
-
}
|
|
225
|
-
env:
|
|
226
|
-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
name: Pre-Release Rimori Client
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [dev]
|
|
6
|
-
paths:
|
|
7
|
-
- '**'
|
|
8
|
-
- '!.github/workflows/**'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
pre-release:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write
|
|
15
|
-
id-token: write
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout repository
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
with:
|
|
21
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
-
fetch-depth: 0
|
|
23
|
-
|
|
24
|
-
- name: Setup Node.js
|
|
25
|
-
uses: actions/setup-node@v4
|
|
26
|
-
with:
|
|
27
|
-
node-version: '20'
|
|
28
|
-
registry-url: 'https://registry.npmjs.org'
|
|
29
|
-
cache: 'yarn'
|
|
30
|
-
cache-dependency-path: yarn.lock
|
|
31
|
-
|
|
32
|
-
- name: Update npm
|
|
33
|
-
run: npm install -g npm@latest
|
|
34
|
-
|
|
35
|
-
- name: Install dependencies
|
|
36
|
-
run: yarn install --frozen-lockfile
|
|
37
|
-
|
|
38
|
-
- name: Build rimori-client (TypeScript verification)
|
|
39
|
-
run: yarn build
|
|
40
|
-
|
|
41
|
-
- name: Calculate next pre-release version
|
|
42
|
-
id: version
|
|
43
|
-
run: |
|
|
44
|
-
# Read current version from package.json (may be base or pre-release)
|
|
45
|
-
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
46
|
-
|
|
47
|
-
# Extract base version (strip any pre-release suffix)
|
|
48
|
-
# Examples: "2.2.0" -> "2.2.0", "2.2.0-next.5" -> "2.2.0"
|
|
49
|
-
if [[ "$CURRENT_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
|
50
|
-
BASE_VERSION="${BASH_REMATCH[1]}"
|
|
51
|
-
else
|
|
52
|
-
BASE_VERSION="$CURRENT_VERSION"
|
|
53
|
-
fi
|
|
54
|
-
|
|
55
|
-
# Try to get latest next version from npm
|
|
56
|
-
LATEST_NEXT=$(npm view @rimori/client@next version 2>/dev/null || echo "none")
|
|
57
|
-
|
|
58
|
-
if [ "$LATEST_NEXT" != "none" ]; then
|
|
59
|
-
# Extract base version and pre-release number from latest next version
|
|
60
|
-
# Example: "2.2.0-next.5" -> extract "2.2.0" and "5"
|
|
61
|
-
if [[ "$LATEST_NEXT" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-next\.([0-9]+)$ ]]; then
|
|
62
|
-
LATEST_BASE="${BASH_REMATCH[1]}"
|
|
63
|
-
PRERELEASE_NUM="${BASH_REMATCH[2]}"
|
|
64
|
-
|
|
65
|
-
# If base version changed, reset to 1, otherwise increment
|
|
66
|
-
if [ "$LATEST_BASE" != "$BASE_VERSION" ]; then
|
|
67
|
-
NEW_NUM=1
|
|
68
|
-
else
|
|
69
|
-
NEW_NUM=$((PRERELEASE_NUM + 1))
|
|
70
|
-
fi
|
|
71
|
-
else
|
|
72
|
-
# Fallback: if format doesn't match, start at 1
|
|
73
|
-
NEW_NUM=1
|
|
74
|
-
fi
|
|
75
|
-
else
|
|
76
|
-
# First pre-release
|
|
77
|
-
NEW_NUM=1
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
NEW_VERSION="${BASE_VERSION}-next.${NEW_NUM}"
|
|
81
|
-
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
82
|
-
echo "Base version: $BASE_VERSION"
|
|
83
|
-
echo "Calculated next version: $NEW_VERSION"
|
|
84
|
-
|
|
85
|
-
- name: Update package.json version
|
|
86
|
-
run: |
|
|
87
|
-
# Use node to update version directly (yarn version creates git tags)
|
|
88
|
-
node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json')); pkg.version = '${{ steps.version.outputs.new_version }}'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');"
|
|
89
|
-
|
|
90
|
-
- name: Publish to npm
|
|
91
|
-
run: npm publish --tag next --access public
|
|
92
|
-
# Uses OIDC token automatically (no NODE_AUTH_TOKEN needed)
|
|
93
|
-
# Requires npm 11.5.1+ and id-token: write permission (already set)
|
|
94
|
-
|
|
95
|
-
- name: Output published version
|
|
96
|
-
run: |
|
|
97
|
-
echo "✅ Published @rimori/client@${{ steps.version.outputs.new_version }} to npm with @next tag"
|
|
98
|
-
|
|
99
|
-
- name: Create git tag
|
|
100
|
-
run: |
|
|
101
|
-
git config --local user.email "action@github.com"
|
|
102
|
-
git config --local user.name "GitHub Action"
|
|
103
|
-
git tag "v${{ steps.version.outputs.new_version }}" -m "Pre-release v${{ steps.version.outputs.new_version }}"
|
|
104
|
-
git push origin "v${{ steps.version.outputs.new_version }}"
|
|
105
|
-
echo "🏷️ Created and pushed tag v${{ steps.version.outputs.new_version }}"
|
|
106
|
-
|
|
107
|
-
- name: Notify Slack
|
|
108
|
-
if: always()
|
|
109
|
-
uses: slackapi/slack-github-action@v1.24.0
|
|
110
|
-
with:
|
|
111
|
-
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
|
|
112
|
-
payload: |
|
|
113
|
-
{
|
|
114
|
-
"text": "Pre-Release Pipeline Status",
|
|
115
|
-
"blocks": [
|
|
116
|
-
{
|
|
117
|
-
"type": "section",
|
|
118
|
-
"text": {
|
|
119
|
-
"type": "mrkdwn",
|
|
120
|
-
"text": "📦 *@rimori/client Pre-Release*\n\n*Branch:* ${{ github.ref_name }}\n*Version:* ${{ steps.version.outputs.new_version }}\n*Author:* ${{ github.actor }}\n*Pipeline:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>\n\n${{ job.status == 'success' && '✅ Successfully published to npm with @next tag!' || '❌ Pipeline failed. Check the logs for details.' }}"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
env:
|
|
126
|
-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
name: Release on Merge to Main
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
paths:
|
|
8
|
-
- 'package.json'
|
|
9
|
-
|
|
10
|
-
env:
|
|
11
|
-
SLACK_CHANNEL_ID: C09FDPQ8XPB
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
release:
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
permissions:
|
|
17
|
-
contents: write
|
|
18
|
-
id-token: write
|
|
19
|
-
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout repository
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
with:
|
|
24
|
-
fetch-depth: 0
|
|
25
|
-
|
|
26
|
-
- name: Setup Node.js
|
|
27
|
-
uses: actions/setup-node@v4
|
|
28
|
-
with:
|
|
29
|
-
node-version: '20'
|
|
30
|
-
cache: 'yarn'
|
|
31
|
-
registry-url: 'https://registry.npmjs.org'
|
|
32
|
-
provenance: true
|
|
33
|
-
|
|
34
|
-
- name: Get version from package.json
|
|
35
|
-
id: get_version
|
|
36
|
-
run: |
|
|
37
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
38
|
-
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
39
|
-
echo "Releasing version: $VERSION"
|
|
40
|
-
|
|
41
|
-
- name: Verify version bump
|
|
42
|
-
run: |
|
|
43
|
-
VERSION="${{ steps.get_version.outputs.version }}"
|
|
44
|
-
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
45
|
-
echo "Error: Invalid version format: $VERSION"
|
|
46
|
-
exit 1
|
|
47
|
-
fi
|
|
48
|
-
echo "Version format is valid: $VERSION"
|
|
49
|
-
|
|
50
|
-
- name: Get changelog from commits
|
|
51
|
-
id: get_changelog
|
|
52
|
-
run: |
|
|
53
|
-
# Get commits since last tag
|
|
54
|
-
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
55
|
-
if [ -z "$LAST_TAG" ]; then
|
|
56
|
-
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges | head -30)
|
|
57
|
-
else
|
|
58
|
-
COMMITS=$(git log $LAST_TAG..HEAD --pretty=format:"- %s (%h)" --no-merges)
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
if [ -z "$COMMITS" ]; then
|
|
62
|
-
COMMITS="- No commits found since last release"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
|
66
|
-
echo "$COMMITS" >> $GITHUB_OUTPUT
|
|
67
|
-
echo "EOF" >> $GITHUB_OUTPUT
|
|
68
|
-
|
|
69
|
-
- name: Build project
|
|
70
|
-
run: |
|
|
71
|
-
yarn install --frozen-lockfile
|
|
72
|
-
yarn build
|
|
73
|
-
|
|
74
|
-
- name: Create GitHub Release
|
|
75
|
-
uses: softprops/action-gh-release@v1
|
|
76
|
-
with:
|
|
77
|
-
tag_name: v${{ steps.get_version.outputs.version }}
|
|
78
|
-
name: Release v${{ steps.get_version.outputs.version }}
|
|
79
|
-
body: |
|
|
80
|
-
## Release v${{ steps.get_version.outputs.version }}
|
|
81
|
-
|
|
82
|
-
### Changes in this release
|
|
83
|
-
|
|
84
|
-
${{ steps.get_changelog.outputs.changelog }}
|
|
85
|
-
prerelease: false
|
|
86
|
-
generate_release_notes: true
|
|
87
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
88
|
-
|
|
89
|
-
- name: Publish to npm (stable)
|
|
90
|
-
id: npm_publish
|
|
91
|
-
run: |
|
|
92
|
-
npm publish --provenance --access public --tag latest
|
|
93
|
-
|
|
94
|
-
- name: Publish to npm (next)
|
|
95
|
-
id: npm_publish_next
|
|
96
|
-
run: |
|
|
97
|
-
VERSION="${{ steps.get_version.outputs.version }}"
|
|
98
|
-
NEXT_VERSION="${VERSION}-next.0"
|
|
99
|
-
|
|
100
|
-
# Temporarily update package.json version for next publish
|
|
101
|
-
node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.version = '$NEXT_VERSION'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');"
|
|
102
|
-
|
|
103
|
-
# Publish with next tag
|
|
104
|
-
npm publish --provenance --access public --tag next
|
|
105
|
-
|
|
106
|
-
# Restore original version (don't commit)
|
|
107
|
-
git checkout package.json
|
|
108
|
-
|
|
109
|
-
echo "Published version: $NEXT_VERSION with tag 'next'"
|
|
110
|
-
|
|
111
|
-
- name: Send Slack notification - Success
|
|
112
|
-
if: success()
|
|
113
|
-
uses: slackapi/slack-github-action@v1.24.0
|
|
114
|
-
with:
|
|
115
|
-
channel-id: ${{ env.SLACK_CHANNEL_ID }}
|
|
116
|
-
payload: |
|
|
117
|
-
{
|
|
118
|
-
"text": "✅ rimori-client Production Release",
|
|
119
|
-
"blocks": [
|
|
120
|
-
{
|
|
121
|
-
"type": "header",
|
|
122
|
-
"text": {
|
|
123
|
-
"type": "plain_text",
|
|
124
|
-
"text": "✅ rimori-client Production Release Succeeded"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"type": "section",
|
|
129
|
-
"fields": [
|
|
130
|
-
{
|
|
131
|
-
"type": "mrkdwn",
|
|
132
|
-
"text": "*Version:*\nv${{ steps.get_version.outputs.version }}"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"type": "mrkdwn",
|
|
136
|
-
"text": "*Type:*\nStable + Next"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"type": "mrkdwn",
|
|
140
|
-
"text": "*Branch:*\nmain"
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"type": "section",
|
|
146
|
-
"text": {
|
|
147
|
-
"type": "mrkdwn",
|
|
148
|
-
"text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>"
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
env:
|
|
154
|
-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
155
|
-
|
|
156
|
-
- name: Send Slack notification - Failure
|
|
157
|
-
if: failure()
|
|
158
|
-
uses: slackapi/slack-github-action@v1.24.0
|
|
159
|
-
with:
|
|
160
|
-
channel-id: ${{ env.SLACK_CHANNEL_ID }}
|
|
161
|
-
payload: |
|
|
162
|
-
{
|
|
163
|
-
"text": "❌ rimori-client Production Release Failed",
|
|
164
|
-
"blocks": [
|
|
165
|
-
{
|
|
166
|
-
"type": "header",
|
|
167
|
-
"text": {
|
|
168
|
-
"type": "plain_text",
|
|
169
|
-
"text": "❌ rimori-client Production Release Failed"
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"type": "section",
|
|
174
|
-
"fields": [
|
|
175
|
-
{
|
|
176
|
-
"type": "mrkdwn",
|
|
177
|
-
"text": "*Version:*\nv${{ steps.get_version.outputs.version }}"
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"type": "mrkdwn",
|
|
181
|
-
"text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>"
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"type": "section",
|
|
187
|
-
"text": {
|
|
188
|
-
"type": "mrkdwn",
|
|
189
|
-
"text": "⚠️ *Action Required:* Review the pipeline failures and fix the issues before retrying the release."
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
env:
|
|
195
|
-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
package/.prettierignore
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Dependencies
|
|
2
|
-
node_modules/
|
|
3
|
-
yarn.lock
|
|
4
|
-
package-lock.json
|
|
5
|
-
bun.lockb
|
|
6
|
-
|
|
7
|
-
# Build outputs
|
|
8
|
-
dist/
|
|
9
|
-
build/
|
|
10
|
-
*.tsbuildinfo
|
|
11
|
-
|
|
12
|
-
# Generated files
|
|
13
|
-
*.d.ts
|
|
14
|
-
*.js.map
|
|
15
|
-
|
|
16
|
-
# IDE files
|
|
17
|
-
.vscode/
|
|
18
|
-
.idea/
|
|
19
|
-
|
|
20
|
-
# OS files
|
|
21
|
-
.DS_Store
|
|
22
|
-
Thumbs.db
|
|
23
|
-
|
|
24
|
-
# Logs
|
|
25
|
-
*.log
|
|
26
|
-
npm-debug.log*
|
|
27
|
-
yarn-debug.log*
|
|
28
|
-
yarn-error.log*
|
|
29
|
-
|
|
30
|
-
# Coverage
|
|
31
|
-
coverage/
|
|
32
|
-
|
|
33
|
-
# Temporary files
|
|
34
|
-
*.tmp
|
|
35
|
-
*.temp
|
package/eslint.config.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import globals from 'globals';
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
5
|
-
import tseslint from 'typescript-eslint';
|
|
6
|
-
import prettier from 'eslint-plugin-prettier';
|
|
7
|
-
import prettierConfig from 'eslint-config-prettier';
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
{ ignores: ['dist', 'node_modules', 'build', '*.js'] },
|
|
11
|
-
js.configs.recommended,
|
|
12
|
-
...tseslint.configs.recommended,
|
|
13
|
-
prettierConfig,
|
|
14
|
-
{
|
|
15
|
-
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
16
|
-
languageOptions: {
|
|
17
|
-
ecmaVersion: 2020,
|
|
18
|
-
globals: {
|
|
19
|
-
...globals.browser,
|
|
20
|
-
...globals.node,
|
|
21
|
-
...globals.jest,
|
|
22
|
-
},
|
|
23
|
-
sourceType: 'module',
|
|
24
|
-
parserOptions: {
|
|
25
|
-
projectService: true,
|
|
26
|
-
tsconfigRootDir: import.meta.dirname,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
plugins: {
|
|
30
|
-
'react-hooks': reactHooks,
|
|
31
|
-
'react-refresh': reactRefresh,
|
|
32
|
-
prettier: prettier,
|
|
33
|
-
},
|
|
34
|
-
rules: {
|
|
35
|
-
...reactHooks.configs.recommended.rules,
|
|
36
|
-
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
|
37
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
38
|
-
'@typescript-eslint/no-explicit-any': 'warn',
|
|
39
|
-
'@typescript-eslint/no-floating-promises': 'warn',
|
|
40
|
-
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
41
|
-
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
42
|
-
'@typescript-eslint/explicit-module-boundary-types': 'warn',
|
|
43
|
-
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
44
|
-
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
45
|
-
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
46
|
-
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
47
|
-
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
48
|
-
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
49
|
-
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
50
|
-
'prettier/prettier': 'error',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
];
|