@api-client/ui 0.3.6 â 0.4.1
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/release.yml +14 -0
- package/.github/workflows/auto-release.yml +182 -0
- package/.github/workflows/release.yml +82 -0
- package/.github/workflows/test.yml +42 -0
- package/RELEASE.md +163 -0
- package/RELEASE_SETUP.md +235 -0
- package/build/src/elements/highlight/MarkdownStyles.d.ts.map +1 -1
- package/build/src/elements/highlight/MarkdownStyles.js +2 -6
- package/build/src/elements/highlight/MarkdownStyles.js.map +1 -1
- package/package.json +4 -5
- package/src/elements/highlight/MarkdownStyles.ts +2 -6
- package/.github/workflows/codeql-analysis.yml +0 -67
- package/.github/workflows/deployment.yml +0 -88
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
name: Auto Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
FORCE_COLOR: 1
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: Test
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: 24
|
|
25
|
+
cache: 'npm'
|
|
26
|
+
|
|
27
|
+
- uses: google/wireit@setup-github-actions-caching/v2
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: npm ci
|
|
31
|
+
|
|
32
|
+
- name: Install playwright browsers
|
|
33
|
+
run: npx playwright install --with-deps
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: npm test
|
|
37
|
+
|
|
38
|
+
determine-release:
|
|
39
|
+
name: Determine Release Type
|
|
40
|
+
needs: test
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
outputs:
|
|
43
|
+
should-release: ${{ steps.release-check.outputs.should-release }}
|
|
44
|
+
release-type: ${{ steps.release-check.outputs.release-type }}
|
|
45
|
+
new-version: ${{ steps.release-check.outputs.new-version }}
|
|
46
|
+
steps:
|
|
47
|
+
- name: Checkout code
|
|
48
|
+
uses: actions/checkout@v4
|
|
49
|
+
with:
|
|
50
|
+
fetch-depth: 0
|
|
51
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
52
|
+
|
|
53
|
+
- name: Setup Node.js
|
|
54
|
+
uses: actions/setup-node@v4
|
|
55
|
+
with:
|
|
56
|
+
node-version: 24
|
|
57
|
+
cache: 'npm'
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: npm ci
|
|
61
|
+
|
|
62
|
+
- name: Determine release type
|
|
63
|
+
id: release-check
|
|
64
|
+
run: |
|
|
65
|
+
# Get the last tag
|
|
66
|
+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
|
67
|
+
echo "Last tag: $LAST_TAG"
|
|
68
|
+
|
|
69
|
+
# Get commits since last tag
|
|
70
|
+
COMMITS=$(git log --pretty=format:"%s" ${LAST_TAG}..HEAD)
|
|
71
|
+
echo "Commits since last tag:"
|
|
72
|
+
echo "$COMMITS"
|
|
73
|
+
|
|
74
|
+
# Check if there are any commits to release
|
|
75
|
+
if [ -z "$COMMITS" ]; then
|
|
76
|
+
echo "No new commits since last tag"
|
|
77
|
+
echo "should-release=false" >> $GITHUB_OUTPUT
|
|
78
|
+
exit 0
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# Determine release type based on commit messages
|
|
82
|
+
RELEASE_TYPE="patch"
|
|
83
|
+
|
|
84
|
+
# Check for breaking changes
|
|
85
|
+
if echo "$COMMITS" | grep -q "BREAKING CHANGE" || echo "$COMMITS" | grep -q '!:'; then
|
|
86
|
+
RELEASE_TYPE="major"
|
|
87
|
+
# Check for new features
|
|
88
|
+
elif echo "$COMMITS" | grep -q "^feat"; then
|
|
89
|
+
RELEASE_TYPE="minor"
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
echo "Release type: $RELEASE_TYPE"
|
|
93
|
+
|
|
94
|
+
# Calculate new version
|
|
95
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
96
|
+
echo "Current version: $CURRENT_VERSION"
|
|
97
|
+
|
|
98
|
+
# Use semver to calculate new version
|
|
99
|
+
NEW_VERSION=$(node -e "
|
|
100
|
+
const SemVer = require('@pawel-up/semver/classes/semver.js').default || require('@pawel-up/semver/classes/semver.js');
|
|
101
|
+
const ver = new SemVer('$CURRENT_VERSION');
|
|
102
|
+
ver.inc('$RELEASE_TYPE');
|
|
103
|
+
console.log(ver.format());
|
|
104
|
+
" CURRENT_VERSION="$CURRENT_VERSION" RELEASE_TYPE="$RELEASE_TYPE")
|
|
105
|
+
|
|
106
|
+
echo "New version: $NEW_VERSION"
|
|
107
|
+
|
|
108
|
+
echo "should-release=true" >> $GITHUB_OUTPUT
|
|
109
|
+
echo "release-type=$RELEASE_TYPE" >> $GITHUB_OUTPUT
|
|
110
|
+
echo "new-version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
111
|
+
|
|
112
|
+
release:
|
|
113
|
+
name: Create Release
|
|
114
|
+
needs: [test, determine-release]
|
|
115
|
+
if: needs.determine-release.outputs.should-release == 'true'
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
permissions:
|
|
118
|
+
contents: write
|
|
119
|
+
issues: write
|
|
120
|
+
pull-requests: write
|
|
121
|
+
steps:
|
|
122
|
+
- name: Checkout code
|
|
123
|
+
uses: actions/checkout@v4
|
|
124
|
+
with:
|
|
125
|
+
fetch-depth: 0
|
|
126
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
127
|
+
|
|
128
|
+
- name: Setup Node.js
|
|
129
|
+
uses: actions/setup-node@v4
|
|
130
|
+
with:
|
|
131
|
+
node-version: 24
|
|
132
|
+
cache: 'npm'
|
|
133
|
+
registry-url: 'https://registry.npmjs.org'
|
|
134
|
+
|
|
135
|
+
- name: Install dependencies
|
|
136
|
+
run: npm ci
|
|
137
|
+
|
|
138
|
+
- name: Update version
|
|
139
|
+
run: |
|
|
140
|
+
# Update package.json version
|
|
141
|
+
NEW_VERSION="${{ needs.determine-release.outputs.new-version }}"
|
|
142
|
+
npm version $NEW_VERSION --no-git-tag-version
|
|
143
|
+
git add package.json
|
|
144
|
+
|
|
145
|
+
# Commit version bump
|
|
146
|
+
# git config --local user.email "action@github.com"
|
|
147
|
+
# git config --local user.name "GitHub Action"
|
|
148
|
+
# git add package.json
|
|
149
|
+
# git commit -m "chore: bump version to $NEW_VERSION"
|
|
150
|
+
# git push
|
|
151
|
+
|
|
152
|
+
- uses: qoomon/actions--create-commit@v1
|
|
153
|
+
id: commit
|
|
154
|
+
with:
|
|
155
|
+
message: "chore: bump version to ${{ needs.determine-release.outputs.new-version }}"
|
|
156
|
+
skip-empty: true
|
|
157
|
+
|
|
158
|
+
- run: git push
|
|
159
|
+
|
|
160
|
+
- name: Build
|
|
161
|
+
run: npm run build
|
|
162
|
+
|
|
163
|
+
- name: Generate changelog
|
|
164
|
+
id: changelog
|
|
165
|
+
run: |
|
|
166
|
+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
|
167
|
+
npx conventional-changelog-cli@latest release --preset conventionalcommits --release-count 1 >> $GITHUB_OUTPUT
|
|
168
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
169
|
+
|
|
170
|
+
- name: Create Release
|
|
171
|
+
uses: softprops/action-gh-release@v2
|
|
172
|
+
with:
|
|
173
|
+
tag_name: v${{ needs.determine-release.outputs.new-version }}
|
|
174
|
+
body: ${{ steps.changelog.outputs.changelog }}
|
|
175
|
+
draft: false
|
|
176
|
+
prerelease: false
|
|
177
|
+
generate_release_notes: false
|
|
178
|
+
|
|
179
|
+
- name: Publish to npm
|
|
180
|
+
run: npm publish --access public
|
|
181
|
+
env:
|
|
182
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: Manual Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
FORCE_COLOR: 1
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: Test
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: 24
|
|
25
|
+
cache: 'npm'
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: npm ci
|
|
29
|
+
|
|
30
|
+
- name: Install playwright browsers
|
|
31
|
+
run: npx playwright install --with-deps
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: npm test
|
|
35
|
+
|
|
36
|
+
release:
|
|
37
|
+
name: Create Release
|
|
38
|
+
needs: test
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
permissions:
|
|
41
|
+
contents: write
|
|
42
|
+
issues: write
|
|
43
|
+
pull-requests: write
|
|
44
|
+
steps:
|
|
45
|
+
- name: Checkout code
|
|
46
|
+
uses: actions/checkout@v4
|
|
47
|
+
with:
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
50
|
+
|
|
51
|
+
- name: Setup Node.js
|
|
52
|
+
uses: actions/setup-node@v4
|
|
53
|
+
with:
|
|
54
|
+
node-version: 24
|
|
55
|
+
cache: 'npm'
|
|
56
|
+
registry-url: 'https://registry.npmjs.org'
|
|
57
|
+
|
|
58
|
+
- name: Install dependencies
|
|
59
|
+
run: npm ci
|
|
60
|
+
|
|
61
|
+
- name: Build
|
|
62
|
+
run: npm run build
|
|
63
|
+
|
|
64
|
+
- name: Generate changelog
|
|
65
|
+
id: changelog
|
|
66
|
+
run: |
|
|
67
|
+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
|
68
|
+
npx conventional-changelog-cli@latest release --preset conventionalcommits --release-count 1 >> $GITHUB_OUTPUT
|
|
69
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
70
|
+
|
|
71
|
+
- name: Create Release
|
|
72
|
+
uses: softprops/action-gh-release@v2
|
|
73
|
+
with:
|
|
74
|
+
body: ${{ steps.changelog.outputs.changelog }}
|
|
75
|
+
draft: false
|
|
76
|
+
prerelease: false
|
|
77
|
+
generate_release_notes: false
|
|
78
|
+
|
|
79
|
+
- name: Publish to npm
|
|
80
|
+
run: npm publish --access public
|
|
81
|
+
env:
|
|
82
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
FORCE_COLOR: 1
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
name: Test
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout code
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 24
|
|
28
|
+
cache: 'npm'
|
|
29
|
+
|
|
30
|
+
- uses: google/wireit@setup-github-actions-caching/v2
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: npm ci
|
|
34
|
+
|
|
35
|
+
- name: Install playwright browsers
|
|
36
|
+
run: npx playwright install --with-deps
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: npm test
|
|
40
|
+
|
|
41
|
+
- name: Run linting
|
|
42
|
+
run: npm run lint
|
package/RELEASE.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Release Guide
|
|
2
|
+
|
|
3
|
+
This project uses an **automated release system** with conventional commits and GitHub Actions. Releases are automatically created when changes are merged to the main branch.
|
|
4
|
+
|
|
5
|
+
## đ Automated Releases (Recommended)
|
|
6
|
+
|
|
7
|
+
### How It Works
|
|
8
|
+
|
|
9
|
+
1. **Push to main branch** (usually via PR merge)
|
|
10
|
+
2. **Tests run automatically** to ensure quality
|
|
11
|
+
3. **System analyzes commit messages** since the last release
|
|
12
|
+
4. **Release type is determined automatically:**
|
|
13
|
+
- `major` - if commits contain "breaking:" or "!:"
|
|
14
|
+
- `minor` - if commits contain "feat:" (new features)
|
|
15
|
+
- `patch` - for all other changes (bug fixes, docs, etc.)
|
|
16
|
+
5. **Release is created automatically** with changelog and npm publish
|
|
17
|
+
|
|
18
|
+
### Commit Message Examples
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Major release (breaking changes)
|
|
22
|
+
git commit -m "feat!: remove deprecated API"
|
|
23
|
+
git commit -m "feat: new system
|
|
24
|
+
|
|
25
|
+
BREAKING CHANGE: Old methods no longer work"
|
|
26
|
+
|
|
27
|
+
# Minor release (new features)
|
|
28
|
+
git commit -m "feat: add OAuth2 support"
|
|
29
|
+
git commit -m "feat(auth): implement JWT tokens"
|
|
30
|
+
|
|
31
|
+
# Patch release (bug fixes, docs, etc.)
|
|
32
|
+
git commit -m "fix: resolve memory leak"
|
|
33
|
+
git commit -m "docs: update API documentation"
|
|
34
|
+
git commit -m "chore: update dependencies"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### What Happens Automatically
|
|
38
|
+
|
|
39
|
+
1. â
Tests run to ensure everything works
|
|
40
|
+
2. â
Version is bumped in `package.json`
|
|
41
|
+
3. â
Changes are committed with conventional commit message
|
|
42
|
+
4. â
Git tag is created (e.g., `v1.2.3`)
|
|
43
|
+
5. â
GitHub release is created with automated changelog
|
|
44
|
+
6. â
Package is published to npm
|
|
45
|
+
|
|
46
|
+
## đ§ Manual Releases (Fallback)
|
|
47
|
+
|
|
48
|
+
If you need to create a release manually (e.g., for hotfixes or special releases):
|
|
49
|
+
|
|
50
|
+
### Option 1: Use the release script
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Create a patch release (bug fixes)
|
|
54
|
+
npm run release:patch
|
|
55
|
+
|
|
56
|
+
# Create a minor release (new features)
|
|
57
|
+
npm run release:minor
|
|
58
|
+
|
|
59
|
+
# Create a major release (breaking changes)
|
|
60
|
+
npm run release:major
|
|
61
|
+
|
|
62
|
+
# Or use the default (patch)
|
|
63
|
+
npm run release
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Option 2: Manual tag creation
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm run build
|
|
70
|
+
# Update version in package.json
|
|
71
|
+
npm version patch --no-git-tag-version
|
|
72
|
+
|
|
73
|
+
# Commit the change
|
|
74
|
+
git add package.json
|
|
75
|
+
git commit -m "chore: bump version to X.Y.Z"
|
|
76
|
+
|
|
77
|
+
# Create and push tag
|
|
78
|
+
git tag vX.Y.Z
|
|
79
|
+
git push origin main
|
|
80
|
+
git push origin vX.Y.Z
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## đ Conventional Commits
|
|
84
|
+
|
|
85
|
+
The release system uses conventional commits to generate changelogs. Your commit messages should follow this format:
|
|
86
|
+
|
|
87
|
+
```plain
|
|
88
|
+
type(scope): description
|
|
89
|
+
|
|
90
|
+
[optional body]
|
|
91
|
+
|
|
92
|
+
[optional footer]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Commit Types
|
|
96
|
+
|
|
97
|
+
- `feat`: New features (triggers minor release)
|
|
98
|
+
- `fix`: Bug fixes (triggers patch release)
|
|
99
|
+
- `docs`: Documentation changes
|
|
100
|
+
- `style`: Code style changes (formatting, etc.)
|
|
101
|
+
- `refactor`: Code refactoring
|
|
102
|
+
- `test`: Adding or updating tests
|
|
103
|
+
- `chore`: Maintenance tasks
|
|
104
|
+
|
|
105
|
+
### Breaking Changes
|
|
106
|
+
|
|
107
|
+
To indicate a breaking change, use either:
|
|
108
|
+
|
|
109
|
+
- `!:` in the commit message: `feat!: remove deprecated API`
|
|
110
|
+
- `BREAKING CHANGE:` in the commit body:
|
|
111
|
+
|
|
112
|
+
```plain
|
|
113
|
+
feat: new authentication system
|
|
114
|
+
|
|
115
|
+
BREAKING CHANGE: Old auth methods are no longer supported
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## đ Workflow Comparison
|
|
119
|
+
|
|
120
|
+
| Aspect | Automated Release | Manual Release |
|
|
121
|
+
|--------|------------------|----------------|
|
|
122
|
+
| **Trigger** | Push to main | Tag push or script |
|
|
123
|
+
| **Release Type** | Auto-detected from commits | Manually specified |
|
|
124
|
+
| **Effort** | Zero - fully automated | Manual intervention |
|
|
125
|
+
| **Use Case** | Regular development flow | Hotfixes, special releases |
|
|
126
|
+
|
|
127
|
+
## đ ī¸ Configuration
|
|
128
|
+
|
|
129
|
+
The release system is configured in:
|
|
130
|
+
|
|
131
|
+
- `.github/workflows/auto-release.yml` - Automated release workflow
|
|
132
|
+
- `.github/workflows/release.yml` - Manual release workflow (fallback)
|
|
133
|
+
- `scripts/release.js` - Manual release automation script
|
|
134
|
+
- `commitlint.config.js` - Conventional commits configuration
|
|
135
|
+
- `package.json` - Version management and scripts
|
|
136
|
+
|
|
137
|
+
## đ¨ Troubleshooting
|
|
138
|
+
|
|
139
|
+
### Common Issues
|
|
140
|
+
|
|
141
|
+
1. **No release created**: Check if commits follow conventional format
|
|
142
|
+
2. **Wrong release type**: Ensure commit messages use correct prefixes
|
|
143
|
+
3. **Tests failing**: Release won't proceed if tests fail
|
|
144
|
+
4. **Permission denied**: Ensure GitHub token has write permissions
|
|
145
|
+
|
|
146
|
+
### Debugging
|
|
147
|
+
|
|
148
|
+
The automated workflow logs will show:
|
|
149
|
+
|
|
150
|
+
- Last tag found
|
|
151
|
+
- Commits since last tag
|
|
152
|
+
- Determined release type
|
|
153
|
+
- Calculated new version
|
|
154
|
+
|
|
155
|
+
### Rollback
|
|
156
|
+
|
|
157
|
+
If you need to rollback a release:
|
|
158
|
+
|
|
159
|
+
1. Delete the tag locally: `git tag -d vX.Y.Z`
|
|
160
|
+
2. Delete the tag on GitHub: `git push origin :refs/tags/vX.Y.Z`
|
|
161
|
+
3. Revert the version in `package.json`
|
|
162
|
+
4. Commit the revert: `git commit -m "chore: revert version to X.Y.Z"`
|
|
163
|
+
5. Push the changes: `git push origin main`
|
package/RELEASE_SETUP.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Automated Release System Setup
|
|
2
|
+
|
|
3
|
+
## đ¯ Overview
|
|
4
|
+
|
|
5
|
+
This project now has a **fully automated release system** that:
|
|
6
|
+
|
|
7
|
+
1. **Automatically detects release types** from commit messages
|
|
8
|
+
2. **Creates releases on every merge to main** (when there are changes)
|
|
9
|
+
3. **Generates changelogs** from conventional commits
|
|
10
|
+
4. **Publishes to npm** automatically
|
|
11
|
+
5. **Provides manual fallback** for special cases
|
|
12
|
+
|
|
13
|
+
## đ How It Works
|
|
14
|
+
|
|
15
|
+
### Automated Flow
|
|
16
|
+
|
|
17
|
+
```plain
|
|
18
|
+
Push to main â Tests run â Analyze commits â Determine release type â Create release
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
1. **Trigger**: Any push to the `main` branch (usually PR merges)
|
|
22
|
+
2. **Testing**: Full test suite runs to ensure quality
|
|
23
|
+
3. **Analysis**: System examines commits since last release
|
|
24
|
+
4. **Decision**: Release type determined by commit messages:
|
|
25
|
+
- `major`: Breaking changes (`!:` or `BREAKING CHANGE:`)
|
|
26
|
+
- `minor`: New features (`feat:`)
|
|
27
|
+
- `patch`: Everything else (`fix:`, `docs:`, `chore:`, etc.)
|
|
28
|
+
5. **Release**: If changes exist, creates GitHub release + npm publish
|
|
29
|
+
|
|
30
|
+
### Manual Fallback
|
|
31
|
+
|
|
32
|
+
```plain
|
|
33
|
+
Create tag â Manual release workflow â Create release
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For hotfixes or special releases, you can still use manual methods.
|
|
37
|
+
|
|
38
|
+
## đ Workflow Files
|
|
39
|
+
|
|
40
|
+
### `.github/workflows/auto-release.yml`
|
|
41
|
+
|
|
42
|
+
- **Purpose**: Main automated release workflow
|
|
43
|
+
- **Trigger**: Push to main branch
|
|
44
|
+
- **Jobs**:
|
|
45
|
+
- `test`: Run tests
|
|
46
|
+
- `determine-release`: Analyze commits and decide release type
|
|
47
|
+
- `release`: Create release and publish
|
|
48
|
+
|
|
49
|
+
### `.github/workflows/release.yml`
|
|
50
|
+
|
|
51
|
+
- **Purpose**: Manual release fallback
|
|
52
|
+
- **Trigger**: Push of version tags (`v*`)
|
|
53
|
+
- **Use case**: Manual releases, hotfixes
|
|
54
|
+
|
|
55
|
+
### `.github/workflows/test.yml`
|
|
56
|
+
|
|
57
|
+
- **Purpose**: Quality assurance
|
|
58
|
+
- **Trigger**: PRs and pushes to main
|
|
59
|
+
- **Jobs**: Run tests and linting
|
|
60
|
+
|
|
61
|
+
## đ¯ Release Type Detection
|
|
62
|
+
|
|
63
|
+
The system analyzes commit messages since the last release:
|
|
64
|
+
|
|
65
|
+
### Major Release (X.0.0)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git commit -m "feat!: remove deprecated API"
|
|
69
|
+
git commit -m "feat: new system
|
|
70
|
+
|
|
71
|
+
BREAKING CHANGE: Old methods no longer work"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Minor Release (0.X.0)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
git commit -m "feat: add OAuth2 support"
|
|
78
|
+
git commit -m "feat(auth): implement JWT tokens"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Patch Release (0.0.X)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git commit -m "fix: resolve memory leak"
|
|
85
|
+
git commit -m "docs: update API docs"
|
|
86
|
+
git commit -m "chore: update dependencies"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## đ ī¸ Configuration Details
|
|
90
|
+
|
|
91
|
+
### Commit Analysis Logic
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Check for breaking changes first
|
|
95
|
+
if echo "$COMMITS" | grep -q "BREAKING CHANGE\|!:"; then
|
|
96
|
+
RELEASE_TYPE="major"
|
|
97
|
+
# Then check for new features
|
|
98
|
+
elif echo "$COMMITS" | grep -q "^feat"; then
|
|
99
|
+
RELEASE_TYPE="minor"
|
|
100
|
+
# Default to patch
|
|
101
|
+
else
|
|
102
|
+
RELEASE_TYPE="patch"
|
|
103
|
+
fi
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Version Calculation
|
|
107
|
+
|
|
108
|
+
Uses the `@pawel-up/semver` package for proper semantic versioning:
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
import SemVer from '@pawel-up/semver/classes/semver.js';
|
|
112
|
+
const ver = new SemVer(currentVersion);
|
|
113
|
+
ver.inc(releaseType);
|
|
114
|
+
return ver.format();
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Changelog Generation
|
|
118
|
+
|
|
119
|
+
Uses `conventional-changelog-cli` with the `conventionalcommits` preset:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npx conventional-changelog-cli@latest release --preset conventionalcommits --release-count 1
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## đ§ Setup Requirements
|
|
126
|
+
|
|
127
|
+
### GitHub Secrets
|
|
128
|
+
|
|
129
|
+
- `GITHUB_TOKEN`: Automatically provided
|
|
130
|
+
- `NPM_TOKEN`: Required for npm publishing
|
|
131
|
+
|
|
132
|
+
### Dependencies
|
|
133
|
+
|
|
134
|
+
- `conventional-changelog-cli`: For changelog generation
|
|
135
|
+
- `@pawel-up/semver`: For version calculation
|
|
136
|
+
- `@commitlint/config-conventional`: For commit validation
|
|
137
|
+
|
|
138
|
+
### Permissions
|
|
139
|
+
|
|
140
|
+
The workflows require these permissions:
|
|
141
|
+
|
|
142
|
+
- `contents: write` - Create releases and tags
|
|
143
|
+
- `issues: write` - Update issues
|
|
144
|
+
- `pull-requests: write` - Update PRs
|
|
145
|
+
|
|
146
|
+
## đ Usage Examples
|
|
147
|
+
|
|
148
|
+
### Normal Development Flow
|
|
149
|
+
|
|
150
|
+
1. **Create feature branch**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
git checkout -b feature/new-auth
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
2. **Make changes with proper commits**
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
git commit -m "feat: add OAuth2 authentication"
|
|
160
|
+
git commit -m "docs: update authentication docs"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
3. **Create PR and merge to main**
|
|
164
|
+
- PR triggers test workflow
|
|
165
|
+
- Merge triggers auto-release workflow
|
|
166
|
+
- System creates minor release automatically
|
|
167
|
+
|
|
168
|
+
### Hotfix Flow
|
|
169
|
+
|
|
170
|
+
1. **Create hotfix branch**
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
git checkout -b hotfix/critical-bug
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
2. **Fix and commit**
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
git commit -m "fix: resolve critical memory leak"
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
3. **Merge to main**
|
|
183
|
+
- System creates patch release automatically
|
|
184
|
+
|
|
185
|
+
### Manual Release (if needed)
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# For immediate release
|
|
189
|
+
npm run release:patch
|
|
190
|
+
|
|
191
|
+
# Or create tag manually
|
|
192
|
+
git tag v1.2.3
|
|
193
|
+
git push origin v1.2.3
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## đ Monitoring and Debugging
|
|
197
|
+
|
|
198
|
+
### Workflow Logs
|
|
199
|
+
|
|
200
|
+
Check the GitHub Actions tab to see:
|
|
201
|
+
|
|
202
|
+
- Which commits were analyzed
|
|
203
|
+
- What release type was determined
|
|
204
|
+
- Why a release was or wasn't created
|
|
205
|
+
|
|
206
|
+
### Common Issues
|
|
207
|
+
|
|
208
|
+
1. **No release created**: No new commits since last tag
|
|
209
|
+
2. **Wrong release type**: Check commit message format
|
|
210
|
+
3. **Tests failing**: Release won't proceed
|
|
211
|
+
4. **Permission errors**: Check GitHub token permissions
|
|
212
|
+
|
|
213
|
+
### Debugging Commands
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Check last tag
|
|
217
|
+
git describe --tags --abbrev=0
|
|
218
|
+
|
|
219
|
+
# See commits since last tag
|
|
220
|
+
git log --pretty=format:"%s" $(git describe --tags --abbrev=0)..HEAD
|
|
221
|
+
|
|
222
|
+
# Check conventional commit format
|
|
223
|
+
npx commitlint --edit .git/COMMIT_EDITMSG
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## đ Benefits
|
|
227
|
+
|
|
228
|
+
1. **Zero manual intervention** for regular releases
|
|
229
|
+
2. **Consistent release process** with proper semantic versioning
|
|
230
|
+
3. **Automatic changelog generation** from commit history
|
|
231
|
+
4. **Quality gates** with automated testing
|
|
232
|
+
5. **Flexible fallback** for special cases
|
|
233
|
+
6. **Proper audit trail** with conventional commits
|
|
234
|
+
|
|
235
|
+
This setup provides a modern, automated release system that follows industry best practices and reduces manual work while ensuring quality and consistency.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownStyles.d.ts","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":";AAkDA,
|
|
1
|
+
{"version":3,"file":"MarkdownStyles.d.ts","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":";AAkDA,wBAyXC"}
|
|
@@ -49,7 +49,6 @@ defined here are scoped to a container with this class name.
|
|
|
49
49
|
import { css } from 'lit';
|
|
50
50
|
export default css `
|
|
51
51
|
[slot='markdown-html'] {
|
|
52
|
-
/* -webkit-font-smoothing: var(--api-font-font-smoothing); */
|
|
53
52
|
font-family: var(--md-sys-typescale-body-large-font);
|
|
54
53
|
font-weight: var(--md-sys-typescale-body-large-weight);
|
|
55
54
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
@@ -224,7 +223,6 @@ export default css `
|
|
|
224
223
|
}
|
|
225
224
|
|
|
226
225
|
[slot='markdown-html'] table {
|
|
227
|
-
-webkit-font-smoothing: var(--api-font-font-smoothing);
|
|
228
226
|
font-family: var(--md-sys-typescale-body-large-font);
|
|
229
227
|
font-weight: var(--md-sys-typescale-body-large-weight);
|
|
230
228
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
@@ -273,8 +271,7 @@ export default css `
|
|
|
273
271
|
|
|
274
272
|
[slot='markdown-html'] code,
|
|
275
273
|
[slot='markdown-html'] tt {
|
|
276
|
-
font-family: var(--
|
|
277
|
-
-webkit-font-smoothing: var(--api-font-font-smoothing);
|
|
274
|
+
font-family: var(--markdown-styles-code-font-family, 'Roboto Mono, Consolas, Menlo, monospace');
|
|
278
275
|
padding: 0;
|
|
279
276
|
padding-top: 0.2em;
|
|
280
277
|
padding-bottom: 0.2em;
|
|
@@ -294,8 +291,7 @@ export default css `
|
|
|
294
291
|
*/
|
|
295
292
|
[slot='markdown-html'] code,
|
|
296
293
|
[slot='markdown-html'] pre {
|
|
297
|
-
font-family: var(--
|
|
298
|
-
-webkit-font-smoothing: var(--api-font-font-smoothing);
|
|
294
|
+
font-family: var(--markdown-styles-code-font-family, 'Roboto Mono, Consolas, Menlo, monospace');
|
|
299
295
|
color: var(--code-color, black);
|
|
300
296
|
background-color: var(--code-background-color);
|
|
301
297
|
text-shadow: var(--markdown-styles-code-text-shadow, 0 1px white);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownStyles.js","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6XjB,CAAA","sourcesContent":["/**\n@license\nCopyright 2016 The Advanced REST client authors <arc@mulesoft.com>\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n*/\n/**\n## Styles for markdown viewer\n\nIt should be included where the `marked-highlight` is used.\n\n## Usage example\n\n```javascript\nimport { LitElement, html, css } from 'lit';\nimport { MarkdownStyles } from '@api-client/ui';\n\nclass MarkdownImpl extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n ...\n }\n `,\n MarkdownStyles,\n ]\n }\n\n render() {\n return html`\n <marked-highlight markdown=\"....\">\n <div class=\"markdown-html\"></div>\n </marked-highlight>`;\n }\n}\n```\n\nNote use of the `markdown-html` CSS rules. It is required by markdown element also all css rules\ndefined here are scoped to a container with this class name.\n*/\nimport { css } from 'lit'\n\nexport default css`\n [slot='markdown-html'] {\n /* -webkit-font-smoothing: var(--api-font-font-smoothing); */\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n }\n\n [slot='markdown-html'] h1,\n [slot='markdown-html'] h2,\n [slot='markdown-html'] h3,\n [slot='markdown-html'] h4,\n [slot='markdown-html'] h5,\n [slot='markdown-html'] h6 {\n color: inherit;\n }\n\n [slot='markdown-html'] h1 tt,\n [slot='markdown-html'] h1 code,\n [slot='markdown-html'] h2 tt,\n [slot='markdown-html'] h2 code,\n [slot='markdown-html'] h3 tt,\n [slot='markdown-html'] h3 code,\n [slot='markdown-html'] h4 tt,\n [slot='markdown-html'] h4 code,\n [slot='markdown-html'] h5 tt,\n [slot='markdown-html'] h5 code,\n [slot='markdown-html'] h6 tt,\n [slot='markdown-html'] h6 code {\n font-size: inherit;\n }\n\n [slot='markdown-html'] h1 {\n font-family: var(--md-sys-typescale-headline-large-font);\n font-weight: var(--md-sys-typescale-headline-large-weight);\n font-size: var(--md-sys-typescale-headline-large-size);\n letter-spacing: var(--md-sys-typescale-headline-large-tracking);\n line-height: var(--md-sys-typescale-headline-large-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n padding-top: 1rem;\n padding-bottom: 0.5rem;\n }\n\n [slot='markdown-html'] h2 {\n font-family: var(--md-sys-typescale-headline-medium-font);\n font-weight: var(--md-sys-typescale-headline-medium-weight);\n font-size: var(--md-sys-typescale-headline-medium-size);\n letter-spacing: var(--md-sys-typescale-headline-medium-tracking);\n line-height: var(--md-sys-typescale-headline-medium-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n }\n\n [slot='markdown-html'] h3 {\n font-family: var(--md-sys-typescale-headline-small-font);\n font-weight: var(--md-sys-typescale-headline-small-weight);\n font-size: var(--md-sys-typescale-headline-small-size);\n letter-spacing: var(--md-sys-typescale-headline-small-tracking);\n line-height: var(--md-sys-typescale-headline-small-height);\n }\n\n [slot='markdown-html'] h4 {\n font-family: var(--md-sys-typescale-title-large-font);\n font-weight: var(--md-sys-typescale-title-large-weight);\n font-size: var(--md-sys-typescale-title-large-size);\n letter-spacing: var(--md-sys-typescale-title-large-tracking);\n line-height: var(--md-sys-typescale-title-large-height);\n }\n\n [slot='markdown-html'] h5 {\n font-family: var(--md-sys-typescale-title-medium-font);\n font-weight: var(--md-sys-typescale-title-medium-weight);\n font-size: var(--md-sys-typescale-title-medium-size);\n letter-spacing: var(--md-sys-typescale-title-medium-tracking);\n line-height: var(--md-sys-typescale-title-medium-height);\n }\n\n [slot='markdown-html'] h6 {\n font-family: var(--md-sys-typescale-title-small-font);\n font-weight: var(--md-sys-typescale-title-small-weight);\n font-size: var(--md-sys-typescale-title-small-size);\n letter-spacing: var(--md-sys-typescale-title-small-tracking);\n line-height: var(--md-sys-typescale-title-small-height);\n }\n\n [slot='markdown-html'] p,\n [slot='markdown-html'] blockquote,\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol,\n [slot='markdown-html'] dl,\n [slot='markdown-html'] table,\n [slot='markdown-html'] pre {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] a {\n color: var(--link-color);\n }\n\n [slot='markdown-html'] a:hover {\n color: var(--link-hover-color);\n }\n\n [slot='markdown-html'] > *:last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] hr {\n height: 4px;\n padding: 0;\n margin: 16px 0;\n background-color: var(--markdown-styles-hr-color, #e7e7e7);\n border: 0 none;\n }\n\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol {\n padding-left: 2em;\n }\n\n [slot='markdown-html'] ul.no-list,\n [slot='markdown-html'] ol.no-list {\n padding: 0;\n list-style-type: none;\n }\n\n [slot='markdown-html'] ul ul,\n [slot='markdown-html'] ul ol,\n [slot='markdown-html'] ol ol,\n [slot='markdown-html'] ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] li > p {\n margin-top: 16px;\n }\n\n [slot='markdown-html'] dl {\n padding: 0;\n }\n\n [slot='markdown-html'] dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n [slot='markdown-html'] dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] blockquote {\n padding: 0 15px;\n color: var(--markdown-styles-blockquote-color, #777);\n border-left: 4px solid var(--markdown-styles-blockquote-border-left-color, #ddd);\n }\n\n [slot='markdown-html'] blockquote > :first-child {\n margin-top: 0;\n }\n\n [slot='markdown-html'] blockquote > :last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] table {\n -webkit-font-smoothing: var(--api-font-font-smoothing);\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n border-collapse: collapse;\n }\n\n [slot='markdown-html'] table th {\n font-weight: bold;\n }\n\n [slot='markdown-html'] table th,\n [slot='markdown-html'] table td {\n padding: 6px 13px;\n border: 1px solid var(--markdown-styles-table-header-border-color, #ddd);\n }\n\n [slot='markdown-html'] table tr {\n background-color: var(--markdown-styles-table-row-background-color, #fff);\n border-top: 1px solid #ccc;\n }\n\n [slot='markdown-html'] table tr:nth-child(2n) {\n background-color: var(--markdown-styles-table-even-row-background-color, #f8f8f8);\n }\n\n [slot='markdown-html'] img {\n max-width: 100%;\n box-sizing: content-box;\n background-color: var(--markdown-styles-image-background-color, #fff);\n }\n\n [slot='markdown-html'] img[align='right'] {\n padding-left: 20px;\n }\n\n [slot='markdown-html'] img[align='left'] {\n padding-right: 20px;\n }\n\n [slot='markdown-html'] code,\n [slot='markdown-html'] tt {\n font-family: var(--api-font-code-family, 'Roboto Mono, Consolas, Menlo, monospace');\n -webkit-font-smoothing: var(--api-font-font-smoothing);\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n background-color: var(--markdown-styles-code-background-color, rgba(0, 0, 0, 0.04));\n border-radius: 2px;\n }\n\n [slot='markdown-html'] pre {\n word-wrap: normal;\n }\n\n /**\n* prism.js default theme for JavaScript, CSS and HTML\n* Based on dabblet (http://dabblet.com)\n* @author Lea Verou\n*/\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n font-family: var(--api-font-code-family, 'Roboto Mono, Consolas, Menlo, monospace');\n -webkit-font-smoothing: var(--api-font-font-smoothing);\n color: var(--code-color, black);\n background-color: var(--code-background-color);\n text-shadow: var(--markdown-styles-code-text-shadow, 0 1px white);\n text-align: left;\n word-break: break-all;\n white-space: pre-wrap;\n word-spacing: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n [slot='markdown-html'] pre::-moz-selection,\n [slot='markdown-html'] pre ::-moz-selection,\n [slot='markdown-html'] code::-moz-selection,\n [slot='markdown-html'] code ::-moz-selection {\n text-shadow: none;\n background: var(--markdown-styles-code-selection-background-color, #b3d4fc);\n }\n\n [slot='markdown-html'] pre::selection,\n [slot='markdown-html'] pre ::selection,\n [slot='markdown-html'] code::selection,\n [slot='markdown-html'] code ::selection {\n text-shadow: none;\n background: var(--markdown-styles-code-selection-background-color, #b3d4fc);\n }\n\n @media print {\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n text-shadow: none;\n }\n }\n\n /* Code blocks */\n [slot='markdown-html'] pre {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n }\n\n [slot='markdown-html'] :not(pre) > code,\n [slot='markdown-html'] pre,\n pre[slot='markdown-html'] {\n background: var(--code-background-color, #f5f2f0);\n border: var(--inline-code-border, inherit);\n }\n\n /* Inline code */\n [slot='markdown-html'] :not(pre) > code {\n padding: var(--inline-code-padding, 0.1em);\n border-radius: 0.3em;\n white-space: normal;\n }\n\n [slot='markdown-html'] .token.comment,\n [slot='markdown-html'] .token.prolog,\n [slot='markdown-html'] .token.doctype,\n [slot='markdown-html'] .token.cdata {\n color: var(--markdown-styles-code-cdata-color, slategray);\n }\n\n [slot='markdown-html'] .token.punctuation {\n color: var(--code-punctuation-value-color, #999);\n }\n\n [slot='markdown-html'] .namespace {\n opacity: 0.7;\n }\n\n [slot='markdown-html'] .token.property,\n [slot='markdown-html'] .token.tag,\n [slot='markdown-html'] .token.boolean,\n [slot='markdown-html'] .token.number,\n [slot='markdown-html'] .token.constant,\n [slot='markdown-html'] .token.symbol,\n [slot='markdown-html'] .token.deleted {\n color: var(--code-type-number-value-color, #905);\n }\n\n [slot='markdown-html'] .token.selector,\n [slot='markdown-html'] .token.attr-name,\n [slot='markdown-html'] .token.string,\n [slot='markdown-html'] .token.char,\n [slot='markdown-html'] .token.builtin,\n [slot='markdown-html'] .token.inserted {\n color: var(--code-type-text-value-color, #690);\n }\n\n [slot='markdown-html'] .token.operator,\n [slot='markdown-html'] .token.entity,\n [slot='markdown-html'] .token.url,\n [slot='markdown-html'] .language-css .token.string,\n [slot='markdown-html'] .style .token.string {\n color: var(--code-punctuation-value-color, #a67f59);\n background: hsla(0, 0%, 100%, 0.5);\n }\n\n [slot='markdown-html'] .token.atrule,\n [slot='markdown-html'] .token.attr-value,\n [slot='markdown-html'] .token.keyword {\n color: var(--markdown-styles-code-keyword-color, #07a);\n }\n\n [slot='markdown-html'] .token.function {\n color: var(--markdown-styles-code-function-color, #dd4a68);\n }\n\n [slot='markdown-html'] .token.regex,\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.variable {\n color: var(--markdown-styles-variable-color, #e90);\n }\n\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.bold {\n font-weight: bold;\n }\n [slot='markdown-html'] .token.italic {\n font-style: italic;\n }\n\n [slot='markdown-html'] .token.entity {\n cursor: help;\n }\n`\n"]}
|
|
1
|
+
{"version":3,"file":"MarkdownStyles.js","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyXjB,CAAA","sourcesContent":["/**\n@license\nCopyright 2016 The Advanced REST client authors <arc@mulesoft.com>\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n*/\n/**\n## Styles for markdown viewer\n\nIt should be included where the `marked-highlight` is used.\n\n## Usage example\n\n```javascript\nimport { LitElement, html, css } from 'lit';\nimport { MarkdownStyles } from '@api-client/ui';\n\nclass MarkdownImpl extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n ...\n }\n `,\n MarkdownStyles,\n ]\n }\n\n render() {\n return html`\n <marked-highlight markdown=\"....\">\n <div class=\"markdown-html\"></div>\n </marked-highlight>`;\n }\n}\n```\n\nNote use of the `markdown-html` CSS rules. It is required by markdown element also all css rules\ndefined here are scoped to a container with this class name.\n*/\nimport { css } from 'lit'\n\nexport default css`\n [slot='markdown-html'] {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n }\n\n [slot='markdown-html'] h1,\n [slot='markdown-html'] h2,\n [slot='markdown-html'] h3,\n [slot='markdown-html'] h4,\n [slot='markdown-html'] h5,\n [slot='markdown-html'] h6 {\n color: inherit;\n }\n\n [slot='markdown-html'] h1 tt,\n [slot='markdown-html'] h1 code,\n [slot='markdown-html'] h2 tt,\n [slot='markdown-html'] h2 code,\n [slot='markdown-html'] h3 tt,\n [slot='markdown-html'] h3 code,\n [slot='markdown-html'] h4 tt,\n [slot='markdown-html'] h4 code,\n [slot='markdown-html'] h5 tt,\n [slot='markdown-html'] h5 code,\n [slot='markdown-html'] h6 tt,\n [slot='markdown-html'] h6 code {\n font-size: inherit;\n }\n\n [slot='markdown-html'] h1 {\n font-family: var(--md-sys-typescale-headline-large-font);\n font-weight: var(--md-sys-typescale-headline-large-weight);\n font-size: var(--md-sys-typescale-headline-large-size);\n letter-spacing: var(--md-sys-typescale-headline-large-tracking);\n line-height: var(--md-sys-typescale-headline-large-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n padding-top: 1rem;\n padding-bottom: 0.5rem;\n }\n\n [slot='markdown-html'] h2 {\n font-family: var(--md-sys-typescale-headline-medium-font);\n font-weight: var(--md-sys-typescale-headline-medium-weight);\n font-size: var(--md-sys-typescale-headline-medium-size);\n letter-spacing: var(--md-sys-typescale-headline-medium-tracking);\n line-height: var(--md-sys-typescale-headline-medium-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n }\n\n [slot='markdown-html'] h3 {\n font-family: var(--md-sys-typescale-headline-small-font);\n font-weight: var(--md-sys-typescale-headline-small-weight);\n font-size: var(--md-sys-typescale-headline-small-size);\n letter-spacing: var(--md-sys-typescale-headline-small-tracking);\n line-height: var(--md-sys-typescale-headline-small-height);\n }\n\n [slot='markdown-html'] h4 {\n font-family: var(--md-sys-typescale-title-large-font);\n font-weight: var(--md-sys-typescale-title-large-weight);\n font-size: var(--md-sys-typescale-title-large-size);\n letter-spacing: var(--md-sys-typescale-title-large-tracking);\n line-height: var(--md-sys-typescale-title-large-height);\n }\n\n [slot='markdown-html'] h5 {\n font-family: var(--md-sys-typescale-title-medium-font);\n font-weight: var(--md-sys-typescale-title-medium-weight);\n font-size: var(--md-sys-typescale-title-medium-size);\n letter-spacing: var(--md-sys-typescale-title-medium-tracking);\n line-height: var(--md-sys-typescale-title-medium-height);\n }\n\n [slot='markdown-html'] h6 {\n font-family: var(--md-sys-typescale-title-small-font);\n font-weight: var(--md-sys-typescale-title-small-weight);\n font-size: var(--md-sys-typescale-title-small-size);\n letter-spacing: var(--md-sys-typescale-title-small-tracking);\n line-height: var(--md-sys-typescale-title-small-height);\n }\n\n [slot='markdown-html'] p,\n [slot='markdown-html'] blockquote,\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol,\n [slot='markdown-html'] dl,\n [slot='markdown-html'] table,\n [slot='markdown-html'] pre {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] a {\n color: var(--link-color);\n }\n\n [slot='markdown-html'] a:hover {\n color: var(--link-hover-color);\n }\n\n [slot='markdown-html'] > *:last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] hr {\n height: 4px;\n padding: 0;\n margin: 16px 0;\n background-color: var(--markdown-styles-hr-color, #e7e7e7);\n border: 0 none;\n }\n\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol {\n padding-left: 2em;\n }\n\n [slot='markdown-html'] ul.no-list,\n [slot='markdown-html'] ol.no-list {\n padding: 0;\n list-style-type: none;\n }\n\n [slot='markdown-html'] ul ul,\n [slot='markdown-html'] ul ol,\n [slot='markdown-html'] ol ol,\n [slot='markdown-html'] ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] li > p {\n margin-top: 16px;\n }\n\n [slot='markdown-html'] dl {\n padding: 0;\n }\n\n [slot='markdown-html'] dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n [slot='markdown-html'] dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] blockquote {\n padding: 0 15px;\n color: var(--markdown-styles-blockquote-color, #777);\n border-left: 4px solid var(--markdown-styles-blockquote-border-left-color, #ddd);\n }\n\n [slot='markdown-html'] blockquote > :first-child {\n margin-top: 0;\n }\n\n [slot='markdown-html'] blockquote > :last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] table {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n border-collapse: collapse;\n }\n\n [slot='markdown-html'] table th {\n font-weight: bold;\n }\n\n [slot='markdown-html'] table th,\n [slot='markdown-html'] table td {\n padding: 6px 13px;\n border: 1px solid var(--markdown-styles-table-header-border-color, #ddd);\n }\n\n [slot='markdown-html'] table tr {\n background-color: var(--markdown-styles-table-row-background-color, #fff);\n border-top: 1px solid #ccc;\n }\n\n [slot='markdown-html'] table tr:nth-child(2n) {\n background-color: var(--markdown-styles-table-even-row-background-color, #f8f8f8);\n }\n\n [slot='markdown-html'] img {\n max-width: 100%;\n box-sizing: content-box;\n background-color: var(--markdown-styles-image-background-color, #fff);\n }\n\n [slot='markdown-html'] img[align='right'] {\n padding-left: 20px;\n }\n\n [slot='markdown-html'] img[align='left'] {\n padding-right: 20px;\n }\n\n [slot='markdown-html'] code,\n [slot='markdown-html'] tt {\n font-family: var(--markdown-styles-code-font-family, 'Roboto Mono, Consolas, Menlo, monospace');\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n background-color: var(--markdown-styles-code-background-color, rgba(0, 0, 0, 0.04));\n border-radius: 2px;\n }\n\n [slot='markdown-html'] pre {\n word-wrap: normal;\n }\n\n /**\n* prism.js default theme for JavaScript, CSS and HTML\n* Based on dabblet (http://dabblet.com)\n* @author Lea Verou\n*/\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n font-family: var(--markdown-styles-code-font-family, 'Roboto Mono, Consolas, Menlo, monospace');\n color: var(--code-color, black);\n background-color: var(--code-background-color);\n text-shadow: var(--markdown-styles-code-text-shadow, 0 1px white);\n text-align: left;\n word-break: break-all;\n white-space: pre-wrap;\n word-spacing: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n [slot='markdown-html'] pre::-moz-selection,\n [slot='markdown-html'] pre ::-moz-selection,\n [slot='markdown-html'] code::-moz-selection,\n [slot='markdown-html'] code ::-moz-selection {\n text-shadow: none;\n background: var(--markdown-styles-code-selection-background-color, #b3d4fc);\n }\n\n [slot='markdown-html'] pre::selection,\n [slot='markdown-html'] pre ::selection,\n [slot='markdown-html'] code::selection,\n [slot='markdown-html'] code ::selection {\n text-shadow: none;\n background: var(--markdown-styles-code-selection-background-color, #b3d4fc);\n }\n\n @media print {\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n text-shadow: none;\n }\n }\n\n /* Code blocks */\n [slot='markdown-html'] pre {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n }\n\n [slot='markdown-html'] :not(pre) > code,\n [slot='markdown-html'] pre,\n pre[slot='markdown-html'] {\n background: var(--code-background-color, #f5f2f0);\n border: var(--inline-code-border, inherit);\n }\n\n /* Inline code */\n [slot='markdown-html'] :not(pre) > code {\n padding: var(--inline-code-padding, 0.1em);\n border-radius: 0.3em;\n white-space: normal;\n }\n\n [slot='markdown-html'] .token.comment,\n [slot='markdown-html'] .token.prolog,\n [slot='markdown-html'] .token.doctype,\n [slot='markdown-html'] .token.cdata {\n color: var(--markdown-styles-code-cdata-color, slategray);\n }\n\n [slot='markdown-html'] .token.punctuation {\n color: var(--code-punctuation-value-color, #999);\n }\n\n [slot='markdown-html'] .namespace {\n opacity: 0.7;\n }\n\n [slot='markdown-html'] .token.property,\n [slot='markdown-html'] .token.tag,\n [slot='markdown-html'] .token.boolean,\n [slot='markdown-html'] .token.number,\n [slot='markdown-html'] .token.constant,\n [slot='markdown-html'] .token.symbol,\n [slot='markdown-html'] .token.deleted {\n color: var(--code-type-number-value-color, #905);\n }\n\n [slot='markdown-html'] .token.selector,\n [slot='markdown-html'] .token.attr-name,\n [slot='markdown-html'] .token.string,\n [slot='markdown-html'] .token.char,\n [slot='markdown-html'] .token.builtin,\n [slot='markdown-html'] .token.inserted {\n color: var(--code-type-text-value-color, #690);\n }\n\n [slot='markdown-html'] .token.operator,\n [slot='markdown-html'] .token.entity,\n [slot='markdown-html'] .token.url,\n [slot='markdown-html'] .language-css .token.string,\n [slot='markdown-html'] .style .token.string {\n color: var(--code-punctuation-value-color, #a67f59);\n background: hsla(0, 0%, 100%, 0.5);\n }\n\n [slot='markdown-html'] .token.atrule,\n [slot='markdown-html'] .token.attr-value,\n [slot='markdown-html'] .token.keyword {\n color: var(--markdown-styles-code-keyword-color, #07a);\n }\n\n [slot='markdown-html'] .token.function {\n color: var(--markdown-styles-code-function-color, #dd4a68);\n }\n\n [slot='markdown-html'] .token.regex,\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.variable {\n color: var(--markdown-styles-variable-color, #e90);\n }\n\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.bold {\n font-weight: bold;\n }\n [slot='markdown-html'] .token.italic {\n font-style: italic;\n }\n\n [slot='markdown-html'] .token.entity {\n cursor: help;\n }\n`\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@api-client/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Internal UI component library for the API Client ecosystem.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "build/src/index.js",
|
|
@@ -77,9 +77,7 @@
|
|
|
77
77
|
"build": {
|
|
78
78
|
"command": "npm run copy-assets",
|
|
79
79
|
"dependencies": [
|
|
80
|
-
"tsc"
|
|
81
|
-
"lint:prettier",
|
|
82
|
-
"lint:eslint"
|
|
80
|
+
"tsc"
|
|
83
81
|
]
|
|
84
82
|
},
|
|
85
83
|
"copy-assets": {
|
|
@@ -175,7 +173,7 @@
|
|
|
175
173
|
}
|
|
176
174
|
},
|
|
177
175
|
"dependencies": {
|
|
178
|
-
"@api-client/core": "^0.
|
|
176
|
+
"@api-client/core": "^0.15.0",
|
|
179
177
|
"@api-client/graph": "^0.3.6",
|
|
180
178
|
"@api-client/json": "^0.2.0",
|
|
181
179
|
"@github/relative-time-element": "^4.4.6",
|
|
@@ -198,6 +196,7 @@
|
|
|
198
196
|
"@eslint/compat": "^1.2.8",
|
|
199
197
|
"@eslint/js": "^9.26.0",
|
|
200
198
|
"@open-wc/testing": "^4.0.0",
|
|
199
|
+
"@pawel-up/semver": "^0.1.4",
|
|
201
200
|
"@types/marked": "^5.0.2",
|
|
202
201
|
"@types/mocha": "^10.0.10",
|
|
203
202
|
"@types/node": "^24.0.0",
|
|
@@ -50,7 +50,6 @@ import { css } from 'lit'
|
|
|
50
50
|
|
|
51
51
|
export default css`
|
|
52
52
|
[slot='markdown-html'] {
|
|
53
|
-
/* -webkit-font-smoothing: var(--api-font-font-smoothing); */
|
|
54
53
|
font-family: var(--md-sys-typescale-body-large-font);
|
|
55
54
|
font-weight: var(--md-sys-typescale-body-large-weight);
|
|
56
55
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
@@ -225,7 +224,6 @@ export default css`
|
|
|
225
224
|
}
|
|
226
225
|
|
|
227
226
|
[slot='markdown-html'] table {
|
|
228
|
-
-webkit-font-smoothing: var(--api-font-font-smoothing);
|
|
229
227
|
font-family: var(--md-sys-typescale-body-large-font);
|
|
230
228
|
font-weight: var(--md-sys-typescale-body-large-weight);
|
|
231
229
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
@@ -274,8 +272,7 @@ export default css`
|
|
|
274
272
|
|
|
275
273
|
[slot='markdown-html'] code,
|
|
276
274
|
[slot='markdown-html'] tt {
|
|
277
|
-
font-family: var(--
|
|
278
|
-
-webkit-font-smoothing: var(--api-font-font-smoothing);
|
|
275
|
+
font-family: var(--markdown-styles-code-font-family, 'Roboto Mono, Consolas, Menlo, monospace');
|
|
279
276
|
padding: 0;
|
|
280
277
|
padding-top: 0.2em;
|
|
281
278
|
padding-bottom: 0.2em;
|
|
@@ -295,8 +292,7 @@ export default css`
|
|
|
295
292
|
*/
|
|
296
293
|
[slot='markdown-html'] code,
|
|
297
294
|
[slot='markdown-html'] pre {
|
|
298
|
-
font-family: var(--
|
|
299
|
-
-webkit-font-smoothing: var(--api-font-font-smoothing);
|
|
295
|
+
font-family: var(--markdown-styles-code-font-family, 'Roboto Mono, Consolas, Menlo, monospace');
|
|
300
296
|
color: var(--code-color, black);
|
|
301
297
|
background-color: var(--code-background-color);
|
|
302
298
|
text-shadow: var(--markdown-styles-code-text-shadow, 0 1px white);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
-
# to commit it to your repository.
|
|
3
|
-
#
|
|
4
|
-
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
-
# or to provide custom queries or build logic.
|
|
6
|
-
#
|
|
7
|
-
# ******** NOTE ********
|
|
8
|
-
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
-
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
-
# supported CodeQL languages.
|
|
11
|
-
#
|
|
12
|
-
name: "CodeQL"
|
|
13
|
-
|
|
14
|
-
on:
|
|
15
|
-
push:
|
|
16
|
-
branches: [ master ]
|
|
17
|
-
pull_request:
|
|
18
|
-
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [ master ]
|
|
20
|
-
schedule:
|
|
21
|
-
- cron: '21 7 * * 5'
|
|
22
|
-
|
|
23
|
-
jobs:
|
|
24
|
-
analyze:
|
|
25
|
-
name: Analyze
|
|
26
|
-
runs-on: ubuntu-latest
|
|
27
|
-
|
|
28
|
-
strategy:
|
|
29
|
-
fail-fast: false
|
|
30
|
-
matrix:
|
|
31
|
-
language: [ 'javascript' ]
|
|
32
|
-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
33
|
-
# Learn more:
|
|
34
|
-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
|
35
|
-
|
|
36
|
-
steps:
|
|
37
|
-
- name: Checkout repository
|
|
38
|
-
uses: actions/checkout@v2
|
|
39
|
-
|
|
40
|
-
# Initializes the CodeQL tools for scanning.
|
|
41
|
-
- name: Initialize CodeQL
|
|
42
|
-
uses: github/codeql-action/init@v1
|
|
43
|
-
with:
|
|
44
|
-
languages: ${{ matrix.language }}
|
|
45
|
-
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
46
|
-
# By default, queries listed here will override any specified in a config file.
|
|
47
|
-
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
48
|
-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
49
|
-
|
|
50
|
-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
51
|
-
# If this step fails, then you should remove it and run the build manually (see below)
|
|
52
|
-
- name: Autobuild
|
|
53
|
-
uses: github/codeql-action/autobuild@v1
|
|
54
|
-
|
|
55
|
-
# âšī¸ Command-line programs to run using the OS shell.
|
|
56
|
-
# đ https://git.io/JvXDl
|
|
57
|
-
|
|
58
|
-
# âī¸ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
59
|
-
# and modify them (or add more) to build your code if your project
|
|
60
|
-
# uses a compiled language
|
|
61
|
-
|
|
62
|
-
#- run: |
|
|
63
|
-
# make bootstrap
|
|
64
|
-
# make release
|
|
65
|
-
|
|
66
|
-
- name: Perform CodeQL Analysis
|
|
67
|
-
uses: github/codeql-action/analyze@v1
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
name: Tests and publishing
|
|
2
|
-
env:
|
|
3
|
-
FORCE_COLOR: 1
|
|
4
|
-
on:
|
|
5
|
-
push:
|
|
6
|
-
branches:
|
|
7
|
-
- main
|
|
8
|
-
- develop
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- main
|
|
12
|
-
jobs:
|
|
13
|
-
test_linux:
|
|
14
|
-
name: Ubuntu
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout code
|
|
18
|
-
uses: actions/checkout@v4
|
|
19
|
-
with:
|
|
20
|
-
fetch-depth: 0
|
|
21
|
-
- name: Install NodeJS
|
|
22
|
-
uses: actions/setup-node@v4
|
|
23
|
-
with:
|
|
24
|
-
node-version: 20
|
|
25
|
-
- name: Get npm cache directory
|
|
26
|
-
id: npm-cache-dir
|
|
27
|
-
shell: bash
|
|
28
|
-
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
|
|
29
|
-
- uses: actions/cache@v4
|
|
30
|
-
with:
|
|
31
|
-
path: ~/.npm
|
|
32
|
-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
33
|
-
restore-keys: |
|
|
34
|
-
${{ runner.os }}-node-
|
|
35
|
-
- uses: google/wireit@setup-github-actions-caching/v2
|
|
36
|
-
- name: Install dependencies
|
|
37
|
-
run: npm ci
|
|
38
|
-
- name: Install playwright browsers
|
|
39
|
-
run: npx playwright install chromium --with-deps
|
|
40
|
-
- name: Run tests
|
|
41
|
-
run: npm test
|
|
42
|
-
tag:
|
|
43
|
-
name: "Publishing release"
|
|
44
|
-
if: github.ref == 'refs/heads/main'
|
|
45
|
-
needs:
|
|
46
|
-
- test_linux
|
|
47
|
-
runs-on: ubuntu-latest
|
|
48
|
-
steps:
|
|
49
|
-
- name: Checkout code
|
|
50
|
-
uses: actions/checkout@v4
|
|
51
|
-
with:
|
|
52
|
-
fetch-depth: 0
|
|
53
|
-
- name: Install NodeJS
|
|
54
|
-
uses: actions/setup-node@v4
|
|
55
|
-
with:
|
|
56
|
-
node-version: 20
|
|
57
|
-
registry-url: 'https://registry.npmjs.org'
|
|
58
|
-
- uses: actions/cache@v4
|
|
59
|
-
with:
|
|
60
|
-
path: ~/.npm
|
|
61
|
-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
62
|
-
restore-keys: |
|
|
63
|
-
${{ runner.os }}-node-
|
|
64
|
-
- name: Install dependencies
|
|
65
|
-
run: npm ci
|
|
66
|
-
- name: build
|
|
67
|
-
run: npm run build
|
|
68
|
-
- name: Read version from package.json
|
|
69
|
-
uses: culshaw/read-package-node-version-actions@v1
|
|
70
|
-
id: package-node-version
|
|
71
|
-
- name: Changelog
|
|
72
|
-
uses: scottbrenner/generate-changelog-action@master
|
|
73
|
-
id: Changelog
|
|
74
|
-
- name: Github Release
|
|
75
|
-
id: create_release
|
|
76
|
-
uses: actions/create-release@latest
|
|
77
|
-
env:
|
|
78
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
-
with:
|
|
80
|
-
tag_name: v${{ steps.package-node-version.outputs.version }}
|
|
81
|
-
release_name: v${{ steps.package-node-version.outputs.version }}
|
|
82
|
-
body: |
|
|
83
|
-
${{ steps.Changelog.outputs.changelog }}
|
|
84
|
-
draft: false
|
|
85
|
-
prerelease: false
|
|
86
|
-
- run: npm publish --access public
|
|
87
|
-
env:
|
|
88
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|