@linagora/linid-im-front-corelib 0.0.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/ISSUE_TEMPLATE/bug_report.yml +83 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +90 -0
- package/.github/ISSUE_TEMPLATE/question.yml +31 -0
- package/.github/ISSUE_TEMPLATE/security.yml +69 -0
- package/.github/actions/setup-node-pnpm/action.yml +29 -0
- package/.github/workflows/pull-request.yml +122 -0
- package/.github/workflows/release.yml +85 -0
- package/.prettierignore +7 -0
- package/.prettierrc.json +5 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +9 -0
- package/CONTRIBUTING.md +264 -0
- package/COPYRIGHT +23 -0
- package/LICENSE.md +482 -0
- package/README.md +107 -0
- package/dist/core-lib.es.js +3045 -0
- package/dist/core-lib.umd.js +12 -0
- package/dist/package.json +74 -0
- package/dist/types/src/components/LinidZoneRenderer.vue.d.ts +19 -0
- package/dist/types/src/index.d.ts +7 -0
- package/dist/types/src/lifecycle/skeleton.d.ts +100 -0
- package/dist/types/src/services/federationService.d.ts +11 -0
- package/dist/types/src/stores/linidZoneStore.d.ts +23 -0
- package/dist/types/src/types/linidZone.d.ts +21 -0
- package/dist/types/src/types/module.d.ts +63 -0
- package/dist/types/src/types/moduleLifecycle.d.ts +121 -0
- package/dist/types/vite.config.d.ts +2 -0
- package/docs/components-plugin-zones.md +168 -0
- package/docs/helpers.md +188 -0
- package/docs/module-lifecycle.md +874 -0
- package/docs/types-and-interfaces.md +92 -0
- package/eslint.config.js +135 -0
- package/package.json +73 -0
- package/src/components/LinidZoneRenderer.vue +77 -0
- package/src/index.ts +51 -0
- package/src/lifecycle/skeleton.ts +154 -0
- package/src/services/federationService.ts +44 -0
- package/src/stores/linidZoneStore.ts +62 -0
- package/src/types/linidZone.ts +48 -0
- package/src/types/module.ts +96 -0
- package/src/types/moduleLifecycle.ts +163 -0
- package/tsconfig.json +30 -0
- package/vite.config.ts +42 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: 🐛 Bug Report
|
|
2
|
+
description: Report a bug to help us improve the project
|
|
3
|
+
title: "[BUG] - <title>"
|
|
4
|
+
labels: ["bug", "🆕 Needs triage"]
|
|
5
|
+
assignees: []
|
|
6
|
+
|
|
7
|
+
body:
|
|
8
|
+
- type: markdown
|
|
9
|
+
attributes:
|
|
10
|
+
value: "Please fill out this template carefully to help us reproduce and fix the issue."
|
|
11
|
+
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: description
|
|
14
|
+
attributes:
|
|
15
|
+
label: "Description"
|
|
16
|
+
description: "Describe the bug in detail."
|
|
17
|
+
placeholder: "A clear and concise description of what the bug is."
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: steps_to_reproduce
|
|
21
|
+
attributes:
|
|
22
|
+
label: "To Reproduce"
|
|
23
|
+
description: "Steps to reproduce the behavior"
|
|
24
|
+
placeholder: "1. Go to ...\n2. Click on ...\n3. See error"
|
|
25
|
+
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: current_behavior
|
|
28
|
+
attributes:
|
|
29
|
+
label: "Current behavior"
|
|
30
|
+
description: "Describe what is happening instead of the expected behavior"
|
|
31
|
+
placeholder: "What actually happens?"
|
|
32
|
+
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: expected_behavior
|
|
35
|
+
attributes:
|
|
36
|
+
label: "Expected behavior"
|
|
37
|
+
description: "Describe what you expected to happen"
|
|
38
|
+
placeholder: "What should happen instead?"
|
|
39
|
+
|
|
40
|
+
- type: textarea
|
|
41
|
+
id: screenshots
|
|
42
|
+
attributes:
|
|
43
|
+
label: "Screenshots"
|
|
44
|
+
description: "If applicable, add screenshots to help explain your problem"
|
|
45
|
+
placeholder: "Paste screenshot links or attach images"
|
|
46
|
+
|
|
47
|
+
- type: input
|
|
48
|
+
id: app_version
|
|
49
|
+
attributes:
|
|
50
|
+
label: "App version"
|
|
51
|
+
description: "Which version of the application are you using?"
|
|
52
|
+
placeholder: "e.g. 1.2.3"
|
|
53
|
+
|
|
54
|
+
- type: input
|
|
55
|
+
id: plugins
|
|
56
|
+
attributes:
|
|
57
|
+
label: "Plugins and versions"
|
|
58
|
+
description: "List any plugins or extensions and their versions"
|
|
59
|
+
placeholder: "Plugin X v1.0, Plugin Y v2.3"
|
|
60
|
+
|
|
61
|
+
- type: dropdown
|
|
62
|
+
id: device_type
|
|
63
|
+
attributes:
|
|
64
|
+
label: "Device type"
|
|
65
|
+
description: "Select the type of device"
|
|
66
|
+
options:
|
|
67
|
+
- "All"
|
|
68
|
+
- "PC"
|
|
69
|
+
- "Smartphone"
|
|
70
|
+
- "Tablet"
|
|
71
|
+
|
|
72
|
+
- type: dropdown
|
|
73
|
+
id: browser
|
|
74
|
+
attributes:
|
|
75
|
+
label: "Browser"
|
|
76
|
+
description: "Select the browser you are using"
|
|
77
|
+
options:
|
|
78
|
+
- "All"
|
|
79
|
+
- "Chrome"
|
|
80
|
+
- "Firefox"
|
|
81
|
+
- "Safari"
|
|
82
|
+
- "Edge"
|
|
83
|
+
- "Other"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: 🚀 Feature Request / Enhancement
|
|
2
|
+
description: Suggest a new feature or improvement for the project
|
|
3
|
+
title: "[FEATURE] - <title>"
|
|
4
|
+
labels: ["enhancement", "🆕 Needs triage"]
|
|
5
|
+
assignees: []
|
|
6
|
+
|
|
7
|
+
body:
|
|
8
|
+
- type: markdown
|
|
9
|
+
attributes:
|
|
10
|
+
value: "Please provide detailed information to help us understand and evaluate your feature request."
|
|
11
|
+
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: feature_summary
|
|
14
|
+
attributes:
|
|
15
|
+
label: "Feature summary"
|
|
16
|
+
description: "Provide a short title or summary of the feature you want"
|
|
17
|
+
placeholder: "E.g., Add dark mode option"
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: detailed_description
|
|
21
|
+
attributes:
|
|
22
|
+
label: "Detailed description"
|
|
23
|
+
description: "Explain the feature or improvement in detail"
|
|
24
|
+
placeholder: "Describe the feature, its purpose, and how it should work"
|
|
25
|
+
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: benefits
|
|
28
|
+
attributes:
|
|
29
|
+
label: "Benefits"
|
|
30
|
+
description: "Explain why this feature is useful or what problem it solves"
|
|
31
|
+
placeholder: "E.g., Improve accessibility for low-light environments"
|
|
32
|
+
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: alternatives
|
|
35
|
+
attributes:
|
|
36
|
+
label: "Alternatives considered"
|
|
37
|
+
description: "Describe any alternative solutions or approaches you considered"
|
|
38
|
+
placeholder: "E.g., Using a browser extension, a different workflow, etc."
|
|
39
|
+
|
|
40
|
+
- type: dropdown
|
|
41
|
+
id: scope
|
|
42
|
+
attributes:
|
|
43
|
+
label: "Scope"
|
|
44
|
+
description: "Specify if this feature concerns the core app, a plugin, or unsure"
|
|
45
|
+
options:
|
|
46
|
+
- "Core application"
|
|
47
|
+
- "Plugin"
|
|
48
|
+
- "Unsure / I don't know"
|
|
49
|
+
|
|
50
|
+
- type: input
|
|
51
|
+
id: app_version
|
|
52
|
+
attributes:
|
|
53
|
+
label: "App version"
|
|
54
|
+
description: "Which version of the application would benefit from this feature?"
|
|
55
|
+
placeholder: "e.g., 1.2.3"
|
|
56
|
+
|
|
57
|
+
- type: dropdown
|
|
58
|
+
id: priority
|
|
59
|
+
attributes:
|
|
60
|
+
label: "Priority"
|
|
61
|
+
description: "How important is this feature to you?"
|
|
62
|
+
options:
|
|
63
|
+
- "Low"
|
|
64
|
+
- "Medium"
|
|
65
|
+
- "High"
|
|
66
|
+
- "Urgent"
|
|
67
|
+
|
|
68
|
+
- type: dropdown
|
|
69
|
+
id: device_type
|
|
70
|
+
attributes:
|
|
71
|
+
label: "Device type"
|
|
72
|
+
description: "Select the type of device you are targeting"
|
|
73
|
+
options:
|
|
74
|
+
- "All"
|
|
75
|
+
- "PC"
|
|
76
|
+
- "Smartphone"
|
|
77
|
+
- "Tablet"
|
|
78
|
+
|
|
79
|
+
- type: dropdown
|
|
80
|
+
id: browser
|
|
81
|
+
attributes:
|
|
82
|
+
label: "Browser"
|
|
83
|
+
description: "Select the browser you are using (if relevant)"
|
|
84
|
+
options:
|
|
85
|
+
- "All"
|
|
86
|
+
- "Chrome"
|
|
87
|
+
- "Firefox"
|
|
88
|
+
- "Safari"
|
|
89
|
+
- "Edge"
|
|
90
|
+
- "Other"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: ❓ Question / Help
|
|
2
|
+
description: Ask a question about the tool, a feature, or usage
|
|
3
|
+
title: "[QUESTION] - <title>"
|
|
4
|
+
labels: ["question", "🆕 Needs triage"]
|
|
5
|
+
assignees: []
|
|
6
|
+
|
|
7
|
+
body:
|
|
8
|
+
- type: markdown
|
|
9
|
+
attributes:
|
|
10
|
+
value: "Please provide as much information as possible so we can answer your question effectively."
|
|
11
|
+
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: question_summary
|
|
14
|
+
attributes:
|
|
15
|
+
label: "Question summary"
|
|
16
|
+
description: "Provide a brief summary of your question"
|
|
17
|
+
placeholder: "E.g., How do I enable feature X?"
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: detailed_description
|
|
21
|
+
attributes:
|
|
22
|
+
label: "Detailed description"
|
|
23
|
+
description: "Explain your question in detail"
|
|
24
|
+
placeholder: "Include context, what you have tried, and what you want to achieve."
|
|
25
|
+
|
|
26
|
+
- type: input
|
|
27
|
+
id: app_version
|
|
28
|
+
attributes:
|
|
29
|
+
label: "App version"
|
|
30
|
+
description: "Which version of the application are you using?"
|
|
31
|
+
placeholder: "e.g., 1.2.3"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: 🔒 Security / Dependency Issue
|
|
2
|
+
description: Report a security vulnerability or dependency issue
|
|
3
|
+
title: "[SECURITY] - <title>"
|
|
4
|
+
labels: ["security", "🆕 Needs triage"]
|
|
5
|
+
assignees: []
|
|
6
|
+
|
|
7
|
+
body:
|
|
8
|
+
- type: markdown
|
|
9
|
+
attributes:
|
|
10
|
+
value: |
|
|
11
|
+
⚠️ **Do not include sensitive information in this public issue.**
|
|
12
|
+
If this is a vulnerability, please follow responsible disclosure procedures.
|
|
13
|
+
|
|
14
|
+
**Important:** If this is a **critical vulnerability** or could **endanger the application**, please **contact the project maintainers directly** via a private message/email. You will be **credited** for reporting the issue and/or helping to fix it.
|
|
15
|
+
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: issue_summary
|
|
18
|
+
attributes:
|
|
19
|
+
label: "Summary of the issue"
|
|
20
|
+
description: "Provide a short summary of the security or dependency problem"
|
|
21
|
+
placeholder: "E.g., Outdated library X with known vulnerability CVE-1234"
|
|
22
|
+
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: detailed_description
|
|
25
|
+
attributes:
|
|
26
|
+
label: "Detailed description"
|
|
27
|
+
description: "Describe the problem in detail, without including sensitive information"
|
|
28
|
+
placeholder: "Include context, version numbers, and affected modules"
|
|
29
|
+
|
|
30
|
+
- type: textarea
|
|
31
|
+
id: steps_to_reproduce
|
|
32
|
+
attributes:
|
|
33
|
+
label: "Steps to reproduce / observe"
|
|
34
|
+
description: "Explain how the issue can be observed without exposing sensitive data"
|
|
35
|
+
placeholder: "Step 1: ..., Step 2: ..."
|
|
36
|
+
|
|
37
|
+
- type: input
|
|
38
|
+
id: app_version
|
|
39
|
+
attributes:
|
|
40
|
+
label: "App version"
|
|
41
|
+
description: "Which version of the application is affected?"
|
|
42
|
+
placeholder: "e.g., 1.2.3"
|
|
43
|
+
|
|
44
|
+
- type: input
|
|
45
|
+
id: dependencies
|
|
46
|
+
attributes:
|
|
47
|
+
label: "Dependencies involved"
|
|
48
|
+
description: "List the affected libraries/plugins and their versions"
|
|
49
|
+
placeholder: "E.g., library X v1.0.0, plugin Y v2.3.1"
|
|
50
|
+
|
|
51
|
+
- type: dropdown
|
|
52
|
+
id: severity
|
|
53
|
+
attributes:
|
|
54
|
+
label: "Severity"
|
|
55
|
+
description: "Estimate the severity of the issue"
|
|
56
|
+
options:
|
|
57
|
+
- "Low"
|
|
58
|
+
- "Medium"
|
|
59
|
+
- "High"
|
|
60
|
+
- "Urgent"
|
|
61
|
+
|
|
62
|
+
- type: dropdown
|
|
63
|
+
id: disclosure_preference
|
|
64
|
+
attributes:
|
|
65
|
+
label: "Disclosure preference"
|
|
66
|
+
description: "Should this be handled privately?"
|
|
67
|
+
options:
|
|
68
|
+
- "Public discussion is OK"
|
|
69
|
+
- "Report privately (recommended for vulnerabilities)"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: 'Setup Node.js and pnpm'
|
|
2
|
+
description: 'Setup Node.js, pnpm and install dependencies'
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
node-version:
|
|
6
|
+
description: 'Node.js version to use'
|
|
7
|
+
required: true
|
|
8
|
+
pnpm-version:
|
|
9
|
+
description: 'pnpm version to use'
|
|
10
|
+
required: true
|
|
11
|
+
|
|
12
|
+
runs:
|
|
13
|
+
using: 'composite'
|
|
14
|
+
steps:
|
|
15
|
+
- name: Setup pnpm
|
|
16
|
+
uses: pnpm/action-setup@v4
|
|
17
|
+
with:
|
|
18
|
+
version: ${{ inputs.pnpm-version }}
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: ${{ inputs.node-version }}
|
|
24
|
+
cache: 'pnpm'
|
|
25
|
+
registry-url: 'https://registry.npmjs.org'
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
shell: bash
|
|
29
|
+
run: pnpm install --frozen-lockfile
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
name: Pull request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
NODE_VERSION: 22.19
|
|
9
|
+
PNPM_VERSION: 10.20.0
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
delete-comments:
|
|
13
|
+
name: Delete bot comment(s)
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: izhangzhihao/delete-comment@master
|
|
17
|
+
with:
|
|
18
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
19
|
+
delete_user_name: github-actions[bot]
|
|
20
|
+
issue_number: ${{ github.event.number }}
|
|
21
|
+
|
|
22
|
+
branch-naming-rules:
|
|
23
|
+
name: Check branch name
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- uses: deepakputhraya/action-branch-name@master
|
|
27
|
+
with:
|
|
28
|
+
regex: '^(feature|bugfix|improvement|release|hotfix)\/[a-z0-9_.-]+$'
|
|
29
|
+
allowed_prefixes: 'feature,bugfix,improvement,release,hotfix'
|
|
30
|
+
ignore: main
|
|
31
|
+
min_length: 5
|
|
32
|
+
max_length: 50
|
|
33
|
+
|
|
34
|
+
build:
|
|
35
|
+
name: Setup app
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
|
|
40
|
+
- name: Setup Node.js and pnpm
|
|
41
|
+
uses: ./.github/actions/setup-node-pnpm
|
|
42
|
+
with:
|
|
43
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
44
|
+
pnpm-version: ${{ env.PNPM_VERSION }}
|
|
45
|
+
|
|
46
|
+
- name: Build application
|
|
47
|
+
run: pnpm build
|
|
48
|
+
|
|
49
|
+
commit-checks:
|
|
50
|
+
name: Check commit messages
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
needs: [build]
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
with:
|
|
56
|
+
fetch-depth: 0
|
|
57
|
+
|
|
58
|
+
- name: Setup Node.js and pnpm
|
|
59
|
+
uses: ./.github/actions/setup-node-pnpm
|
|
60
|
+
with:
|
|
61
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
62
|
+
pnpm-version: ${{ env.PNPM_VERSION }}
|
|
63
|
+
|
|
64
|
+
- name: Install commitlint
|
|
65
|
+
run: pnpm add -D @commitlint/config-conventional @commitlint/cli
|
|
66
|
+
|
|
67
|
+
- name: Run commitlint
|
|
68
|
+
run: |
|
|
69
|
+
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.cjs
|
|
70
|
+
pnpm exec commitlint --from=origin/main --to=HEAD --verbose
|
|
71
|
+
|
|
72
|
+
check-dependencies:
|
|
73
|
+
name: Check dependencies
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
needs: [build]
|
|
76
|
+
steps:
|
|
77
|
+
- uses: actions/checkout@v4
|
|
78
|
+
|
|
79
|
+
- name: Setup Node.js and pnpm
|
|
80
|
+
uses: ./.github/actions/setup-node-pnpm
|
|
81
|
+
with:
|
|
82
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
83
|
+
pnpm-version: ${{ env.PNPM_VERSION }}
|
|
84
|
+
|
|
85
|
+
- name: Check outdated dependencies
|
|
86
|
+
run: |
|
|
87
|
+
pnpm add -D npm-check-updates
|
|
88
|
+
echo '```bash' > dependencies.txt
|
|
89
|
+
npx ncu >> dependencies.txt
|
|
90
|
+
echo '```' >> dependencies.txt
|
|
91
|
+
|
|
92
|
+
- name: Comment PR
|
|
93
|
+
uses: JoseThen/comment-pr@v1.2.0
|
|
94
|
+
with:
|
|
95
|
+
file_path: ./dependencies.txt
|
|
96
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
97
|
+
|
|
98
|
+
check-style:
|
|
99
|
+
name: Code style
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
needs: [build]
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/checkout@v4
|
|
104
|
+
|
|
105
|
+
- name: Setup Node.js and pnpm
|
|
106
|
+
uses: ./.github/actions/setup-node-pnpm
|
|
107
|
+
with:
|
|
108
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
109
|
+
pnpm-version: ${{ env.PNPM_VERSION }}
|
|
110
|
+
|
|
111
|
+
- name: Check style
|
|
112
|
+
run: pnpm validate
|
|
113
|
+
|
|
114
|
+
security-check:
|
|
115
|
+
name: Supply Chain Malware Scan
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
steps:
|
|
118
|
+
- uses: actions/checkout@v4
|
|
119
|
+
|
|
120
|
+
- uses: gensecaihq/Shai-Hulud-2.0-Detector@v1
|
|
121
|
+
with:
|
|
122
|
+
fail-on-critical: true
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
NODE_VERSION: 22.19
|
|
10
|
+
PNPM_VERSION: 10.20.0
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
issues: write
|
|
15
|
+
pull-requests: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
release:
|
|
19
|
+
name: Release with Release Please
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
outputs:
|
|
22
|
+
release_created: ${{ steps.set_output.outputs.release_created }}
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout repository
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Setup Node.js and pnpm
|
|
30
|
+
uses: ./.github/actions/setup-node-pnpm
|
|
31
|
+
with:
|
|
32
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
33
|
+
pnpm-version: ${{ env.PNPM_VERSION }}
|
|
34
|
+
|
|
35
|
+
- name: Run release
|
|
36
|
+
run: |
|
|
37
|
+
git config user.name "github-actions[bot]"
|
|
38
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
39
|
+
pnpx standard-version
|
|
40
|
+
|
|
41
|
+
- name: Push changes and tags
|
|
42
|
+
run: |
|
|
43
|
+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
|
44
|
+
git push origin main
|
|
45
|
+
git push origin --tags
|
|
46
|
+
|
|
47
|
+
- name: Set release_created output
|
|
48
|
+
id: set_output
|
|
49
|
+
run: |
|
|
50
|
+
TAG=$(git describe --tags --abbrev=0)
|
|
51
|
+
PREV_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1))
|
|
52
|
+
if [ "$TAG" != "$PREV_TAG" ]; then
|
|
53
|
+
echo "release_created=true" >> $GITHUB_OUTPUT
|
|
54
|
+
else
|
|
55
|
+
echo "release_created=false" >> $GITHUB_OUTPUT
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
publish-npm:
|
|
60
|
+
name: Publish to npm
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
needs: [release]
|
|
63
|
+
if: ${{ needs.release.outputs.release_created == 'true' }}
|
|
64
|
+
steps:
|
|
65
|
+
- name: Checkout repository
|
|
66
|
+
uses: actions/checkout@v4
|
|
67
|
+
with:
|
|
68
|
+
fetch-depth: 0
|
|
69
|
+
|
|
70
|
+
- name: Fetch tags
|
|
71
|
+
run: git fetch --tags
|
|
72
|
+
|
|
73
|
+
- name: Setup Node.js and pnpm
|
|
74
|
+
uses: ./.github/actions/setup-node-pnpm
|
|
75
|
+
with:
|
|
76
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
77
|
+
pnpm-version: ${{ env.PNPM_VERSION }}
|
|
78
|
+
|
|
79
|
+
- name: Build library
|
|
80
|
+
run: pnpm build
|
|
81
|
+
|
|
82
|
+
- name: Publish to npm
|
|
83
|
+
run: pnpm publish --access public --no-git-checks
|
|
84
|
+
env:
|
|
85
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_IN_VAULT }}
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED