@vixoniccom/aqi 0.0.2 → 0.0.3-dev.2
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/workflows/main.yml +131 -0
- package/CHANGELOG.md +6 -0
- package/build/main.js +1 -1
- package/build.zip +0 -0
- package/configuration/appeareanceGroup/AppeareanceInputs.ts +10 -2
- package/configuration.json +19 -0
- package/package.json +3 -3
- package/sonar-project.properties +2 -1
- package/src/App.tsx +2 -1
- package/src/components/Card.tsx +2 -1
- package/src/parameters.d.ts +1 -0
- package/.github/workflows/npm-publish.yml +0 -105
package/build.zip
CHANGED
|
Binary file
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { Label, NumberInput, SelectAssetKna, TextFormat, TextInput } from '@vixoniccom/modules'
|
|
1
|
+
import { Label, NumberInput, SelectAssetKna, SelectInput, TextFormat, TextInput } from '@vixoniccom/modules'
|
|
2
2
|
|
|
3
3
|
export const appeareanceInputs = [
|
|
4
4
|
new Label({ label: 'General' }),
|
|
5
5
|
new SelectAssetKna({ id: 'backgroundImage', label: 'Fondo', required: false, extensions: ['jpg', 'png'] }),
|
|
6
|
-
|
|
6
|
+
new Label({ label: 'Posición' }),
|
|
7
|
+
new SelectInput({
|
|
8
|
+
id: 'positionCard',
|
|
9
|
+
label: 'Tipo de posición',
|
|
10
|
+
items: [
|
|
11
|
+
{ label: 'Horizontal', value: 'horizontal' },
|
|
12
|
+
{ label: 'Vertical', value: 'vertical' },
|
|
13
|
+
],
|
|
14
|
+
}),
|
|
7
15
|
new Label({ label: 'Diseño de la tarjeta' }),
|
|
8
16
|
new NumberInput({
|
|
9
17
|
id: 'topSeparationCard',
|
package/configuration.json
CHANGED
|
@@ -20,6 +20,25 @@
|
|
|
20
20
|
],
|
|
21
21
|
"multiple": false
|
|
22
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"type": "label",
|
|
25
|
+
"label": "Posición"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "positionCard",
|
|
29
|
+
"label": "Tipo de posición",
|
|
30
|
+
"type": "select-input",
|
|
31
|
+
"items": [
|
|
32
|
+
{
|
|
33
|
+
"value": "horizontal",
|
|
34
|
+
"label": "Horizontal"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"value": "vertical",
|
|
38
|
+
"label": "Vertical"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
23
42
|
{
|
|
24
43
|
"type": "label",
|
|
25
44
|
"label": "Diseño de la tarjeta"
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "Daniel Alvayay"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.0.2",
|
|
11
|
+
"version": "0.0.3-dev.2",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"prepublish": "vixonic-module-packager --mode=build",
|
|
14
14
|
"watch": "vixonic-module-packager --mode=watch",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/react": "^18.3.23",
|
|
30
30
|
"@types/react-dom": "^18.3.7",
|
|
31
|
-
"@vixoniccom/module-packager": "^2.13.0
|
|
32
|
-
"@vixoniccom/modules": "^2.
|
|
31
|
+
"@vixoniccom/module-packager": "^2.13.0",
|
|
32
|
+
"@vixoniccom/modules": "^2.25.0-dev.6",
|
|
33
33
|
"standard-version": "^9.5.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/sonar-project.properties
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
sonar.projectKey=Vixonic_store-air-quality-index_de6b8e55-8f87-4d53-b9d5-7e514a2702d9
|
|
1
|
+
sonar.projectKey=Vixonic_store-air-quality-index_de6b8e55-8f87-4d53-b9d5-7e514a2702d9
|
|
2
|
+
sonar.exclusions=.github/**/*
|
package/src/App.tsx
CHANGED
|
@@ -67,7 +67,8 @@ export const App: React.FunctionComponent<Props> = ({ data, start }) => {
|
|
|
67
67
|
cardGap: parameters?.cardGap,
|
|
68
68
|
aqiFormat: parameters?.aqiFormat,
|
|
69
69
|
stationFormat: parameters?.stationFormat,
|
|
70
|
-
qualityFormat: parameters?.qualityFormat
|
|
70
|
+
qualityFormat: parameters?.qualityFormat,
|
|
71
|
+
positionCard: parameters?.positionCard
|
|
71
72
|
}} />
|
|
72
73
|
</div>
|
|
73
74
|
) : (
|
package/src/components/Card.tsx
CHANGED
|
@@ -13,6 +13,7 @@ interface Props {
|
|
|
13
13
|
aqiFormat?: TextFormat.Value;
|
|
14
14
|
stationFormat?: TextFormat.Value;
|
|
15
15
|
qualityFormat?: TextFormat.Value;
|
|
16
|
+
positionCard?: string;
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -25,7 +26,7 @@ export const Card: React.FunctionComponent<Props> = ({ data, format }) => {
|
|
|
25
26
|
display: 'flex',
|
|
26
27
|
width: `${format.cardWidth || 300}px`,
|
|
27
28
|
height: `${format.cardHeight || 200}px`,
|
|
28
|
-
flexDirection: 'column'
|
|
29
|
+
flexDirection: `${format.positionCard === 'vertical' ? 'column' : 'row'}`,
|
|
29
30
|
backgroundColor: color,
|
|
30
31
|
borderRadius: "10px"
|
|
31
32
|
}}>
|
package/src/parameters.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare type VixonicData = {
|
|
|
6
6
|
|
|
7
7
|
declare type VixonicParameters = Partial<{
|
|
8
8
|
backgroundImage: { id?: string; filename?: string; extension?: string }
|
|
9
|
+
positionCard: 'horizontal' | 'vertical'
|
|
9
10
|
topSeparationCard: number
|
|
10
11
|
leftSeparationCard: number
|
|
11
12
|
cardWidth: number
|
|
@@ -1,105 +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
|
-
env:
|
|
55
|
-
AQI_TOKEN: ${{ secrets.AQI_TOKEN }}
|
|
56
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
57
|
-
|
|
58
|
-
- name: Verify build.zip exists
|
|
59
|
-
run: |
|
|
60
|
-
if [ ! -f "build.zip" ]; then
|
|
61
|
-
echo "❌ Error: build.zip not found after build process"
|
|
62
|
-
exit 1
|
|
63
|
-
fi
|
|
64
|
-
echo "✅ build.zip found successfully"
|
|
65
|
-
ls -la build.zip
|
|
66
|
-
|
|
67
|
-
- name: Check if version already exists on npm
|
|
68
|
-
id: check-version
|
|
69
|
-
run: |
|
|
70
|
-
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
71
|
-
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
72
|
-
|
|
73
|
-
echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION exists on npm..."
|
|
74
|
-
|
|
75
|
-
if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
|
|
76
|
-
echo "version-exists=true" >> $GITHUB_OUTPUT
|
|
77
|
-
echo "⚠️ Version $PACKAGE_VERSION already exists on npm"
|
|
78
|
-
else
|
|
79
|
-
echo "version-exists=false" >> $GITHUB_OUTPUT
|
|
80
|
-
echo "✅ Version $PACKAGE_VERSION does not exist on npm - ready to publish"
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
- name: Publish to npm
|
|
84
|
-
if: steps.check-version.outputs.version-exists == 'false'
|
|
85
|
-
run: |
|
|
86
|
-
echo "Publishing to npm..."
|
|
87
|
-
npm publish --access public
|
|
88
|
-
env:
|
|
89
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
90
|
-
AQI_TOKEN: ${{ secrets.AQI_TOKEN }}
|
|
91
|
-
|
|
92
|
-
- name: Publication success
|
|
93
|
-
if: steps.check-version.outputs.version-exists == 'false'
|
|
94
|
-
run: |
|
|
95
|
-
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
96
|
-
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
97
|
-
echo "🎉 Successfully published $PACKAGE_NAME@$PACKAGE_VERSION to npm!"
|
|
98
|
-
echo "📦 Package includes build.zip with the compiled application"
|
|
99
|
-
|
|
100
|
-
- name: Skip publication
|
|
101
|
-
if: steps.check-version.outputs.version-exists == 'true'
|
|
102
|
-
run: |
|
|
103
|
-
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
104
|
-
echo "⏭️ Skipping publication - version $PACKAGE_VERSION already exists on npm"
|
|
105
|
-
echo "💡 To publish a new version, update the version in package.json or run 'npm run release'"
|