@giteeteam/apps-manifest 0.3.0 → 0.4.1
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/lib/schema/all.json +3 -0
- package/lib/schema/dependVersion.json +6 -0
- package/lib/schema/locales.json +0 -6
- package/lib/types.d.ts +4 -1
- package/lib/validate.d.ts +7 -0
- package/lib/validate.js +4 -1
- package/package.json +4 -3
package/lib/schema/all.json
CHANGED
package/lib/schema/locales.json
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -65,14 +65,17 @@ export type TManifestModules = {
|
|
|
65
65
|
customFieldType?: IManifestCustomFieldType[];
|
|
66
66
|
customItemType?: any[];
|
|
67
67
|
};
|
|
68
|
-
export type
|
|
68
|
+
export type TDependProduct = 'team' | 'one';
|
|
69
|
+
export type TManifestLanguage = 'en-US' | 'zh-CN' | 'ru-RU';
|
|
69
70
|
export type TManifestLocalesItem = Record<string, string>;
|
|
70
71
|
export type TManifestLocalesItems = Record<string, TManifestLocalesItem>;
|
|
71
72
|
export type TManifestLocales = Record<TManifestLanguage, TManifestLocalesItems>;
|
|
73
|
+
export type TDependVersion = Record<TDependProduct, string[]>;
|
|
72
74
|
export interface IManifest {
|
|
73
75
|
app: IManifestApp;
|
|
74
76
|
modules: TManifestModules;
|
|
75
77
|
tables?: any;
|
|
76
78
|
resources?: IManifestResource[];
|
|
77
79
|
locales?: TManifestLocales;
|
|
80
|
+
dependVersion?: TDependVersion;
|
|
78
81
|
}
|
package/lib/validate.d.ts
CHANGED
|
@@ -44,3 +44,10 @@ export declare const validateLocales: (json: IManifest) => {
|
|
|
44
44
|
message: string | undefined;
|
|
45
45
|
}[] | null;
|
|
46
46
|
};
|
|
47
|
+
export declare const validateDependVersion: (json: IManifest) => {
|
|
48
|
+
pass: boolean | Promise<unknown> | undefined;
|
|
49
|
+
errors: {
|
|
50
|
+
path: string;
|
|
51
|
+
message: string | undefined;
|
|
52
|
+
}[] | null;
|
|
53
|
+
};
|
package/lib/validate.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateLocales = exports.validateTables = exports.validateResources = exports.validateModules = exports.validateApp = exports.validateAll = void 0;
|
|
6
|
+
exports.validateDependVersion = exports.validateLocales = exports.validateTables = exports.validateResources = exports.validateModules = exports.validateApp = exports.validateAll = void 0;
|
|
7
7
|
const ajv_1 = __importDefault(require("ajv"));
|
|
8
8
|
const ajv_keywords_1 = __importDefault(require("ajv-keywords"));
|
|
9
9
|
const lodash_1 = require("lodash");
|
|
@@ -19,6 +19,7 @@ const type_json_1 = __importDefault(require("./schema/modules/custom-field/type.
|
|
|
19
19
|
const resources_json_1 = __importDefault(require("./schema/resources.json"));
|
|
20
20
|
const tables_json_1 = __importDefault(require("./schema/tables.json"));
|
|
21
21
|
const locales_json_1 = __importDefault(require("./schema/locales.json"));
|
|
22
|
+
const dependVersion_json_1 = __importDefault(require("./schema/dependVersion.json"));
|
|
22
23
|
const validateResource = (json) => {
|
|
23
24
|
const errors = [];
|
|
24
25
|
const frontendModules = ['adminPage', 'itemPanel', 'itemActivity', 'appPage'];
|
|
@@ -93,6 +94,7 @@ const validateFactory = (schema) => {
|
|
|
93
94
|
resources_json_1.default,
|
|
94
95
|
tables_json_1.default,
|
|
95
96
|
locales_json_1.default,
|
|
97
|
+
dependVersion_json_1.default,
|
|
96
98
|
],
|
|
97
99
|
});
|
|
98
100
|
(0, ajv_keywords_1.default)(ajv);
|
|
@@ -125,3 +127,4 @@ exports.validateModules = validateFactory('http://proxima.com/schemas/modules/in
|
|
|
125
127
|
exports.validateResources = validateFactory('http://proxima.com/schemas/resources.json');
|
|
126
128
|
exports.validateTables = validateFactory('http://proxima.com/schemas/tables.json');
|
|
127
129
|
exports.validateLocales = validateFactory('http://proxima.com/schemas/locales.json');
|
|
130
|
+
exports.validateDependVersion = validateFactory('http://proxima.com/schemas/dependVersion.json');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giteeteam/apps-manifest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Giteeteam Apps Manifest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
"test": "jest --coverage",
|
|
25
25
|
"dev": "tsc -w",
|
|
26
26
|
"build": "rm -rf lib && tsc",
|
|
27
|
-
"prepare": "pnpm
|
|
28
|
-
"
|
|
27
|
+
"prepare": "pnpm build",
|
|
28
|
+
"prepack": "pnpm build",
|
|
29
|
+
"prepublish": "pnpm build"
|
|
29
30
|
},
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"conventionalCommits": true,
|