@vixoniccom/footbal-score 1.4.0-dev.3 → 1.4.0-dev.5

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,112 @@
1
+ name: Publish to NPM
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - main
8
+ - dalvayay/cd-con-variables-env
9
+ pull_request:
10
+ branches:
11
+ - master
12
+ - main
13
+ types: [closed]
14
+
15
+ jobs:
16
+ publish:
17
+ # Solo ejecutar si es un push a main/master o un merge a main/master
18
+ 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'))
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - name: Checkout code
23
+ uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 0
26
+
27
+ - name: Setup Node.js 20
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: '20'
31
+ registry-url: 'https://registry.npmjs.org'
32
+ scope: '@vixoniccom'
33
+
34
+ - name: Configure npm authentication
35
+ run: |
36
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
37
+ echo "@vixoniccom:registry=https://registry.npmjs.org/" >> ~/.npmrc
38
+ echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
39
+
40
+ - name: Cache node modules
41
+ uses: actions/cache@v4
42
+ with:
43
+ path: ~/.npm
44
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
45
+ restore-keys: |
46
+ ${{ runner.os }}-node-
47
+
48
+ - name: Install dependencies
49
+ run: npm ci
50
+ env:
51
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52
+
53
+ - name: Build package
54
+ run: npm run prepublish
55
+ env:
56
+ FOOTBALL_API_KEY: ${{ secrets.FOOTBALL_API_KEY }}
57
+ FOOTBALL_API_HOST: ${{ secrets.FOOTBALL_API_HOST }}
58
+ FOOTBALL_API_URL: ${{ secrets.FOOTBALL_API_URL }}
59
+ RESULTS_FLAG_IMG: ${{ secrets.RESULTS_FLAG_IMG }}
60
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61
+
62
+ - name: Verify build.zip exists
63
+ run: |
64
+ if [ ! -f "build.zip" ]; then
65
+ echo "❌ Error: build.zip not found after build process"
66
+ exit 1
67
+ fi
68
+ echo "✅ build.zip found successfully"
69
+ ls -la build.zip
70
+
71
+ - name: Check if version already exists on npm
72
+ id: check-version
73
+ run: |
74
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
75
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
76
+
77
+ echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION exists on npm..."
78
+
79
+ if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
80
+ echo "version-exists=true" >> $GITHUB_OUTPUT
81
+ echo "⚠️ Version $PACKAGE_VERSION already exists on npm"
82
+ else
83
+ echo "version-exists=false" >> $GITHUB_OUTPUT
84
+ echo "✅ Version $PACKAGE_VERSION does not exist on npm - ready to publish"
85
+ fi
86
+
87
+ - name: Publish to npm
88
+ if: steps.check-version.outputs.version-exists == 'false'
89
+ run: |
90
+ echo "Publishing to npm..."
91
+ npm publish --access public
92
+ env:
93
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
94
+ FOOTBALL_API_KEY: ${{ secrets.FOOTBALL_API_KEY }}
95
+ FOOTBALL_API_HOST: ${{ secrets.FOOTBALL_API_HOST }}
96
+ FOOTBALL_API_URL: ${{ secrets.FOOTBALL_API_URL }}
97
+ RESULTS_FLAG_IMG: ${{ secrets.RESULTS_FLAG_IMG }}
98
+
99
+ - name: Publication success
100
+ if: steps.check-version.outputs.version-exists == 'false'
101
+ run: |
102
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
103
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
104
+ echo "🎉 Successfully published $PACKAGE_NAME@$PACKAGE_VERSION to npm!"
105
+ echo "📦 Package includes build.zip with the compiled application"
106
+
107
+ - name: Skip publication
108
+ if: steps.check-version.outputs.version-exists == 'true'
109
+ run: |
110
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
111
+ echo "⏭️ Skipping publication - version $PACKAGE_VERSION already exists on npm"
112
+ echo "💡 To publish a new version, update the version in package.json or run 'npm run release'"
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
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
+ ## [1.4.0-dev.5](https://github.com/Vixonic/store-football-score/compare/v1.4.0-dev.4...v1.4.0-dev.5) (2025-08-21)
6
+
7
+
8
+ ### Features
9
+
10
+ * add cd action ([eeec0c3](https://github.com/Vixonic/store-football-score/commit/eeec0c3845b0e47fe807a2323d157fbe3d9ad8eb))
11
+
12
+ ## [1.4.0-dev.4](https://github.com/Vixonic/store-football-score/compare/v1.4.0-dev.3...v1.4.0-dev.4) (2025-08-21)
13
+
5
14
  ## [1.4.0-dev.3](https://github.com/Vixonic/store-football-score/compare/v1.4.0-dev.2...v1.4.0-dev.3) (2025-08-19)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@vixoniccom/footbal-score",
3
3
  "alias": "Resultados Deportivos",
4
- "version": "1.4.0-dev.3",
4
+ "version": "1.4.0-dev.5",
5
5
  "description": "Muestra resultados en vivo de fútbol.",
6
6
  "main": "main.js",
7
7
  "author": "",
8
8
  "license": "ISC",
9
9
  "scripts": {
10
- "prepublishOnly": "vixonic-module-packager --mode=build",
10
+ "prepublish": "vixonic-module-packager --mode=build",
11
11
  "watch": "vixonic-module-packager --mode=watch",
12
12
  "run": "vixonic-module-packager --mode=run",
13
13
  "configuration": "vixonic-module-packager --mode generate-configuration",
@@ -10,9 +10,12 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000
10
10
 
11
11
  export const getFixture = async (league: string, yesterday?: boolean, tomorrow?: boolean) => {
12
12
  const today = moment().format('YYYY-MM-DD')
13
- const year = moment().format('YYYY')
14
- const from = yesterday ? moment(Date.now() - MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
15
- const to = tomorrow ? moment(Date.now() + MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
13
+ let year = moment().format('YYYY')
14
+ year = '2023'
15
+ let from = yesterday ? moment(Date.now() - MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
16
+ from = '2023-12-05'
17
+ let to = tomorrow ? moment(Date.now() + MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
18
+ to = '2023-12-10'
16
19
  const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
17
20
 
18
21
  const options = {
package/build/index.html DELETED
@@ -1 +0,0 @@
1
- <!doctype html><html lang="en" style="position:absolute;height:100%;width:100%;overflow:hidden"><head><title></title><meta charset="utf-8"/></head><body style="margin:0;overflow:hidden"><div id="root" style="position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden"></div><script src="./main.js"></script></body></html>