Skip to content

Commit 71d06d3

Browse files
trying to fix the version check
1 parent 2fd576a commit 71d06d3

2 files changed

Lines changed: 265 additions & 27 deletions

File tree

.github/workflows/npm-version-check.yml

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,36 @@ name: "NPM Version Check"
33
on: pull_request
44

55
jobs:
6-
push_to_registry:
7-
name: "NPM Version Check"
8-
runs-on: ubuntu-latest
6+
push_to_registry:
7+
name: "NPM Version Check"
8+
runs-on: ubuntu-latest
99

10-
steps:
11-
- name: "Check out the repo"
12-
uses: actions/checkout@v4
10+
steps:
11+
- name: "Check out the repo"
12+
uses: actions/checkout@v4
1313

14-
- name: "Set up Node"
15-
uses: actions/setup-node@v4
16-
with:
17-
registry-url: "https://registry.npmjs.org"
18-
node-version: "lts/*"
19-
check-latest: true
14+
- name: "Set up Node"
15+
uses: actions/setup-node@v4
16+
with:
17+
registry-url: "https://registry.npmjs.org"
18+
node-version: 20
19+
check-latest: true
2020

21-
- name: "Check if version is published"
22-
run: |
23-
PACKAGE_VERSION=$(npm pkg get version --workspaces=false | tr -d \")
24-
PACKAGE_NAME=$(npm pkg get name --workspaces=false | tr -d \")
25-
# Run npm view and capture the exit code (success or failure)
26-
npm view "$PACKAGE_NAME@$PACKAGE_VERSION" --json > result.json 2>&1 || true
27-
# Check the exit code to determine if the version exists
28-
if grep -q "is not in this registry." result.json; then
29-
echo "Version $PACKAGE_VERSION does not exist for $PACKAGE_NAME on npmjs.com. 🎉"
30-
exit 0
31-
else
32-
echo "Version $PACKAGE_VERSION already exists for $PACKAGE_NAME on npmjs.com. 😬🫠"
33-
echo "Please update the 'version' property in package.json and try again."
34-
exit 1
35-
fi
21+
- name: "Check if version is published"
22+
run: |
23+
PACKAGE_VERSION=$(npm pkg get version --workspaces=false | tr -d \")
24+
PACKAGE_NAME=$(npm pkg get name --workspaces=false | tr -d \")
25+
# Run npm view and capture the exit code (success or failure)
26+
npm view "$PACKAGE_NAME@$PACKAGE_VERSION" --json > result.json 2>&1 || true
27+
28+
cat result.json
29+
30+
# Check the exit code to determine if the version exists
31+
if grep -q "is not in this registry." result.json; then
32+
echo "Version $PACKAGE_VERSION does not exist for $PACKAGE_NAME on npmjs.com. 🎉"
33+
exit 0
34+
else
35+
echo "Version $PACKAGE_VERSION already exists for $PACKAGE_NAME on npmjs.com. 😬🫠"
36+
echo "Please update the 'version' property in package.json and try again."
37+
exit 1
38+
fi

result.json

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
{
2+
"_id": "@mxenabled/react-native-widget-sdk@1.1.4",
3+
"_rev": "42-d61fb9881d1c131c74e74439b7990df9",
4+
"name": "@mxenabled/react-native-widget-sdk",
5+
"dist-tags": {
6+
"latest": "1.1.4"
7+
},
8+
"versions": [
9+
"1.0.0",
10+
"1.0.1",
11+
"1.0.2",
12+
"1.0.3",
13+
"1.0.4",
14+
"1.0.6",
15+
"1.0.7",
16+
"1.0.8",
17+
"1.0.9",
18+
"1.1.0",
19+
"1.1.1",
20+
"1.1.2",
21+
"1.1.3",
22+
"1.1.4"
23+
],
24+
"time": {
25+
"created": "2022-02-21T21:53:45.459Z",
26+
"modified": "2025-04-22T19:17:43.528Z",
27+
"1.0.0": "2022-02-21T21:53:46.073Z",
28+
"1.0.1": "2022-03-03T17:30:06.747Z",
29+
"1.0.2": "2022-03-03T19:41:18.236Z",
30+
"1.0.3": "2022-03-03T20:34:35.611Z",
31+
"1.0.4": "2022-03-08T21:52:00.906Z",
32+
"1.0.6": "2022-05-23T17:25:16.554Z",
33+
"1.0.7": "2022-06-09T17:43:21.372Z",
34+
"1.0.8": "2022-06-10T20:28:56.551Z",
35+
"1.0.9": "2022-09-20T17:32:27.652Z",
36+
"1.1.0": "2022-10-14T21:49:37.261Z",
37+
"1.1.1": "2022-12-06T18:57:11.005Z",
38+
"1.1.2": "2023-11-08T22:36:28.130Z",
39+
"1.1.3": "2024-10-07T17:39:44.649Z",
40+
"1.1.4": "2024-10-28T21:46:48.900Z"
41+
},
42+
"bugs": {
43+
"url": "https://github.com/mxenabled/react-native-widget-sdk/issues"
44+
},
45+
"license": "MIT",
46+
"homepage": "https://github.com/mxenabled/react-native-widget-sdk#readme",
47+
"repository": {
48+
"url": "git+https://github.com/mxenabled/react-native-widget-sdk.git",
49+
"type": "git"
50+
},
51+
"description": "MX React Native Widget SDK",
52+
"maintainers": [
53+
"ashley.wright <ashley.wright@mx.com>",
54+
"jameson13 <sprout-goshawk.0g@icloud.com>",
55+
"jamesonmx <jameson.brown@mx.com>",
56+
"mwclemy <mwimoclement@gmail.com>",
57+
"mxdevexperience <devexperience@mx.com>",
58+
"emilysallstrom <emily.sallstrom@mx.com>",
59+
"jgerlach <j.scottgerlach@live.com>",
60+
"william.bridegroom <william.bridegroom@mx.com>",
61+
"jgarrow <janessa.garrow@gmail.com>",
62+
"shalyn.huetter <shalynhuetter@gmail.com>",
63+
"drewwarren <drewwarrentiy@gmail.com>",
64+
"sskousen <seth.skousen@mx.com>",
65+
"blueeagle500 <collin.ballou@mx.com>",
66+
"craigtingey <tingeycraig@gmail.com>",
67+
"jsfowles <js.fowles@gmail.com>",
68+
"inphomercial <inphomercial@gmail.com>",
69+
"marabd <behlesdean@gmail.com>",
70+
"minond <minond.marcos@gmail.com>",
71+
"wolzey <ethanwolz@icloud.com>",
72+
"whiteinge <seth@eseth.com>",
73+
"cerinman <tommy.dugger@mx.com>",
74+
"sambev <sam.bev87@gmail.com>",
75+
"jrexdavis <josh.davis@mx.com>",
76+
"nathan.nash <nathan.nash@mx.com>",
77+
"thechirinos <cristian.chirinos@mx.com>"
78+
],
79+
"readmeFilename": "README.md",
80+
"_contentLength": 76346,
81+
"version": "1.1.4",
82+
"bin": {
83+
"mx-widget-sdk-setup": "dist/src/cli/setup.js"
84+
},
85+
"dist": {
86+
"shasum": "d4be6abbf14fe64b5e6a0fcb5bfc710b1b625201",
87+
"tarball": "https://registry.npmjs.org/@mxenabled/react-native-widget-sdk/-/react-native-widget-sdk-1.1.4.tgz",
88+
"fileCount": 53,
89+
"integrity": "sha512-Fcw5NytNmLucgq+TFrgNO2Tj0rSTrdaACLFXL8r+3HpCg89CrrC7jtH72eoraLnlAvnh8SYIW1xux/YrZjmioQ==",
90+
"signatures": [
91+
{
92+
"sig": "MEUCIQCYC8ye/kItJqdyn2zBCcmGQIy7abzSP8qzqJH+GQdMFgIgPT42iQhQK88RMnKepUdBcPQe1KrtSbEjTIL40orNmcE=",
93+
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
94+
}
95+
],
96+
"unpackedSize": 42510
97+
},
98+
"jest": {
99+
"preset": "react-native",
100+
"testRegex": [
101+
"_test\\.[jt]sx?$"
102+
],
103+
"setupFiles": [
104+
"./test/setup.ts"
105+
],
106+
"setupFilesAfterEnv": [
107+
"./test/mocks/setup.ts",
108+
"./test/mocks/react_native_webview.ts"
109+
],
110+
"collectCoverageFrom": [
111+
"src/**/**"
112+
],
113+
"testPathIgnorePatterns": [
114+
"<rootDir>/node_modules",
115+
"<rootDir>/dist",
116+
"<rootDir>/build",
117+
"<rootDir>/example"
118+
],
119+
"transformIgnorePatterns": [
120+
"node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)"
121+
]
122+
},
123+
"main": "dist/src/index.js",
124+
"types": "./dist/src/index.d.ts",
125+
"source": "src/index.ts",
126+
"gitHead": "7f3158576a6f600111d0ab5739b1b009f7f11857",
127+
"scripts": {
128+
"lint": "eslint src test",
129+
"test": "jest --verbose --coverage",
130+
"build": "npm run clean && npm run compile && npm run documentation",
131+
"clean": "[ -d dist ] && rm -r dist || true",
132+
"format": "npm run prettier -- -w",
133+
"compile": "npm run compile:version && npm run compile:sdk",
134+
"prepack": "npm run build",
135+
"prettier": "prettier src test example/App.tsx",
136+
"spellcheck": "cspell $(git ls-files)",
137+
"compile:sdk": "tsc --declaration --noEmit false --outDir dist",
138+
"example:ios": "cd example && npm run ios",
139+
"documentation": "cp node_modules/@mxenabled/widget-post-message-definitions/docs/react-native-sdk-generated.md docs/widget_callback_props.md",
140+
"example:start": "cd example && npm start",
141+
"example:server": "mx-sso-api-proxy run",
142+
"compile:version": "ts-node bin/generate-version-file.ts",
143+
"example:android": "cd example && npm run android",
144+
"example:install": "bin/install-example-application-dependencies"
145+
},
146+
"_npmUser": "mwclemy <mwimoclement@gmail.com>",
147+
"prettier": {
148+
"semi": false,
149+
"printWidth": 100,
150+
"singleQuote": false,
151+
"trailingComma": "all",
152+
"bracketSpacing": true,
153+
"bracketSameLine": true
154+
},
155+
"_npmVersion": "10.8.2",
156+
"directories": {},
157+
"_nodeVersion": "20.17.0",
158+
"dependencies": {
159+
"url": "^0.11.0",
160+
"react-native-base64": "^0.2.1",
161+
"@mxenabled/widget-post-message-definitions": "^1.4.0"
162+
},
163+
"eslintConfig": {
164+
"root": true,
165+
"rules": {
166+
"semi": [
167+
"error",
168+
"never"
169+
],
170+
"quotes": [
171+
"error",
172+
"double"
173+
],
174+
"no-trailing-spaces": "error",
175+
"react-hooks/exhaustive-deps": "off",
176+
"@typescript-eslint/no-unused-vars": [
177+
"error",
178+
{
179+
"argsIgnorePattern": "^_",
180+
"varsIgnorePattern": "^_"
181+
}
182+
],
183+
"@typescript-eslint/no-var-requires": 0
184+
},
185+
"parser": "@typescript-eslint/parser",
186+
"extends": [
187+
"eslint:recommended",
188+
"plugin:@typescript-eslint/recommended",
189+
"plugin:react-hooks/recommended"
190+
],
191+
"plugins": [
192+
"@typescript-eslint"
193+
]
194+
},
195+
"_hasShrinkwrap": false,
196+
"devDependencies": {
197+
"msw": "^0.36.8",
198+
"jest": "^29.6.3",
199+
"react": "^18.3.1",
200+
"cspell": "^6.1.1",
201+
"eslint": "^8.19.0",
202+
"ts-node": "^10.4.0",
203+
"prettier": "^2.8.8",
204+
"babel-jest": "^29.6.3",
205+
"node-fetch": "^2.6.7",
206+
"typescript": "^4.5.5",
207+
"uri-scheme": "^1.0.112",
208+
"@babel/core": "^7.20.0",
209+
"@types/jest": "^27.4.0",
210+
"@types/react": "^18.3.9",
211+
"react-native": "^0.75.3",
212+
"@types/node-fetch": "^2.5.12",
213+
"@types/react-native": "^0.70.19",
214+
"react-native-base64": "^0.2.1",
215+
"react-test-renderer": "^18.3.1",
216+
"react-native-webview": "^13.12.2",
217+
"@babel/preset-typescript": "^7.16.7",
218+
"@mxenabled/sso-api-proxy": "^1.3.3",
219+
"@typescript-eslint/parser": "^5.11.0",
220+
"eslint-plugin-react-hooks": "^4.3.0",
221+
"@react-native/babel-preset": "^0.75.3",
222+
"@types/react-native-base64": "^0.2.0",
223+
"@types/react-test-renderer": "^18.3.0",
224+
"@testing-library/react-native": "^9.0.0",
225+
"@typescript-eslint/eslint-plugin": "^5.11.0"
226+
},
227+
"peerDependencies": {
228+
"react": "*",
229+
"react-native": "*"
230+
},
231+
"_npmOperationalInternal": {
232+
"tmp": "tmp/react-native-widget-sdk_1.1.4_1730152008743_0.4908551313171401",
233+
"host": "s3://npm-registry-packages"
234+
}
235+
}

0 commit comments

Comments
 (0)