@etsoo/appscript 1.5.87 → 1.5.89
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/__tests__/api/ApiTests.ts +17 -0
- package/__tests__/app/CoreApp.ts +4 -0
- package/__tests__/app/TestApp.ts +1 -1
- package/__tests__/tsconfig.json +5 -4
- package/lib/cjs/i18n/en.json +1 -1
- package/lib/cjs/i18n/zh-Hans.json +1 -1
- package/lib/cjs/i18n/zh-Hant.json +1 -1
- package/lib/mjs/i18n/en.json +1 -1
- package/lib/mjs/i18n/zh-Hans.json +1 -1
- package/lib/mjs/i18n/zh-Hant.json +1 -1
- package/package.json +10 -31
- package/src/i18n/en.json +1 -1
- package/src/i18n/zh-Hans.json +1 -1
- package/src/i18n/zh-Hant.json +1 -1
- package/tsconfig.json +2 -2
- package/vite.config.mts +12 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UpdateModel } from "../../src";
|
|
2
|
+
|
|
3
|
+
test("Tests for UpdateModel", () => {
|
|
4
|
+
interface Entity extends UpdateModel {
|
|
5
|
+
name: string;
|
|
6
|
+
age: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const data: Entity = {
|
|
10
|
+
id: 1,
|
|
11
|
+
name: "Tom",
|
|
12
|
+
age: 20,
|
|
13
|
+
changedFields: ["name", "age"]
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
expect(data.id).toBe(1);
|
|
17
|
+
});
|
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -48,6 +48,8 @@ test("Tests for encrypt / decrypt", async () => {
|
|
|
48
48
|
const input = "Hello, world!";
|
|
49
49
|
const passphrase = "My password";
|
|
50
50
|
|
|
51
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
52
|
+
|
|
51
53
|
// Act
|
|
52
54
|
const encrypted = app.encrypt(input, passphrase);
|
|
53
55
|
const plain = app.decrypt(encrypted, passphrase);
|
|
@@ -59,6 +61,8 @@ test("Tests for encryptEnhanced / decryptEnhanced", async () => {
|
|
|
59
61
|
const input = "Hello, world!";
|
|
60
62
|
const passphrase = "My password";
|
|
61
63
|
|
|
64
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
65
|
+
|
|
62
66
|
// Act
|
|
63
67
|
const encrypted = app.encryptEnhanced(input, passphrase);
|
|
64
68
|
const plain = app.decryptEnhanced(encrypted, passphrase);
|
package/__tests__/app/TestApp.ts
CHANGED
|
@@ -56,7 +56,7 @@ var container = new NotificationContainerTest((update) => {});
|
|
|
56
56
|
|
|
57
57
|
// Is local test (integration test)
|
|
58
58
|
// Make sure your local environment is ready
|
|
59
|
-
export const isLocalTest =
|
|
59
|
+
export const isLocalTest = vi.stubEnv("NODE_ENV", "local");
|
|
60
60
|
|
|
61
61
|
// Test application class
|
|
62
62
|
export class TestApp extends CoreApp<
|
package/__tests__/tsconfig.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2020",
|
|
4
|
-
"module": "
|
|
5
|
-
"moduleResolution": "
|
|
4
|
+
"module": "ES2020",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
6
|
"allowJs": false,
|
|
7
|
-
"skipLibCheck":
|
|
7
|
+
"skipLibCheck": false,
|
|
8
8
|
"esModuleInterop": true,
|
|
9
9
|
"allowSyntheticDefaultImports": true,
|
|
10
10
|
"strict": true,
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"resolveJsonModule": true,
|
|
13
13
|
"isolatedModules": true,
|
|
14
14
|
"noEmit": true,
|
|
15
|
-
"declaration": true
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"types": ["vitest/globals"]
|
|
16
17
|
},
|
|
17
18
|
"include": [".."]
|
|
18
19
|
}
|
package/lib/cjs/i18n/en.json
CHANGED
package/lib/mjs/i18n/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.89",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -13,27 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
|
|
16
|
-
"
|
|
17
|
-
"lint": "eslint --ext .ts src/",
|
|
18
|
-
"test": "jest",
|
|
19
|
-
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand"
|
|
20
|
-
},
|
|
21
|
-
"jest": {
|
|
22
|
-
"automock": false,
|
|
23
|
-
"testMatch": [
|
|
24
|
-
"<rootDir>/__tests__/**/*.ts"
|
|
25
|
-
],
|
|
26
|
-
"testPathIgnorePatterns": [
|
|
27
|
-
"<rootDir>/__tests__/app/TestApp.ts"
|
|
28
|
-
],
|
|
29
|
-
"testEnvironment": "jsdom",
|
|
30
|
-
"transform": {
|
|
31
|
-
".+\\.jsx?$": "babel-jest",
|
|
32
|
-
".+\\.tsx?$": "ts-jest"
|
|
33
|
-
},
|
|
34
|
-
"transformIgnorePatterns": [
|
|
35
|
-
"/node_modules/(?!@etsoo/).+\\.js$"
|
|
36
|
-
]
|
|
16
|
+
"test": "vitest"
|
|
37
17
|
},
|
|
38
18
|
"repository": {
|
|
39
19
|
"type": "git",
|
|
@@ -48,16 +28,16 @@
|
|
|
48
28
|
"青岛亿速思维",
|
|
49
29
|
"上海亿商"
|
|
50
30
|
],
|
|
51
|
-
"author": "
|
|
31
|
+
"author": "ETSOO",
|
|
52
32
|
"license": "MIT",
|
|
53
33
|
"bugs": {
|
|
54
34
|
"url": "https://github.com/ETSOO/AppScript/issues"
|
|
55
35
|
},
|
|
56
36
|
"homepage": "https://github.com/ETSOO/AppScript#readme",
|
|
57
37
|
"dependencies": {
|
|
58
|
-
"@etsoo/notificationbase": "^1.1.
|
|
59
|
-
"@etsoo/restclient": "^1.1.
|
|
60
|
-
"@etsoo/shared": "^1.2.
|
|
38
|
+
"@etsoo/notificationbase": "^1.1.55",
|
|
39
|
+
"@etsoo/restclient": "^1.1.18",
|
|
40
|
+
"@etsoo/shared": "^1.2.58",
|
|
61
41
|
"crypto-js": "^4.2.0"
|
|
62
42
|
},
|
|
63
43
|
"devDependencies": {
|
|
@@ -67,10 +47,9 @@
|
|
|
67
47
|
"@babel/preset-env": "^7.26.0",
|
|
68
48
|
"@babel/runtime-corejs3": "^7.26.0",
|
|
69
49
|
"@types/crypto-js": "^4.2.2",
|
|
70
|
-
"@
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"typescript": "^5.7.3"
|
|
50
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
51
|
+
"jsdom": "^26.0.0",
|
|
52
|
+
"typescript": "^5.7.3",
|
|
53
|
+
"vitest": "^2.1.8"
|
|
75
54
|
}
|
|
76
55
|
}
|
package/src/i18n/en.json
CHANGED
package/src/i18n/zh-Hans.json
CHANGED
package/src/i18n/zh-Hant.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
4
|
"target": "ES2020",
|
|
5
5
|
"allowJs": false,
|
|
6
|
-
"module": "
|
|
7
|
-
"moduleResolution": "
|
|
6
|
+
"module": "ES2020",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
8
|
"resolveJsonModule": true,
|
|
9
9
|
"isolatedModules": true,
|
|
10
10
|
"outDir": "./lib/mjs",
|
package/vite.config.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [react()],
|
|
6
|
+
test: {
|
|
7
|
+
globals: true,
|
|
8
|
+
environment: "jsdom",
|
|
9
|
+
include: ["__tests__/**/*.ts(x)?"],
|
|
10
|
+
exclude: ["__tests__/app/TestApp.ts"]
|
|
11
|
+
}
|
|
12
|
+
});
|