grexx-api 13.15.3 → 13.15.4
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/generated/core/OpenAPI.js +1 -1
- package/package.json +2 -2
- package/publish.ts +28 -0
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OpenAPI = void 0;
|
|
4
4
|
exports.OpenAPI = {
|
|
5
5
|
BASE: 'https://name.grexx.today/api/v1',
|
|
6
|
-
VERSION: '13.15.
|
|
6
|
+
VERSION: '13.15.4',
|
|
7
7
|
WITH_CREDENTIALS: false,
|
|
8
8
|
CREDENTIALS: 'include',
|
|
9
9
|
TOKEN: undefined,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grexx-api",
|
|
3
|
-
"version": "13.15.
|
|
3
|
+
"version": "13.15.4",
|
|
4
4
|
"description": "Grexx Platform API library",
|
|
5
5
|
"main": "dist/generated/index.js",
|
|
6
6
|
"types": "dist/generated/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"generate": "ts-node ./generate-spec-for-version.ts && npx openapi-typescript-codegen --input openapi-spec.yaml --output ./src/generated",
|
|
10
10
|
"docs": "typedoc",
|
|
11
|
-
"build-and-publish": "npm run generate && npm run build &&
|
|
11
|
+
"build-and-publish": "npm run generate && npm run build && ts-node ./publish.ts"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"openapi-typescript-codegen": "^0.29.0",
|
package/publish.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { execFileSync } from 'child_process';
|
|
3
|
+
|
|
4
|
+
const { name, version } = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf8'));
|
|
5
|
+
|
|
6
|
+
const parse = (v: string) => v.split('.').map(Number);
|
|
7
|
+
|
|
8
|
+
const isLower = (a: string, b: string) => {
|
|
9
|
+
const [x, y] = [parse(a), parse(b)];
|
|
10
|
+
const i = x.findIndex((part, index) => part !== y[index]);
|
|
11
|
+
return i !== -1 && x[i] < y[i];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const latestVersion = () => {
|
|
15
|
+
try {
|
|
16
|
+
return execFileSync('npm', ['view', name, 'dist-tags.latest'], { encoding: 'utf8' }).trim();
|
|
17
|
+
} catch {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const latest = latestVersion();
|
|
23
|
+
const [major, minor] = parse(version);
|
|
24
|
+
//== A hotfix on an older release must not move "latest" back, so it gets its own dist-tag
|
|
25
|
+
const tag = latest && isLower(version, latest) ? `release-${major}.${minor}` : 'latest';
|
|
26
|
+
|
|
27
|
+
console.log(`Publishing ${name}@${version} with tag "${tag}" (latest is ${latest ?? 'unknown'})`);
|
|
28
|
+
execFileSync('npm', ['publish', '--tag', tag], { stdio: 'inherit' });
|