@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.
@@ -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
+ });
@@ -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);
@@ -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 = process.env.NODE_ENV === "local";
59
+ export const isLocalTest = vi.stubEnv("NODE_ENV", "local");
60
60
 
61
61
  // Test application class
62
62
  export class TestApp extends CoreApp<
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2020",
4
- "module": "ESNext",
5
- "moduleResolution": "Node10",
4
+ "module": "ES2020",
5
+ "moduleResolution": "bundler",
6
6
  "allowJs": false,
7
- "skipLibCheck": true,
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
  }
@@ -201,7 +201,7 @@
201
201
  "statusDeleted": "Deleted",
202
202
  "statusDoing": "Doing",
203
203
  "statusFlaged": "Flaged",
204
- "statusNormal": "Normla",
204
+ "statusNormal": "Normal",
205
205
  "statusInactivated": "Inactivated",
206
206
  "submit": "Submit",
207
207
  "success": "Success",
@@ -94,7 +94,7 @@
94
94
  "keywords": "关键词",
95
95
  "loading": "正在加载...",
96
96
  "login": "登录",
97
- "logo": "标志",
97
+ "logo": "图标",
98
98
  "me": "我",
99
99
  "menuHome": "首页",
100
100
  "message": "留言",
@@ -94,7 +94,7 @@
94
94
  "keywords": "關鍵詞",
95
95
  "loading": "正在加載...",
96
96
  "login": "登錄",
97
- "logo": "標誌",
97
+ "logo": "圖標",
98
98
  "me": "我",
99
99
  "menuHome": "首頁",
100
100
  "message": "留言",
@@ -201,7 +201,7 @@
201
201
  "statusDeleted": "Deleted",
202
202
  "statusDoing": "Doing",
203
203
  "statusFlaged": "Flaged",
204
- "statusNormal": "Normla",
204
+ "statusNormal": "Normal",
205
205
  "statusInactivated": "Inactivated",
206
206
  "submit": "Submit",
207
207
  "success": "Success",
@@ -94,7 +94,7 @@
94
94
  "keywords": "关键词",
95
95
  "loading": "正在加载...",
96
96
  "login": "登录",
97
- "logo": "标志",
97
+ "logo": "图标",
98
98
  "me": "我",
99
99
  "menuHome": "首页",
100
100
  "message": "留言",
@@ -94,7 +94,7 @@
94
94
  "keywords": "關鍵詞",
95
95
  "loading": "正在加載...",
96
96
  "login": "登錄",
97
- "logo": "標誌",
97
+ "logo": "圖標",
98
98
  "me": "我",
99
99
  "menuHome": "首頁",
100
100
  "message": "留言",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.87",
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
- "format": "prettier --write src/**/*.ts",
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": "Garry Xiao",
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.54",
59
- "@etsoo/restclient": "^1.1.17",
60
- "@etsoo/shared": "^1.2.55",
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
- "@types/jest": "^29.5.14",
71
- "jest": "^29.7.0",
72
- "jest-environment-jsdom": "^29.7.0",
73
- "ts-jest": "^29.2.5",
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
@@ -201,7 +201,7 @@
201
201
  "statusDeleted": "Deleted",
202
202
  "statusDoing": "Doing",
203
203
  "statusFlaged": "Flaged",
204
- "statusNormal": "Normla",
204
+ "statusNormal": "Normal",
205
205
  "statusInactivated": "Inactivated",
206
206
  "submit": "Submit",
207
207
  "success": "Success",
@@ -94,7 +94,7 @@
94
94
  "keywords": "关键词",
95
95
  "loading": "正在加载...",
96
96
  "login": "登录",
97
- "logo": "标志",
97
+ "logo": "图标",
98
98
  "me": "我",
99
99
  "menuHome": "首页",
100
100
  "message": "留言",
@@ -94,7 +94,7 @@
94
94
  "keywords": "關鍵詞",
95
95
  "loading": "正在加載...",
96
96
  "login": "登錄",
97
- "logo": "標誌",
97
+ "logo": "圖標",
98
98
  "me": "我",
99
99
  "menuHome": "首頁",
100
100
  "message": "留言",
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": "ESNext",
7
- "moduleResolution": "Node10",
6
+ "module": "ES2020",
7
+ "moduleResolution": "bundler",
8
8
  "resolveJsonModule": true,
9
9
  "isolatedModules": true,
10
10
  "outDir": "./lib/mjs",
@@ -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
+ });