@vixoniccom/modules 2.25.0-dev.2 → 2.25.0-dev.21

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.
@@ -0,0 +1,149 @@
1
+ ---
2
+ description: "Use when: fixing Aikido security issues, resolving security vulnerabilities reported by Aikido or SonarQube, creating fix branches and PRs for security findings, code smells, or bugs. Keywords: aikido, sonarqube, sonar, security, vulnerability, CVE, dependency, fix, PR, pull request, code smell, bug, quality"
3
+ tools: [execute, read, edit, search, web, todo]
4
+ ---
5
+
6
+ You are **Aikido Fixer**, a security and code quality remediation agent specialized in fixing issues reported by [Aikido Security](https://app.aikido.dev) and [SonarQube](https://sonarcloud.io). Your job is to automate the full lifecycle: branch creation → fix → commit → push → PR creation.
7
+
8
+ ## SonarQube Configuration
9
+
10
+ - **Project Key**: `Vixonic_server-ruffo_AZYWwtBvmhwfQKlMBTIv`
11
+ - **API Token**: Available via the environment variable `$SONAR_TOKEN_API`
12
+ - **API Base URL**: `https://sonarcloud.io/api`
13
+
14
+ ### Fetching SonarQube Issues
15
+
16
+ Use the SonarQube Web API to list open issues:
17
+
18
+ ```bash
19
+ # List all open issues (bugs, vulnerabilities, code smells)
20
+ curl -s -u "$SONAR_TOKEN_API:" \
21
+ "https://sonarcloud.io/api/issues/search?componentKeys=Vixonic_server-ruffo_AZYWwtBvmhwfQKlMBTIv&statuses=OPEN,CONFIRMED,REOPENED&ps=100" \
22
+ | jq '.issues[] | {key, type, severity, message, component, line}'
23
+
24
+ # Filter by type (BUG, VULNERABILITY, CODE_SMELL)
25
+ curl -s -u "$SONAR_TOKEN_API:" \
26
+ "https://sonarcloud.io/api/issues/search?componentKeys=Vixonic_server-ruffo_AZYWwtBvmhwfQKlMBTIv&statuses=OPEN,CONFIRMED,REOPENED&types=VULNERABILITY&ps=100" \
27
+ | jq '.issues[] | {key, type, severity, message, component, line}'
28
+
29
+ # Filter by severity (BLOCKER, CRITICAL, MAJOR, MINOR, INFO)
30
+ curl -s -u "$SONAR_TOKEN_API:" \
31
+ "https://sonarcloud.io/api/issues/search?componentKeys=Vixonic_server-ruffo_AZYWwtBvmhwfQKlMBTIv&statuses=OPEN,CONFIRMED,REOPENED&severities=CRITICAL,BLOCKER&ps=100" \
32
+ | jq '.issues[] | {key, type, severity, message, component, line}'
33
+ ```
34
+
35
+ ## Workflow
36
+
37
+ Follow these steps in order:
38
+
39
+ ### 1. Gather context
40
+ - Ask the user for the issue(s) to fix. They may provide:
41
+ - A list of vulnerability or code quality descriptions
42
+ - Aikido issue URLs/IDs or SonarQube issue keys
43
+ - A general request like "fix all critical Aikido issues" or "fix SonarQube vulnerabilities"
44
+ - If the user provides a URL to Aikido, use the `web` tool to fetch details about the vulnerability.
45
+ - If the user asks about SonarQube issues, use the API commands above to fetch the issue list, then read the affected files to understand the context.
46
+
47
+ ### 2. Prepare the branch
48
+ ```bash
49
+ # Switch to any other branch first to allow deleting development
50
+ git checkout main 2>/dev/null || git checkout master 2>/dev/null || true
51
+
52
+ # Delete local development branch to avoid rebase conflicts
53
+ git branch -D development 2>/dev/null || true
54
+
55
+ # Fetch latest and recreate development from origin
56
+ git fetch origin
57
+ git checkout -b development origin/development
58
+
59
+ # Create the fix branch
60
+ git checkout -b fix/aikido-<short-description>
61
+ ```
62
+ - **Important**: Always delete and recreate the local `development` branch from `origin/development` to avoid rebase divergence issues.
63
+ - Use a short, descriptive kebab-case name for `<short-description>` based on the vulnerability (e.g., `fix/aikido-prototype-pollution`, `fix/aikido-xss-sanitize`, `fix/aikido-dep-update`).
64
+ - If fixing multiple unrelated issues, create **separate branches and PRs** for each.
65
+
66
+ ### 3. Diagnose and fix
67
+ - Read the relevant source files or `package.json` to understand the issue.
68
+ - Common fix types:
69
+ - **Dependency vulnerabilities**: Update the affected package in `package.json` and run `npm install` or `npm audit fix`.
70
+ - **Code vulnerabilities** (XSS, injection, prototype pollution, etc.): Edit the source code to apply the fix.
71
+ - **Configuration issues**: Update config files (e.g., Dockerfile, webpack, tsconfig).
72
+ - Always verify the fix compiles/lints correctly by running the project's build or lint command.
73
+
74
+ ### 4. Commit and push
75
+ ```bash
76
+ git add -A
77
+ git commit -m "fix(security): <concise description of the fix>
78
+
79
+ Resolves Aikido issue: <issue reference if available>"
80
+ git push origin fix/aikido-<short-description>
81
+ ```
82
+ - Use conventional commit format: `fix(security): <description>`
83
+ - Include Aikido issue reference in the commit body when available.
84
+
85
+ ### 5. Create the Pull Request
86
+ ```bash
87
+ gh pr create \
88
+ --base development \
89
+ --title "fix(security): <concise description>" \
90
+ --body "## Security Fix
91
+
92
+ **Aikido Issue**: <reference or description>
93
+
94
+ ### Changes
95
+ - <bullet points of what was changed>
96
+
97
+ ### Verification
98
+ - [ ] Build passes
99
+ - [ ] No new vulnerabilities introduced
100
+ - [ ] Aikido issue should be resolved after merge"
101
+ ```
102
+
103
+ ### 6. Wait for CI pipelines and validate
104
+ After creating the PR, monitor the pipeline status. This repo has two relevant checks:
105
+ - **Webpack Ruffo-notifications Build** (runs on all branches)
106
+ - **Sonarqube Analysis** (runs on PRs to `development`)
107
+
108
+ ```bash
109
+ # Wait for checks to complete (timeout 10 minutes)
110
+ gh pr checks <PR_NUMBER> --watch --interval 30 --fail-fast
111
+ ```
112
+
113
+ - If the checks **pass**: inform the user that the PR is ready for review.
114
+ - If the checks **fail**:
115
+ 1. Fetch the failed check logs:
116
+ ```bash
117
+ gh run list --branch fix/aikido-<short-description> --limit 5
118
+ gh run view <RUN_ID> --log-failed
119
+ ```
120
+ 2. Diagnose the failure and attempt to fix it.
121
+ 3. Commit the fix, push, and re-monitor the checks.
122
+ 4. If after 2 attempts the checks still fail, report the failure details to the user and ask for guidance.
123
+
124
+ ### 7. Report back
125
+ Provide a summary to the user:
126
+ - Branch name
127
+ - What was fixed and how
128
+ - PR URL
129
+ - CI pipeline status (passed/failed with details)
130
+ - Any remaining issues that couldn't be auto-fixed
131
+
132
+ ## Constraints
133
+ - DO NOT modify files unrelated to the security fix.
134
+ - DO NOT force push or use `--no-verify`.
135
+ - DO NOT merge the PR — only create it.
136
+ - DO NOT commit secrets, tokens, or credentials.
137
+ - ALWAYS create the branch from `development`, never from `main` or any other branch.
138
+ - ALWAYS verify the fix compiles before committing.
139
+ - If unsure about a fix, explain the options to the user and ask before proceeding.
140
+
141
+ ## Output Format
142
+ After completing the workflow, return a structured summary:
143
+
144
+ ```
145
+ ✅ Branch: fix/aikido-<name>
146
+ ✅ Fix: <what was done>
147
+ ✅ PR: <URL>
148
+ ⚠️ Notes: <any caveats or manual steps needed>
149
+ ```
@@ -0,0 +1,133 @@
1
+ name: Deploy job
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ types: [closed]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ build:
12
+ name: Build and Publish Package
13
+ runs-on: ubuntu-latest
14
+ environment: production
15
+ if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
16
+
17
+ outputs:
18
+ version: ${{ steps.extract_version.outputs.version }}
19
+ deployment-start: ${{ steps.deployment_start.outputs.deployment_start }}
20
+
21
+ steps:
22
+ - name: Log deployment start
23
+ id: deployment_start
24
+ run: |
25
+ echo "deployment_start=$(date +"%Y-%m-%dT%H:%M:%S%:z")" >> "$GITHUB_OUTPUT"
26
+
27
+ - name: Checkout repository
28
+ uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0
31
+ token: ${{ secrets.PRIVATE_TOKEN_GITHUB }}
32
+
33
+ - name: Setup Node.js 20
34
+ uses: actions/setup-node@v4
35
+ with:
36
+ node-version: '20'
37
+ registry-url: 'https://registry.npmjs.org'
38
+ scope: '@vixoniccom'
39
+
40
+ - name: Configure npm authentication
41
+ env:
42
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43
+ run: |
44
+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
45
+ echo "@vixoniccom:registry=https://registry.npmjs.org/" >> ~/.npmrc
46
+ echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
47
+
48
+ - name: Cache node modules
49
+ uses: actions/cache@v4
50
+ with:
51
+ path: ~/.npm
52
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
53
+ restore-keys: |
54
+ ${{ runner.os }}-node-
55
+
56
+ - name: Install dependencies
57
+ run: npm ci --ignore-scripts
58
+ env:
59
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
60
+
61
+ - name: Bump version
62
+ run: |
63
+ git config user.name "github-actions[bot]"
64
+ git config user.email "github-actions[bot]@users.noreply.github.com"
65
+ npm run release -- --no-verify
66
+ git push --follow-tags origin main
67
+ env:
68
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
69
+
70
+ - name: Extract changelog for this release
71
+ id: changelog
72
+ run: |
73
+ BODY=$(awk '/^## \[/{if(p) exit; p=1} p' CHANGELOG.md)
74
+ echo "body<<EOF" >> $GITHUB_OUTPUT
75
+ echo "$BODY" >> $GITHUB_OUTPUT
76
+ echo "EOF" >> $GITHUB_OUTPUT
77
+
78
+ - name: Extract version from package.json
79
+ id: extract_version
80
+ run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
81
+
82
+ - name: Build package
83
+ run: npm run prepublish
84
+ env:
85
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
86
+
87
+ - name: Verify build.zip exists
88
+ run: |
89
+ if [ ! -f "build.zip" ]; then
90
+ echo "❌ Error: build.zip not found after build process"
91
+ exit 1
92
+ fi
93
+ echo "✅ build.zip found successfully"
94
+ ls -la build.zip
95
+
96
+ - name: Publish to npm
97
+ run: npm publish --access public
98
+ env:
99
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
100
+
101
+ - name: Create GitHub Release
102
+ uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
103
+ with:
104
+ tag_name: v${{ steps.extract_version.outputs.version }}
105
+ name: v${{ steps.extract_version.outputs.version }}
106
+ body: ${{ steps.changelog.outputs.body }}
107
+ files: build.zip
108
+ env:
109
+ GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN_GITHUB }}
110
+
111
+ report-ep:
112
+ name: Report EP Metrics
113
+ runs-on: ubuntu-latest
114
+ needs: [build]
115
+ if: always()
116
+
117
+ steps:
118
+ - uses: actions/checkout@v4
119
+ with:
120
+ fetch-depth: 0
121
+ token: ${{ secrets.PRIVATE_TOKEN_GITHUB }}
122
+
123
+ - uses: vismagroup/Jira-SDOP-Reporter@v1 # NOSONAR - internal Visma action
124
+ with:
125
+ token: ${{ github.token }}
126
+ deployment-start: ${{ needs.build.outputs.deployment-start }}
127
+ deployment-status: ${{ needs.build.result == 'success' && 'success' || 'failure' }}
128
+ jira-token: ${{ secrets.JIRA_TOKEN }}
129
+ jira-issue-summary: "store-modules release v${{ needs.build.outputs.version }}"
130
+ jira-issue-project: "SDOP"
131
+ jira-issue-components: |
132
+ ${{ secrets.EP_JIRA_COMPONENT }}
133
+ jira-issue-build-info: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
@@ -17,13 +17,13 @@ jobs:
17
17
  fetch-depth: 0
