@vixoniccom/modules 2.20.5-dev.1 → 2.21.0
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,91 @@
|
|
|
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'"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Sonarqube Analysis
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- development
|
|
7
|
+
pull_request:
|
|
8
|
+
types: [opened, synchronize, reopened]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
sonarqube:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
# Disabling shallow clone is recommended for improving relevancy of reporting.
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: SonarQube Scan
|
|
20
|
+
uses: sonarsource/sonarqube-scan-action@master
|
|
21
|
+
env:
|
|
22
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
23
|
+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
|
24
|
+
|
|
25
|
+
- name: SonarQube Quality Gate Check
|
|
26
|
+
uses: sonarsource/sonarqube-quality-gate-action@master
|
|
27
|
+
timeout-minutes: 5
|
|
28
|
+
env:
|
|
29
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
30
|
+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.21.0](https://github.com/Vixonic/store-modules/compare/v2.20.5-dev.1...v2.21.0) (2025-08-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* sonarqube and CI/CD was added ([a7599b4](https://github.com/Vixonic/store-modules/commit/a7599b46eb480599889689cc6141c2e5a40db9f2))
|
|
11
|
+
|
|
5
12
|
### [2.20.5-dev.1](https://github.com/Vixonic/store-modules/compare/v2.20.4...v2.20.5-dev.1) (2025-07-24)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixoniccom/modules",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
8
|
+
"prepublish": "npm run build",
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"release": "standard-version",
|
|
11
11
|
"prerelease-dev": "standard-version --prerelease dev",
|
|
12
|
-
"prerelease-4dev": "standard-version --prerelease 4dev",
|
|
13
12
|
"prerelease-rc": "standard-version --prerelease rc",
|
|
14
13
|
"test": "ts-node ./test/index.ts"
|
|
15
14
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sonar.projectKey=Vixonic_store-modules_8c0f27ff-d91c-49be-96ba-bcc0d569b697
|