@base44-preview/vite-plugin 0.1.0 → 0.1.1-dev.0cdee33
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/compat/agents.cjs +13 -0
- package/compat/entities.cjs +16 -2
- package/dist/ErrorOverlay.d.ts +12 -0
- package/dist/ErrorOverlay.d.ts.map +1 -0
- package/dist/ErrorOverlay.js +51 -0
- package/dist/ErrorOverlay.js.map +1 -0
- package/dist/error-overlay-plugin.d.ts +3 -0
- package/dist/error-overlay-plugin.d.ts.map +1 -0
- package/dist/error-overlay-plugin.js +15 -0
- package/dist/error-overlay-plugin.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/visual-edit-plugin.d.ts +3 -0
- package/dist/visual-edit-plugin.d.ts.map +1 -0
- package/dist/visual-edit-plugin.js +229 -0
- package/dist/visual-edit-plugin.js.map +1 -0
- package/package.json +16 -2
- package/src/ErrorOverlay.ts +71 -0
- package/src/error-overlay-plugin.ts +19 -0
- package/src/index.ts +129 -72
- package/src/visual-edit-plugin.ts +268 -0
- package/.github/workflows/claude-code-review.yml +0 -78
- package/.github/workflows/claude.yml +0 -63
- package/.github/workflows/main-publish.yml +0 -119
- package/.github/workflows/manual-publish.yml +0 -127
- package/.github/workflows/preview-publish.yml +0 -210
- package/.github/workflows/unit-tests.yml +0 -27
- package/tsconfig.json +0 -36
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
name: Package Main Preview Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish-main-preview:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- name: Checkout code
|
|
13
|
-
uses: actions/checkout@v4
|
|
14
|
-
|
|
15
|
-
- name: Enable corepack
|
|
16
|
-
run: corepack enable
|
|
17
|
-
|
|
18
|
-
- name: Setup Node.js
|
|
19
|
-
uses: actions/setup-node@v4
|
|
20
|
-
with:
|
|
21
|
-
node-version: 20
|
|
22
|
-
cache: "npm"
|
|
23
|
-
registry-url: "https://registry.npmjs.org"
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: npm install
|
|
27
|
-
|
|
28
|
-
- name: Build package
|
|
29
|
-
run: npm run build
|
|
30
|
-
|
|
31
|
-
- name: Generate preview package name and version
|
|
32
|
-
id: preview_info
|
|
33
|
-
run: |
|
|
34
|
-
COMMIT_HASH="${{ github.sha }}"
|
|
35
|
-
SHORT_COMMIT="${COMMIT_HASH:0:7}"
|
|
36
|
-
|
|
37
|
-
# Get current version from package.json
|
|
38
|
-
BASE_VERSION=$(node -p "require('./package.json').version")
|
|
39
|
-
|
|
40
|
-
# Format: 0.3.0-dev.abc1234 (valid semver prerelease)
|
|
41
|
-
PREVIEW_VERSION="$BASE_VERSION-dev.$SHORT_COMMIT"
|
|
42
|
-
|
|
43
|
-
echo "version=$PREVIEW_VERSION" >> $GITHUB_OUTPUT
|
|
44
|
-
echo "package_name=@base44-preview/vite-plugin" >> $GITHUB_OUTPUT
|
|
45
|
-
echo "full_package=@base44-preview/vite-plugin@$PREVIEW_VERSION" >> $GITHUB_OUTPUT
|
|
46
|
-
|
|
47
|
-
- name: Update package.json for preview
|
|
48
|
-
run: |
|
|
49
|
-
# Create a backup of original package.json
|
|
50
|
-
cp package.json package.json.bak
|
|
51
|
-
|
|
52
|
-
# Get the official package name for safety checks
|
|
53
|
-
OFFICIAL_PACKAGE=$(node -p "require('./package.json').name")
|
|
54
|
-
PREVIEW_PACKAGE="${{ steps.preview_info.outputs.package_name }}"
|
|
55
|
-
|
|
56
|
-
echo "Official package: $OFFICIAL_PACKAGE"
|
|
57
|
-
echo "Preview package: $PREVIEW_PACKAGE"
|
|
58
|
-
|
|
59
|
-
# Safety check: Ensure we're not accidentally using the official package name
|
|
60
|
-
if [ "$PREVIEW_PACKAGE" = "$OFFICIAL_PACKAGE" ]; then
|
|
61
|
-
echo "❌ ERROR: Preview package name matches official package name!"
|
|
62
|
-
echo "This would overwrite the official package. Aborting."
|
|
63
|
-
exit 1
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
# Update name with error handling
|
|
67
|
-
if ! npm pkg set name="$PREVIEW_PACKAGE"; then
|
|
68
|
-
echo "❌ ERROR: Failed to set package name to $PREVIEW_PACKAGE"
|
|
69
|
-
exit 1
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
# Update version with error handling
|
|
73
|
-
if ! npm pkg set version="${{ steps.preview_info.outputs.version }}"; then
|
|
74
|
-
echo "❌ ERROR: Failed to set package version to ${{ steps.preview_info.outputs.version }}"
|
|
75
|
-
exit 1
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
echo "✅ Package.json updated successfully"
|
|
79
|
-
|
|
80
|
-
- name: Final safety check before publish
|
|
81
|
-
run: |
|
|
82
|
-
# Double-check package name one more time before publishing
|
|
83
|
-
CURRENT_PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
84
|
-
OFFICIAL_PACKAGE=$(jq -r '.name' package.json.bak)
|
|
85
|
-
|
|
86
|
-
echo "About to publish: $CURRENT_PACKAGE_NAME"
|
|
87
|
-
|
|
88
|
-
if [ "$CURRENT_PACKAGE_NAME" = "$OFFICIAL_PACKAGE" ]; then
|
|
89
|
-
echo "❌ CRITICAL ERROR: About to publish to official package name!"
|
|
90
|
-
echo "This is not allowed. Check the workflow configuration."
|
|
91
|
-
exit 1
|
|
92
|
-
fi
|
|
93
|
-
|
|
94
|
-
echo "✅ Safety check passed. Package name is safe to publish."
|
|
95
|
-
|
|
96
|
-
- name: Publish preview package
|
|
97
|
-
run: |
|
|
98
|
-
if npm publish --tag preview; then
|
|
99
|
-
echo "✅ Package published successfully"
|
|
100
|
-
else
|
|
101
|
-
echo "❌ Package publish failed"
|
|
102
|
-
exit 1
|
|
103
|
-
fi
|
|
104
|
-
env:
|
|
105
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
106
|
-
|
|
107
|
-
- name: Restore original package.json
|
|
108
|
-
if: always()
|
|
109
|
-
run: |
|
|
110
|
-
if [ -f package.json.bak ]; then
|
|
111
|
-
mv package.json.bak package.json
|
|
112
|
-
echo "✅ Original package.json restored"
|
|
113
|
-
else
|
|
114
|
-
echo "❌ WARNING: Backup file package.json.bak not found"
|
|
115
|
-
echo "This could indicate an earlier step failed"
|
|
116
|
-
fi
|
|
117
|
-
|
|
118
|
-
permissions:
|
|
119
|
-
contents: read
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
name: Manual Package Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
inputs:
|
|
6
|
-
version:
|
|
7
|
-
description: "Version to publish (e.g., 1.0.0, patch, minor, major)"
|
|
8
|
-
required: true
|
|
9
|
-
default: "patch"
|
|
10
|
-
type: string
|
|
11
|
-
npm_tag:
|
|
12
|
-
description: "NPM tag to publish with (e.g., latest, beta, alpha)"
|
|
13
|
-
required: true
|
|
14
|
-
default: "latest"
|
|
15
|
-
type: string
|
|
16
|
-
dry_run:
|
|
17
|
-
description: "Run in dry-run mode (no actual publish)"
|
|
18
|
-
required: false
|
|
19
|
-
default: false
|
|
20
|
-
type: boolean
|
|
21
|
-
|
|
22
|
-
jobs:
|
|
23
|
-
publish:
|
|
24
|
-
runs-on: ubuntu-latest
|
|
25
|
-
|
|
26
|
-
steps:
|
|
27
|
-
- name: Checkout code
|
|
28
|
-
uses: actions/checkout@v4
|
|
29
|
-
with:
|
|
30
|
-
fetch-depth: 0
|
|
31
|
-
|
|
32
|
-
- name: Enable corepack
|
|
33
|
-
run: corepack enable
|
|
34
|
-
|
|
35
|
-
- name: Setup Node.js
|
|
36
|
-
uses: actions/setup-node@v4
|
|
37
|
-
with:
|
|
38
|
-
node-version: 20
|
|
39
|
-
cache: "npm"
|
|
40
|
-
registry-url: "https://registry.npmjs.org"
|
|
41
|
-
|
|
42
|
-
- name: Install dependencies
|
|
43
|
-
run: npm ci
|
|
44
|
-
|
|
45
|
-
- name: Build package
|
|
46
|
-
run: npm run build
|
|
47
|
-
|
|
48
|
-
- name: Check if version needs to be bumped
|
|
49
|
-
id: check-version
|
|
50
|
-
run: |
|
|
51
|
-
if [[ "${{ github.event.inputs.version }}" =~ ^(patch|minor|major)$ ]]; then
|
|
52
|
-
echo "bump_version=true" >> $GITHUB_OUTPUT
|
|
53
|
-
echo "version_type=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
|
54
|
-
else
|
|
55
|
-
echo "bump_version=false" >> $GITHUB_OUTPUT
|
|
56
|
-
echo "version_type=" >> $GITHUB_OUTPUT
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
- name: Bump version
|
|
60
|
-
if: steps.check-version.outputs.bump_version == 'true'
|
|
61
|
-
run: |
|
|
62
|
-
npm version ${{ steps.check-version.outputs.version_type }} --no-git-tag-version
|
|
63
|
-
echo "NEW_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
|
|
64
|
-
|
|
65
|
-
- name: Set version manually
|
|
66
|
-
if: steps.check-version.outputs.bump_version == 'false'
|
|
67
|
-
run: |
|
|
68
|
-
npm version ${{ github.event.inputs.version }} --no-git-tag-version
|
|
69
|
-
echo "NEW_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
|
|
70
|
-
|
|
71
|
-
- name: Show package info
|
|
72
|
-
run: |
|
|
73
|
-
echo "Package name: $(node -p "require('./package.json').name")"
|
|
74
|
-
echo "Version: ${{ env.NEW_VERSION }}"
|
|
75
|
-
echo "NPM tag: ${{ github.event.inputs.npm_tag }}"
|
|
76
|
-
echo "Dry run: ${{ github.event.inputs.dry_run }}"
|
|
77
|
-
|
|
78
|
-
- name: Publish to NPM
|
|
79
|
-
if: github.event.inputs.dry_run == 'false'
|
|
80
|
-
run: |
|
|
81
|
-
npm publish --tag ${{ github.event.inputs.npm_tag }}
|
|
82
|
-
env:
|
|
83
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
84
|
-
|
|
85
|
-
- name: Dry run publish
|
|
86
|
-
if: github.event.inputs.dry_run == 'true'
|
|
87
|
-
run: |
|
|
88
|
-
npm publish --dry-run --tag ${{ github.event.inputs.npm_tag }}
|
|
89
|
-
|
|
90
|
-
- name: Create Git tag
|
|
91
|
-
if: github.event.inputs.dry_run == 'false'
|
|
92
|
-
run: |
|
|
93
|
-
git config --local user.email "action@github.com"
|
|
94
|
-
git config --local user.name "GitHub Action"
|
|
95
|
-
git add package.json package-lock.json
|
|
96
|
-
git commit -m "chore: bump version to ${{ env.NEW_VERSION }}"
|
|
97
|
-
git tag v${{ env.NEW_VERSION }}
|
|
98
|
-
git push origin HEAD:${{ github.ref }}
|
|
99
|
-
git push origin v${{ env.NEW_VERSION }}
|
|
100
|
-
|
|
101
|
-
- name: Create Release
|
|
102
|
-
if: github.event.inputs.dry_run == 'false'
|
|
103
|
-
uses: actions/create-release@v1
|
|
104
|
-
env:
|
|
105
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
106
|
-
with:
|
|
107
|
-
tag_name: v${{ env.NEW_VERSION }}
|
|
108
|
-
release_name: Release v${{ env.NEW_VERSION }}
|
|
109
|
-
body: |
|
|
110
|
-
## What's Changed
|
|
111
|
-
|
|
112
|
-
This release includes the latest updates to the Base44 Vite Plugin.
|
|
113
|
-
|
|
114
|
-
### Installation
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
npm install @base44/vite-plugin@${{ github.event.inputs.npm_tag }}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Version: ${{ env.NEW_VERSION }}
|
|
121
|
-
### NPM Tag: ${{ github.event.inputs.npm_tag }}
|
|
122
|
-
draft: false
|
|
123
|
-
prerelease: false
|
|
124
|
-
|
|
125
|
-
permissions:
|
|
126
|
-
contents: write
|
|
127
|
-
packages: write
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
name: Package Preview Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [opened, synchronize, reopened]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish-preview:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- name: Checkout code
|
|
13
|
-
uses: actions/checkout@v4
|
|
14
|
-
|
|
15
|
-
- name: Enable corepack
|
|
16
|
-
run: corepack enable
|
|
17
|
-
|
|
18
|
-
- name: Setup Node.js
|
|
19
|
-
uses: actions/setup-node@v4
|
|
20
|
-
with:
|
|
21
|
-
node-version: 20
|
|
22
|
-
cache: "npm"
|
|
23
|
-
registry-url: "https://registry.npmjs.org"
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: npm install
|
|
27
|
-
|
|
28
|
-
- name: Build package
|
|
29
|
-
run: npm run build
|
|
30
|
-
|
|
31
|
-
- name: Generate preview package name and version
|
|
32
|
-
id: preview_info
|
|
33
|
-
run: |
|
|
34
|
-
PR_NUMBER="${{ github.event.number }}"
|
|
35
|
-
COMMIT_HASH="${{ github.sha }}"
|
|
36
|
-
SHORT_COMMIT="${COMMIT_HASH:0:7}"
|
|
37
|
-
|
|
38
|
-
# Get current version from package.json
|
|
39
|
-
BASE_VERSION=$(node -p "require('./package.json').version")
|
|
40
|
-
|
|
41
|
-
if [ ! -z "$PR_NUMBER" ]; then
|
|
42
|
-
# Format: 0.3.0-pr.123.abc1234 (valid semver prerelease)
|
|
43
|
-
PREVIEW_VERSION="$BASE_VERSION-pr.$PR_NUMBER.$SHORT_COMMIT"
|
|
44
|
-
else
|
|
45
|
-
# Format: 0.3.0-dev.abc1234 (valid semver prerelease)
|
|
46
|
-
PREVIEW_VERSION="$BASE_VERSION-dev.$SHORT_COMMIT"
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
echo "version=$PREVIEW_VERSION" >> $GITHUB_OUTPUT
|
|
50
|
-
echo "package_name=@base44-preview/vite-plugin" >> $GITHUB_OUTPUT
|
|
51
|
-
echo "full_package=@base44-preview/vite-plugin@$PREVIEW_VERSION" >> $GITHUB_OUTPUT
|
|
52
|
-
|
|
53
|
-
- name: Update package.json for preview
|
|
54
|
-
run: |
|
|
55
|
-
# Create a backup of original package.json
|
|
56
|
-
cp package.json package.json.bak
|
|
57
|
-
|
|
58
|
-
# Get the official package name for safety checks
|
|
59
|
-
OFFICIAL_PACKAGE=$(node -p "require('./package.json').name")
|
|
60
|
-
PREVIEW_PACKAGE="${{ steps.preview_info.outputs.package_name }}"
|
|
61
|
-
|
|
62
|
-
echo "Official package: $OFFICIAL_PACKAGE"
|
|
63
|
-
echo "Preview package: $PREVIEW_PACKAGE"
|
|
64
|
-
|
|
65
|
-
# Safety check: Ensure we're not accidentally using the official package name
|
|
66
|
-
if [ "$PREVIEW_PACKAGE" = "$OFFICIAL_PACKAGE" ]; then
|
|
67
|
-
echo "❌ ERROR: Preview package name matches official package name!"
|
|
68
|
-
echo "This would overwrite the official package. Aborting."
|
|
69
|
-
exit 1
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
# Update name with error handling
|
|
73
|
-
if ! npm pkg set name="$PREVIEW_PACKAGE"; then
|
|
74
|
-
echo "❌ ERROR: Failed to set package name to $PREVIEW_PACKAGE"
|
|
75
|
-
exit 1
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
# Update version with error handling
|
|
79
|
-
if ! npm pkg set version="${{ steps.preview_info.outputs.version }}"; then
|
|
80
|
-
echo "❌ ERROR: Failed to set package version to ${{ steps.preview_info.outputs.version }}"
|
|
81
|
-
exit 1
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
echo "✅ Package.json updated successfully"
|
|
85
|
-
|
|
86
|
-
- name: Final safety check before publish
|
|
87
|
-
run: |
|
|
88
|
-
# Double-check package name one more time before publishing
|
|
89
|
-
CURRENT_PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
90
|
-
OFFICIAL_PACKAGE=$(jq -r '.name' package.json.bak)
|
|
91
|
-
|
|
92
|
-
echo "About to publish: $CURRENT_PACKAGE_NAME"
|
|
93
|
-
|
|
94
|
-
if [ "$CURRENT_PACKAGE_NAME" = "$OFFICIAL_PACKAGE" ]; then
|
|
95
|
-
echo "❌ CRITICAL ERROR: About to publish to official package name!"
|
|
96
|
-
echo "This is not allowed. Check the workflow configuration."
|
|
97
|
-
exit 1
|
|
98
|
-
fi
|
|
99
|
-
|
|
100
|
-
echo "✅ Safety check passed. Package name is safe to publish."
|
|
101
|
-
|
|
102
|
-
- name: Publish preview package
|
|
103
|
-
run: |
|
|
104
|
-
if npm publish --tag preview; then
|
|
105
|
-
echo "✅ Package published successfully"
|
|
106
|
-
else
|
|
107
|
-
echo "❌ Package publish failed"
|
|
108
|
-
exit 1
|
|
109
|
-
fi
|
|
110
|
-
env:
|
|
111
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
112
|
-
|
|
113
|
-
- name: Restore original package.json
|
|
114
|
-
if: always()
|
|
115
|
-
run: |
|
|
116
|
-
if [ -f package.json.bak ]; then
|
|
117
|
-
mv package.json.bak package.json
|
|
118
|
-
echo "✅ Original package.json restored"
|
|
119
|
-
else
|
|
120
|
-
echo "❌ WARNING: Backup file package.json.bak not found"
|
|
121
|
-
echo "This could indicate an earlier step failed"
|
|
122
|
-
fi
|
|
123
|
-
|
|
124
|
-
- name: Comment PR with install instructions
|
|
125
|
-
uses: actions/github-script@v6
|
|
126
|
-
with:
|
|
127
|
-
script: |
|
|
128
|
-
const fullPackage = '${{ steps.preview_info.outputs.full_package }}';
|
|
129
|
-
const installCmd = `npm i ${fullPackage}`;
|
|
130
|
-
const aliasInstallCmd = `npm i "@base44/vite-plugin@npm:${fullPackage}"`;
|
|
131
|
-
|
|
132
|
-
const body = `### 🚀 Package Preview Available!
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
**Install this PR's preview build with npm:**
|
|
137
|
-
|
|
138
|
-
\`\`\`sh
|
|
139
|
-
${installCmd}
|
|
140
|
-
\`\`\`
|
|
141
|
-
|
|
142
|
-
**Prefer not to change any import paths? Install using npm alias so your code still imports \`@base44/vite-plugin\`:**
|
|
143
|
-
|
|
144
|
-
\`\`\`sh
|
|
145
|
-
${aliasInstallCmd}
|
|
146
|
-
\`\`\`
|
|
147
|
-
|
|
148
|
-
Or add it to your \`package.json\` dependencies:
|
|
149
|
-
|
|
150
|
-
\`\`\`json
|
|
151
|
-
{
|
|
152
|
-
"dependencies": {
|
|
153
|
-
"@base44/vite-plugin": "npm:${fullPackage}"
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
\`\`\`
|
|
157
|
-
|
|
158
|
-
- 📦 **Preview Package**: \`${fullPackage}\`
|
|
159
|
-
- 🔗 [View this commit on GitHub](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
<sub>Preview published to npm registry — try new features instantly!</sub>`;
|
|
163
|
-
|
|
164
|
-
const botCommentIdentifier = '### 🚀 Package Preview Available!';
|
|
165
|
-
|
|
166
|
-
async function findBotComment(issueNumber) {
|
|
167
|
-
if (!issueNumber) return null;
|
|
168
|
-
const comments = await github.rest.issues.listComments({
|
|
169
|
-
owner: context.repo.owner,
|
|
170
|
-
repo: context.repo.repo,
|
|
171
|
-
issue_number: issueNumber,
|
|
172
|
-
});
|
|
173
|
-
return comments.data.find((comment) =>
|
|
174
|
-
comment.body.includes(botCommentIdentifier)
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
async function createOrUpdateComment(issueNumber) {
|
|
179
|
-
if (!issueNumber) {
|
|
180
|
-
console.log('No issue number provided. Cannot post or update comment.');
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
const existingComment = await findBotComment(issueNumber);
|
|
185
|
-
if (existingComment) {
|
|
186
|
-
await github.rest.issues.updateComment({
|
|
187
|
-
owner: context.repo.owner,
|
|
188
|
-
repo: context.repo.repo,
|
|
189
|
-
comment_id: existingComment.id,
|
|
190
|
-
body: body,
|
|
191
|
-
});
|
|
192
|
-
} else {
|
|
193
|
-
await github.rest.issues.createComment({
|
|
194
|
-
issue_number: issueNumber,
|
|
195
|
-
owner: context.repo.owner,
|
|
196
|
-
repo: context.repo.repo,
|
|
197
|
-
body: body,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (context.eventName === 'pull_request') {
|
|
203
|
-
if (context.issue.number) {
|
|
204
|
-
await createOrUpdateComment(context.issue.number);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
permissions:
|
|
209
|
-
contents: read
|
|
210
|
-
pull-requests: write
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Unit Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout code
|
|
15
|
-
uses: actions/checkout@v4
|
|
16
|
-
|
|
17
|
-
- name: Use Node.js 20.x
|
|
18
|
-
uses: actions/setup-node@v4
|
|
19
|
-
with:
|
|
20
|
-
node-version: "20.x"
|
|
21
|
-
cache: "npm"
|
|
22
|
-
|
|
23
|
-
- name: Install dependencies
|
|
24
|
-
run: npm ci
|
|
25
|
-
|
|
26
|
-
- name: Run unit tests
|
|
27
|
-
run: npm run test:unit
|
package/tsconfig.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist",
|
|
4
|
-
|
|
5
|
-
// Environment Settings
|
|
6
|
-
"module": "nodenext",
|
|
7
|
-
"lib": ["esnext"],
|
|
8
|
-
"types": ["node"],
|
|
9
|
-
|
|
10
|
-
// Other Outputs
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"declarationMap": true,
|
|
14
|
-
|
|
15
|
-
// Stricter Typechecking Options
|
|
16
|
-
"noUncheckedIndexedAccess": true,
|
|
17
|
-
"exactOptionalPropertyTypes": true,
|
|
18
|
-
|
|
19
|
-
// Style Options
|
|
20
|
-
// "noImplicitReturns": true,
|
|
21
|
-
// "noImplicitOverride": true,
|
|
22
|
-
// "noUnusedLocals": true,
|
|
23
|
-
// "noUnusedParameters": true,
|
|
24
|
-
// "noFallthroughCasesInSwitch": true,
|
|
25
|
-
// "noPropertyAccessFromIndexSignature": true,
|
|
26
|
-
|
|
27
|
-
// Recommended Options
|
|
28
|
-
"strict": true,
|
|
29
|
-
"jsx": "react-jsx",
|
|
30
|
-
"verbatimModuleSyntax": true,
|
|
31
|
-
"isolatedModules": true,
|
|
32
|
-
"noUncheckedSideEffectImports": true,
|
|
33
|
-
"moduleDetection": "force",
|
|
34
|
-
"skipLibCheck": true,
|
|
35
|
-
}
|
|
36
|
-
}
|