@camera.ui/cli 0.0.26 → 0.0.27
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/dist/constants.js +2 -2
- package/dist/index.js +0 -0
- package/dist/utils/versions.js +2 -2
- package/dist/utils/versions.js.map +1 -1
- package/package.json +5 -3
- package/scripts/chmod.js +17 -0
package/dist/constants.js
CHANGED
|
@@ -12,8 +12,8 @@ export async function getNodeLtsVersion() {
|
|
|
12
12
|
}
|
|
13
13
|
export async function getCameraUiLtsVersion() {
|
|
14
14
|
try {
|
|
15
|
-
const
|
|
16
|
-
return
|
|
15
|
+
const cameraui = await getLatestCameraUiVersion();
|
|
16
|
+
return cameraui.latest;
|
|
17
17
|
}
|
|
18
18
|
catch {
|
|
19
19
|
return CAMERA_UI_LTS;
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/utils/versions.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { APP_SERVER_NAME } from '@camera.ui/common/utils';
|
|
1
2
|
import { exec } from 'node:child_process';
|
|
2
3
|
import https from 'node:https';
|
|
3
4
|
import { promisify } from 'node:util';
|
|
4
5
|
const execAsync = promisify(exec);
|
|
5
|
-
const APP_NAME = 'camera.ui3';
|
|
6
6
|
export function getLatestNodeLTSVersion() {
|
|
7
7
|
return new Promise((resolve, reject) => {
|
|
8
8
|
https
|
|
@@ -32,7 +32,7 @@ export function getLatestNodeLTSVersion() {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
export async function getLatestCameraUiVersion() {
|
|
35
|
-
const { stdout } = await execAsync(`npm view ${
|
|
35
|
+
const { stdout } = await execAsync(`npm view ${APP_SERVER_NAME} dist-tags --json`);
|
|
36
36
|
const info = JSON.parse(stdout);
|
|
37
37
|
return info;
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/utils/versions.ts"],"names":[],"mappings":"AAA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AC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBAEjI,OAAO,CAAC;wBACN,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;wBACxC,GAAG,EAAE,SAAS,CAAC,GAAG;wBAClB,WAAW,EAAE,SAAS,CAAC,IAAI;qBAC5B,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;aACD,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACrB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,YAAY,eAAe,mBAAmB,CAAC,CAAC;IACnF,MAAM,IAAI,GAAwB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "camera.ui cli",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "rimraf dist && tsc",
|
|
17
|
+
"build": "rimraf dist && tsc && node ./scripts/chmod.js",
|
|
18
18
|
"format": "prettier --write 'src/' --ignore-unknown --no-error-on-unmatched-pattern",
|
|
19
|
-
"lint": "eslint
|
|
19
|
+
"lint": "eslint .",
|
|
20
|
+
"lint:fix": "eslint --fix .",
|
|
20
21
|
"update": "updates --update ./",
|
|
21
22
|
"install-updates": "npm i --save",
|
|
22
23
|
"prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build"
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"@babel/plugin-transform-typescript": "^7.25.9",
|
|
27
28
|
"@babel/preset-env": "^7.26.0",
|
|
28
29
|
"@babel/preset-typescript": "^7.26.0",
|
|
30
|
+
"@camera.ui/common": "^0.0.26",
|
|
29
31
|
"adm-zip": "^0.5.16",
|
|
30
32
|
"babel-loader": "^9.2.1",
|
|
31
33
|
"chalk": "^5.3.0",
|
package/scripts/chmod.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { platform } from 'node:os';
|
|
3
|
+
import { dirname, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const isWindows = platform() === 'win32';
|
|
10
|
+
|
|
11
|
+
function chmod() {
|
|
12
|
+
const scriptPath = resolve(__dirname, '../dist/index.js');
|
|
13
|
+
const arg = isWindows ? 'echo "Skipping chmod command on Windows"' : `chmod +x ${scriptPath}`;
|
|
14
|
+
execSync(arg, { stdio: 'inherit' });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
chmod();
|