@posx/core 5.5.320 → 5.5.321

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posx/core",
3
- "version": "5.5.320",
3
+ "version": "5.5.321",
4
4
  "description": "POSX core libraries",
5
5
  "main": "build/index.js",
6
6
  "author": "Steven Lee",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posx/core",
3
- "version": "5.5.320",
3
+ "version": "5.5.321",
4
4
  "description": "POSX core libraries",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -23,7 +23,7 @@
23
23
  "test": "jest",
24
24
  "test:watch": "jest --watch",
25
25
  "publish": "node ./scripts/publish.cjs",
26
- "p": "npm test && npm run up:p && npm run build && npm run post:build && npm run publish && rm -rf build",
26
+ "p": "pnpm i && npm test && npm run up:p && npm run build && npm run post:build && npm run publish && rm -rf build",
27
27
  "debug": "npm run build && npm run post:build",
28
28
  "coverage": "jest --coverage",
29
29
  "trypublish": "npm publish || true",
@@ -58,6 +58,7 @@
58
58
  "@typescript-eslint/eslint-plugin": "^4.33.0",
59
59
  "@typescript-eslint/parser": "^4.33.0",
60
60
  "@vitest/coverage-v8": "^2.1.0",
61
+ "ajv": "8.17.1",
61
62
  "aws-sdk": "2.1550.0",
62
63
  "colors": "1.4.0",
63
64
  "eslint": "^7.32.0",
@@ -71,9 +72,10 @@
71
72
  "sqlite3": "5.1.6",
72
73
  "terser": "^5.36.0",
73
74
  "ts-jest": "29.4.5",
74
- "typedoc": "0.25.3",
75
+ "typedoc": "^0.26.0",
75
76
  "typescript": "^5.6.3",
76
77
  "vite": "^5.4.11",
78
+ "vite-plugin-bundle-obfuscator": "1.8.0",
77
79
  "vite-plugin-dts": "^4.3.0",
78
80
  "vitest": "^2.1.0"
79
81
  },
@@ -103,6 +105,12 @@
103
105
  "zod": "3.23.8"
104
106
  },
105
107
  "peerDependencies": {
106
- "@litepos/autoquery": "^5.0.6"
108
+ "@litepos/autoquery": "^5.0.6",
109
+ "rxjs": "^7.0.0"
110
+ },
111
+ "peerDependenciesMeta": {
112
+ "rxjs": {
113
+ "optional": true
114
+ }
107
115
  }
108
116
  }
package/vite.config.ts CHANGED
@@ -1,6 +1,19 @@
1
- import { defineConfig } from 'vite'
1
+ import { defineConfig, Plugin } from 'vite'
2
2
  import { resolve } from 'path'
3
3
  import dts from 'vite-plugin-dts'
4
+ import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'
5
+ import { getBanner } from './scripts/getBanner.mjs'
6
+
7
+ const bannerPlugin = (): Plugin => ({
8
+ name: 'banner-plugin',
9
+ generateBundle(_, bundle) {
10
+ for (const chunk of Object.values(bundle)) {
11
+ if (chunk.type === 'chunk' && chunk.fileName === 'index.js') {
12
+ chunk.code = getBanner() + '\n' + chunk.code
13
+ }
14
+ }
15
+ },
16
+ })
4
17
 
5
18
  export default defineConfig({
6
19
  plugins: [
@@ -8,8 +21,32 @@ export default defineConfig({
8
21
  outDir: 'build',
9
22
  insertTypesEntry: true,
10
23
  rollupTypes: true,
24
+ include: ['src/**/*.ts'],
11
25
  exclude: ['src/test/**', 'src/tests/**', '**/*.test.ts', '**/*.spec.ts'],
12
26
  }),
27
+ bannerPlugin(),
28
+ vitePluginBundleObfuscator({
29
+ enable: true,
30
+ log: false,
31
+ autoExcludeNodeModules: true,
32
+ threadPool: { enable: true, size: 4 },
33
+ options: {
34
+ compact: true,
35
+ controlFlowFlattening: false,
36
+ deadCodeInjection: false,
37
+ debugProtection: false,
38
+ identifierNamesGenerator: 'hexadecimal',
39
+ renameGlobals: false,
40
+ selfDefending: false,
41
+ simplify: true,
42
+ stringArray: true,
43
+ stringArrayRotate: true,
44
+ stringArrayShuffle: true,
45
+ stringArrayIndexShift: true,
46
+ stringArrayThreshold: 0.6,
47
+ unicodeEscapeSequence: false,
48
+ },
49
+ }),
13
50
  ],
14
51
  build: {
15
52
  outDir: 'build',
@@ -20,7 +57,10 @@ export default defineConfig({
20
57
  fileName: () => 'index.js',
21
58
  },
22
59
  rollupOptions: {
23
- external: ['@litepos/autoquery'],
60
+ external: [
61
+ '@litepos/autoquery',
62
+ 'rxjs',
63
+ ],
24
64
  output: {
25
65
  preserveModules: false,
26
66
  },
@@ -29,9 +69,18 @@ export default defineConfig({
29
69
  minify: 'terser',
30
70
  terserOptions: {
31
71
  compress: {
32
- drop_console: true,
72
+ drop_console: false,
73
+ drop_debugger: true,
74
+ passes: 2,
75
+ },
76
+ mangle: true,
77
+ format: {
78
+ comments: false,
79
+ beautify: false,
80
+ semicolons: true,
33
81
  },
34
82
  },
83
+ cssMinify: true,
35
84
  },
36
85
  resolve: {
37
86
  alias: {
package/vite.config.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
package/vitest.config.ts DELETED
@@ -1,21 +0,0 @@
1
- import { defineConfig } from 'vitest/config'
2
-
3
- export default defineConfig({
4
- test: {
5
- globals: true,
6
- environment: 'jsdom',
7
- setupFiles: ['./src/test/setup.ts'],
8
- coverage: {
9
- provider: 'v8',
10
- reporter: ['text', 'json', 'html'],
11
- },
12
- },
13
- resolve: {
14
- alias: {
15
- buffer: 'buffer/',
16
- crypto: 'crypto-browserify',
17
- stream: 'stream-browserify',
18
- vm: 'vm-browserify',
19
- },
20
- },
21
- })