18
18
 
19
19
  - name: SonarQube Scan
20
- uses: sonarsource/sonarqube-scan-action@master
20
+ uses: sonarsource/sonarqube-scan-action@f099b441665cb71b0414100cfaf6d835492cee5f # master
21
21
  env:
22
22
  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
23
23
  SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
24
24
 
25
25
  - name: SonarQube Quality Gate Check
26
- uses: sonarsource/sonarqube-quality-gate-action@master
26
+ uses: sonarsource/sonarqube-quality-gate-action@cb3ed20f9fec62b4c3b8ad9e77656c6adaade913 # master
27
27
  timeout-minutes: 5
28
28
  env:
29
29
  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -2,6 +2,84 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.25.0-dev.21](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.20...v2.25.0-dev.21) (2026-06-22)
6
+
7
+ ## [2.25.0-dev.20](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.20) (2026-06-22)
8
+
9
+
10
+ ### Features
11
+
12
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
13
+
14
+ ## [2.25.0-dev.19](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.19) (2026-06-22)
15
+
16
+
17
+ ### Features
18
+
19
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
20
+
21
+ ## [2.25.0-dev.18](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.18) (2026-06-22)
22
+
23
+
24
+ ### Features
25
+
26
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
27
+
28
+ ## [2.25.0-dev.17](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.17) (2026-06-22)
29
+
30
+
31
+ ### Features
32
+
33
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
34
+
35
+ ## [2.25.0-dev.16](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.16) (2026-06-22)
36
+
37
+
38
+ ### Features
39
+
40
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
41
+
42
+ ## [2.25.0-dev.15](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.15) (2026-06-22)
43
+
44
+
45
+ ### Features
46
+
47
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
48
+
49
+ ## [2.25.0-dev.14](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.14) (2026-06-22)
50
+
51
+
52
+ ### Features
53
+
54
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
55
+
56
+ ## [2.25.0-dev.13](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.13) (2026-06-22)
57
+
58
+
59
+ ### Features
60
+
61
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
62
+
63
+ ## [2.25.0-dev.12](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.12) (2026-06-22)
64
+
65
+
66
+ ### Features
67
+
68
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
69
+
70
+ ## [2.25.0-dev.11](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.3...v2.25.0-dev.11) (2026-06-22)
71
+
72
+
73
+ ### Features
74
+
75
+ * VXD-898 add new service ([d6bd32b](https://github.com/Vixonic/store-modules/commit/d6bd32b7b326bc02f5248778d1d97063d9e4c2c8))
76
+
77
+ ## [2.25.0-dev.10](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.2...v2.25.0-dev.10) (2026-04-01)
78
+
79
+ ## [2.25.0-dev.9](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.2...v2.25.0-dev.9) (2026-04-01)
80
+
81
+ ## [2.25.0-dev.3](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.2...v2.25.0-dev.3) (2026-04-01)
82
+
5
83
  ## [2.25.0-dev.2](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.1...v2.25.0-dev.2) (2026-03-03)
6
84
 
7
85
  ## [2.25.0-dev.1](https://github.com/Vixonic/store-modules/compare/v2.25.0-dev.0...v2.25.0-dev.1) (2026-03-03)
package/dist/lib/index.js CHANGED
@@ -79,9 +79,17 @@ var Configuration = /** @class */ (function () {
79
79
  var jsEval = this.durationFormula;
80
80
  try {
81
81
  var regexp = new RegExp('{{(.*?)}}', 'ig');
82
- jsEval = jsEval.replace(regexp, "_values.$1");
83
- // tslint:disable-next-line
84
- var time = eval(jsEval);
82
+ jsEval = jsEval.replace(regexp, function (_match, field) {
83
+ var val = _values[field.trim()];
84
+ return (typeof val === 'number' && Number.isFinite(val)) ? String(val) : '0';
85
+ });
86
+ // Only allow digits, arithmetic operators, spaces, parentheses and decimal points
87
+ if (!/^[.\d\s+\-*/%()]+$/.test(jsEval)) {
88
+ console.warn('Computed time error: Invalid characters in time expression:', jsEval);
89
+ return undefined;
90
+ }
91
+ // Input is validated above against an arithmetic-only allowlist before reaching this call. // NOSONAR
92
+ var time = new Function("return (".concat(jsEval, ");"))(); // NOSONAR
85
93
  if (typeof time === 'number') {
86
94
  // validate number
87
95
  if (isNaN(time) || time < 4 || time >= 86400) {
@@ -1,6 +1,6 @@
1
1
  import { Input, IInput } from '../base';
2
2
  import { ValueError } from '../errors';
3
- export type ServiceType = 'RSSService' | 'InstagramMediaService' | 'LinkedInCompanyMediaService' | 'FacebookPageService' | 'WeatherService' | 'VixonicStoriesService' | 'TwitterService' | 'TimezoneService' | 'NewTimezoneService' | 'ColabraService' | 'RexmasBirthdayService' | 'RexmasAnniversarieService' | 'RexmasNewEmployeesService' | 'TikTokService' | 'BukBirthdayService' | 'BukAnniversariesService' | 'BukNewEmployeesService' | 'AgendaAppService' | 'AnniversaryAppService' | 'BirthdayAppService' | 'NewEmployeesAppService' | 'CurrencyAppService' | 'SheetsReaderService' | 'TalanaAnniversariesService' | 'TalanaBirthdayService' | 'TalanaNewEmployeesService' | 'YoutubeService';
3
+ export type ServiceType = 'RSSService' | 'InstagramMediaService' | 'LinkedInCompanyMediaService' | 'FacebookPageService' | 'WeatherService' | 'VixonicStoriesService' | 'TwitterService' | 'TimezoneService' | 'NewTimezoneService' | 'ColabraService' | 'RexmasBirthdayService' | 'RexmasAnniversarieService' | 'RexmasNewEmployeesService' | 'TikTokService' | 'BukBirthdayService' | 'BukAnniversariesService' | 'BukNewEmployeesService' | 'AgendaAppService' | 'AnniversaryAppService' | 'BirthdayAppService' | 'NewEmployeesAppService' | 'CurrencyAppService' | 'SheetsReaderService' | 'TalanaAnniversariesService' | 'TalanaBirthdayService' | 'TalanaNewEmployeesService' | 'YoutubeService' | 'LocalAppSheetsService' | 'MetalAppService' | 'FootballService';
4
4
  export interface IServiceInput extends IInput {
5
5
  serviceType: ServiceType;
6
6
  required?: boolean;
@@ -7,9 +7,24 @@ function shouldBeVisible(item, _values) {
7
7
  var jsEval = item.show;
8
8
  try {
9
9
  var regexp = new RegExp('{{(.*?)}}', 'ig');
10
- jsEval = jsEval.replace(regexp, "_values.$1");
11
- // tslint:disable-next-line
12
- var show = new Function('_values', "return ".concat(jsEval, ";"))(_values);
10
+ jsEval = jsEval.replace(regexp, function (_match, field) {
11
+ var val = _values[field.trim()];
12
+ if (val === null || val === undefined)
13
+ return 'null';
14
+ if (typeof val === 'number' || typeof val === 'boolean')
15
+ return String(val);
16
+ if (typeof val === 'string')
17
+ return JSON.stringify(val);
18
+ return JSON.stringify(val);
19
+ });
20
+ // Only allow safe characters: digits, strings (quotes), comparison/logical/arithmetic operators,
21
+ // spaces, parentheses, brackets, dots, commas and alphanumeric identifiers (true/false/null).
22
+ if (!/^[\w\s"'!<>=&|+\-*/%().,[\]?:]+$/.test(jsEval)) {
23
+ console.warn('Unable to parse expression (unsafe characters):', jsEval);
24
+ return true;
25
+ }
26
+ // Input is validated above against a strict character allowlist before reaching this call. // NOSONAR
27
+ var show = new Function("return (".concat(jsEval, ");"))(); // NOSONAR
13
28
  return !!show;
14
29
  }
15
30
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vixoniccom/modules",
3
- "version": "2.25.0-dev.2",
3
+ "version": "2.25.0-dev.21",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,91 +0,0 @@
1
- name: Publish to NPM
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- - main
8
- pull_request:
9
- branches:
10
- - master
11
- - main
12
- types: [closed]
13
-
14
- jobs:
15
- publish:
16
- # Solo ejecutar si es un push a main/master o un merge a main/master
17
- if: github.event_name == 'push' || (github.event.pull_request.merged == true && (github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main'))
18
- runs-on: ubuntu-latest
19
-
20
- steps:
21
- - name: Checkout code
22
- uses: actions/checkout@v4
23
- with:
24
- fetch-depth: 0
25
-
26
- - name: Setup Node.js 20
27
- uses: actions/setup-node@v4
28
- with:
29
- node-version: '20'
30
- registry-url: 'https://registry.npmjs.org'
31
- scope: '@vixoniccom'
32
-
33
- - name: Configure npm authentication
34
- run: |
35
- echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
36
- echo "@vixoniccom:registry=https://registry.npmjs.org/" >> ~/.npmrc
37
- echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
38
-
39
- - name: Cache node modules
40
- uses: actions/cache@v3
41
- with:
42
- path: ~/.npm
43
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
44
- restore-keys: |
45
- ${{ runner.os }}-node-
46
-
47
- - name: Install dependencies
48
- run: npm ci
49
- env:
50
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
51
-
52
- - name: Build package
53
- run: npm run prepublish
54
-
55
- - name: Check if version already exists on npm
56
- id: check-version
57
- run: |
58
- PACKAGE_NAME=$(node -p "require('./package.json').name")
59
- PACKAGE_VERSION=$(node -p "require('./package.json').version")
60
-
61
- echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION exists on npm..."
62
-
63
- if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
64
- echo "version-exists=true" >> $GITHUB_OUTPUT
65
- echo "⚠️ Version $PACKAGE_VERSION already exists on npm"
66
- else
67
- echo "version-exists=false" >> $GITHUB_OUTPUT
68
- echo "✅ Version $PACKAGE_VERSION does not exist on npm - ready to publish"
69
- fi
70
-
71
- - name: Publish to npm
72
- if: steps.check-version.outputs.version-exists == 'false'
73
- run: |
74
- echo "Publishing to npm..."
75
- npm publish --access public
76
- env:
77
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
78
-
79
- - name: Publication success
80
- if: steps.check-version.outputs.version-exists == 'false'
81
- run: |
82
- PACKAGE_NAME=$(node -p "require('./package.json').name")
83
- PACKAGE_VERSION=$(node -p "require('./package.json').version")
84
- echo "🎉 Successfully published $PACKAGE_NAME@$PACKAGE_VERSION to npm!"
85
-
86
- - name: Skip publication
87
- if: steps.check-version.outputs.version-exists == 'true'
88
- run: |
89
- PACKAGE_VERSION=$(node -p "require('./package.json').version")
90
- echo "⏭️ Skipping publication - version $PACKAGE_VERSION already exists on npm"
91
- echo "💡 To publish a new version, update the version in package.json or run 'npm run release'"