@shijiu/jsview 2.1.200 → 2.1.339-test.0

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.
@@ -5,6 +5,7 @@ import { readFileSync } from 'node:fs';
5
5
  const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)).toString());
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
8
+ 'browser',
8
9
  'module',
9
10
  'jsnext:main',
10
11
  'jsnext',
@@ -80,6 +81,7 @@ const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
80
81
  // looked up by mrmime.
81
82
  const KNOWN_ASSET_TYPES = [
82
83
  // images
84
+ 'apng',
83
85
  'png',
84
86
  'jpe?g',
85
87
  'jfif',
@@ -98,6 +100,8 @@ const KNOWN_ASSET_TYPES = [
98
100
  'wav',
99
101
  'flac',
100
102
  'aac',
103
+ 'opus',
104
+ 'mov',
101
105
  // fonts
102
106
  'woff2?',
103
107
  'eot',
@@ -121,5 +125,7 @@ const wildcardHosts = new Set([
121
125
  '::',
122
126
  '0000:0000:0000:0000:0000:0000:0000:0000',
123
127
  ]);
128
+ const DEFAULT_DEV_PORT = 5173;
129
+ const DEFAULT_PREVIEW_PORT = 4173;
124
130
 
125
- export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
131
+ export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
@@ -17,27 +17,36 @@ const jsviewConfig = defineConfig({
17
17
  'qr.js': true,
18
18
  },
19
19
  emptyOutDir: true,
20
- minify: true,
20
+ minify: false,
21
21
  modulePreload: {
22
22
  polyfill: false
23
23
  },
24
24
  rollupOptions: {
25
25
  output: {
26
- assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css')
27
- ? 'css/[name].[hash].css' : 'assets/[name].[hash].[ext]',
28
- //chunkFileNames: 'js/[name].[hash].js',
26
+ assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css') ? 'css/[name].[hash].css' : 'assets/[name].[hash].[ext]',
29
27
  chunkFileNames: process.env['JSVIEW_KEEP_CHUNKNAME'] ? 'js/[name].[hash].js' : 'js/chunk.jsv.[hash].js',
28
+ // chunkFileNames: 'js/[name].[hash].js',
30
29
  entryFileNames: 'js/main.jsv.[hash].js',
31
30
  format: 'esm',
32
31
  manualChunks: {
33
- 'export-sfc': ['\0plugin-vue:export-helper'], // 将_export_sfc独立出来,防止被集成在jsview-vue中导致import deadloop.
32
+ 'export-sfc': ['\0plugin-vue:export-helper', '@shijiu/jsview-vue/bin/export-sfc.mjs'], // 将_export_sfc独立出来,防止被集成在jsview-vue中导致import deadloop.
34
33
  'vue': ['vue'], // 将vue独立出来,防止被集成在main.js中导致import deadloop.
35
34
  // 将dom-entry和forge-define分割出来,防止被集成在main.js中导致import deadloop.
36
35
  'jsview-forge-define': ['@shijiu/jsview/dom/jsv-forge-define.mjs'],
37
36
  'jsview-dom-entry': ['@shijiu/jsview/dom/index.mjs'],
38
37
  'jsview-vue-entry': ['@shijiu/jsview-vue/index.js'],
38
+ // 'jsview-vue-export-sfc': [], // 将jsview-vue中的export-sfc,防止被集成在jsview-vue-entry中导致import deadloop.
39
39
  },
40
40
  },
41
+ plugins: [
42
+ {
43
+ name: 'remove-bangs',
44
+ renderChunk(code) { return {
45
+ code: code.replace(/^\/\/!/g, '//').replace(/^\/\*!/g, '/*'),
46
+ map: null,
47
+ }},
48
+ },
49
+ ],
41
50
  },
42
51
  sourcemap: true,
43
52
  target: 'es2022', // 不转译async/await
@@ -53,14 +62,12 @@ const jsviewConfig = defineConfig({
53
62
  ],
54
63
  exclude: [
55
64
  '@shijiu/jsview/loader/jsview-main.mjs', // 解决windows上出现解析异常的问题。
65
+ '@shijiu/jsview',
56
66
  '@shijiu/jsview-vue',
57
67
  '@shijiu/jsview-vue-samples',
58
68
  'jsview',
59
69
  'jsview-vue',
60
70
  'jsview-vue-samples',
61
- 'jsview-react-samples',
62
- 'jsview-vue-samples',
63
- 'node_modules/@shijiu',
64
71
  ],
65
72
  },
66
73
  // plugins: [
@@ -143,6 +150,10 @@ function jsvCreateJsViewViteConfig(originConfig) {
143
150
  }
144
151
  jsviewConfig.resolve.alias['jsview'] = aliasJsView;
145
152
 
153
+ if(process.env['JSVIEW_DISABLE_MANUALCHUNKS']) {
154
+ delete jsviewConfig.build.rollupOptions.output.manualChunks
155
+ }
156
+
146
157
  // 解决templete工程中没有mockjs导致的报错。
147
158
  const mockjs = path.resolve(moduleDir, 'mockjs');
148
159
  if(fs.existsSync(mockjs)) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "4.0.0",
3
+ "version": "5.0.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -8,19 +8,34 @@
8
8
  "bin": {
9
9
  "vite": "bin/vite.js"
10
10
  },
11
+ "keywords": [
12
+ "frontend",
13
+ "framework",
14
+ "hmr",
15
+ "dev-server",
16
+ "build-tool",
17
+ "vite"
18
+ ],
11
19
  "main": "./dist/node/index.js",
12
- "module": "./dist/node/index.js",
13
20
  "types": "./dist/node/index.d.ts",
14
21
  "exports": {
15
22
  ".": {
16
- "types": "./dist/node/index.d.ts",
17
- "import": "./dist/node/index.js",
18
- "require": "./index.cjs"
23
+ "import": {
24
+ "types": "./dist/node/index.d.ts",
25
+ "default": "./dist/node/index.js"
26
+ },
27
+ "require": {
28
+ "types": "./index.d.cts",
29
+ "default": "./index.cjs"
30
+ }
19
31
  },
20
32
  "./client": {
21
33
  "types": "./client.d.ts"
22
34
  },
23
35
  "./dist/client/*": "./dist/client/*",
36
+ "./types/*": {
37
+ "types": "./types/*"
38
+ },
24
39
  "./package.json": "./package.json"
25
40
  },
26
41
  "files": [
@@ -28,10 +43,11 @@
28
43
  "dist",
29
44
  "client.d.ts",
30
45
  "index.cjs",
46
+ "index.d.cts",
31
47
  "types"
32
48
  ],
33
49
  "engines": {
34
- "node": "^14.18.0 || >=16.0.0"
50
+ "node": "^18.0.0 || >=20.0.0"
35
51
  },
36
52
  "repository": {
37
53
  "type": "git",
@@ -41,90 +57,81 @@
41
57
  "bugs": {
42
58
  "url": "https://github.com/vitejs/vite/issues"
43
59
  },
44
- "homepage": "https://github.com/vitejs/vite/tree/main/#readme",
45
- "scripts": {
46
- "dev": "rimraf dist && pnpm run build-bundle -w",
47
- "build": "rimraf dist && run-s build-bundle build-types",
48
- "build-bundle": "rollup --config rollup.config.ts --configPlugin typescript",
49
- "build-types": "run-s build-types-temp build-types-pre-patch build-types-roll build-types-post-patch build-types-check",
50
- "build-types-temp": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
51
- "build-types-pre-patch": "tsx scripts/prePatchTypes.ts",
52
- "build-types-roll": "api-extractor run && rimraf temp",
53
- "build-types-post-patch": "tsx scripts/postPatchTypes.ts",
54
- "build-types-check": "tsx scripts/checkBuiltTypes.ts && tsc --project tsconfig.check.json",
55
- "lint": "eslint --cache --ext .ts src/**",
56
- "format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
57
- "prepublishOnly": "npm run build"
58
- },
60
+ "homepage": "https://vitejs.dev",
61
+ "funding": "https://github.com/vitejs/vite?sponsor=1",
59
62
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
60
63
  "dependencies": {
61
- "esbuild": "^0.16.3",
62
- "postcss": "^8.4.19",
63
- "resolve": "^1.22.1",
64
- "rollup": "^3.7.0"
64
+ "esbuild": "^0.19.3",
65
+ "postcss": "^8.4.32",
66
+ "rollup": "^4.2.0"
65
67
  },
66
68
  "optionalDependencies": {
67
- "fsevents": "~2.3.2"
69
+ "fsevents": "~2.3.3"
68
70
  },
69
71
  "devDependencies": {
70
- "@ampproject/remapping": "^2.2.0",
71
- "@babel/parser": "^7.20.5",
72
- "@babel/types": "^7.20.5",
73
- "@jridgewell/trace-mapping": "^0.3.17",
74
- "@rollup/plugin-alias": "^4.0.2",
75
- "@rollup/plugin-commonjs": "^23.0.3",
76
- "@rollup/plugin-dynamic-import-vars": "^2.0.1",
77
- "@rollup/plugin-json": "^5.0.2",
78
- "@rollup/plugin-node-resolve": "15.0.1",
79
- "@rollup/plugin-typescript": "^10.0.1",
80
- "@rollup/pluginutils": "^5.0.2",
81
- "acorn": "^8.8.1",
82
- "acorn-walk": "^8.2.0",
72
+ "@ampproject/remapping": "^2.2.1",
73
+ "@babel/parser": "^7.23.6",
74
+ "@jridgewell/trace-mapping": "^0.3.20",
75
+ "@rollup/plugin-alias": "^5.1.0",
76
+ "@rollup/plugin-commonjs": "^25.0.7",
77
+ "@rollup/plugin-dynamic-import-vars": "^2.1.2",
78
+ "@rollup/plugin-json": "^6.0.1",
79
+ "@rollup/plugin-node-resolve": "15.2.3",
80
+ "@rollup/plugin-typescript": "^11.1.5",
81
+ "@rollup/pluginutils": "^5.1.0",
82
+ "@types/escape-html": "^1.0.4",
83
+ "@types/pnpapi": "^0.0.5",
84
+ "acorn": "^8.11.2",
85
+ "acorn-walk": "^8.3.1",
83
86
  "cac": "^6.7.14",
84
87
  "chokidar": "^3.5.3",
85
88
  "connect": "^3.7.0",
86
- "connect-history-api-fallback": "^2.0.0",
87
- "convert-source-map": "^1.9.0",
89
+ "convert-source-map": "^2.0.0",
88
90
  "cors": "^2.8.5",
89
91
  "cross-spawn": "^7.0.3",
90
92
  "debug": "^4.3.4",
91
93
  "dep-types": "link:./src/types",
92
- "dotenv": "^16.0.3",
93
- "dotenv-expand": "^9.0.0",
94
- "es-module-lexer": "^1.1.0",
95
- "estree-walker": "^3.0.1",
94
+ "dotenv": "^16.3.1",
95
+ "dotenv-expand": "^10.0.0",
96
+ "es-module-lexer": "^1.4.1",
97
+ "escape-html": "^1.0.3",
98
+ "estree-walker": "^3.0.3",
96
99
  "etag": "^1.8.1",
97
- "fast-glob": "^3.2.12",
100
+ "fast-glob": "^3.3.2",
98
101
  "http-proxy": "^1.18.1",
99
- "launch-editor-middleware": "^2.6.0",
100
- "magic-string": "^0.27.0",
102
+ "json-stable-stringify": "^1.1.0",
103
+ "launch-editor-middleware": "^2.6.1",
104
+ "lightningcss": "^1.22.1",
105
+ "magic-string": "^0.30.5",
101
106
  "micromatch": "^4.0.5",
102
- "mlly": "^0.5.17",
107
+ "mlly": "^1.4.2",
103
108
  "mrmime": "^1.0.1",
104
109
  "okie": "^1.0.1",
105
- "open": "^8.4.0",
110
+ "open": "^8.4.2",
106
111
  "parse5": "^7.1.2",
107
- "periscopic": "^3.0.4",
112
+ "periscopic": "^4.0.2",
108
113
  "picocolors": "^1.0.0",
109
114
  "picomatch": "^2.3.1",
110
- "postcss-import": "^15.0.1",
111
- "postcss-load-config": "^4.0.1",
115
+ "postcss-import": "^15.1.0",
116
+ "postcss-load-config": "^4.0.2",
112
117
  "postcss-modules": "^6.0.0",
113
- "resolve.exports": "^1.1.0",
114
- "sirv": "^2.0.2",
115
- "source-map-js": "^1.0.2",
118
+ "resolve.exports": "^2.0.2",
119
+ "rollup-plugin-dts": "^6.1.0",
120
+ "rollup-plugin-license": "^3.2.0",
121
+ "sirv": "^2.0.3",
116
122
  "source-map-support": "^0.5.21",
117
- "strip-ansi": "^7.0.1",
118
- "strip-literal": "^0.4.2",
119
- "tsconfck": "^2.0.1",
120
- "tslib": "^2.4.1",
123
+ "strip-ansi": "^7.1.0",
124
+ "strip-literal": "^2.0.0",
125
+ "tsconfck": "^3.0.0",
126
+ "tslib": "^2.6.2",
121
127
  "types": "link:./types",
122
- "ufo": "^0.8.6",
123
- "ws": "^8.11.0"
128
+ "ufo": "^1.3.2",
129
+ "ws": "^8.15.0"
124
130
  },
125
131
  "peerDependencies": {
126
- "@types/node": ">= 14",
132
+ "@types/node": "^18.0.0 || >=20.0.0",
127
133
  "less": "*",
134
+ "lightningcss": "^1.21.0",
128
135
  "sass": "*",
129
136
  "stylus": "*",
130
137
  "sugarss": "*",
@@ -146,8 +153,23 @@
146
153
  "sugarss": {
147
154
  "optional": true
148
155
  },
156
+ "lightningcss": {
157
+ "optional": true
158
+ },
149
159
  "terser": {
150
160
  "optional": true
151
161
  }
162
+ },
163
+ "scripts": {
164
+ "dev": "rimraf dist && pnpm run build-bundle -w",
165
+ "build": "rimraf dist && run-s build-bundle build-types",
166
+ "build-bundle": "rollup --config rollup.config.ts --configPlugin typescript",
167
+ "build-types": "run-s build-types-temp build-types-roll build-types-check",
168
+ "build-types-temp": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
169
+ "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp",
170
+ "build-types-check": "tsc --project tsconfig.check.json",
171
+ "typecheck": "tsc --noEmit",
172
+ "lint": "eslint --cache --ext .ts src/**",
173
+ "format": "prettier --write --cache --parser typescript \"src/**/*.ts\""
152
174
  }
153
- }
175
+ }
@@ -60,7 +60,9 @@ class Logger {
60
60
  }
61
61
 
62
62
  static GetFileTag(filePath) {
63
- const fileTag = Logger.Blue('[' + path.basename(filePath) + ']');
63
+ const dirName = path.dirname(filePath)
64
+ const fileName = path.basename(filePath)
65
+ const fileTag = Logger.Blue('[/.../' + path.basename(dirName) + '/' + fileName + ']');
64
66
  return fileTag;
65
67
  }
66
68
 
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "strict": true,
6
- "jsx": "preserve",
7
- "importHelpers": true,
8
- "moduleResolution": "node",
9
- "experimentalDecorators": true,
10
- "allowJs": true,
11
- "skipLibCheck": true,
12
- "esModuleInterop": true,
13
- "allowSyntheticDefaultImports": true,
14
- "sourceMap": true,
15
- "baseUrl": ".",
16
- "paths": {
17
- "jsview/*": [
18
- "./*"
19
- ],
20
- "jsview": [
21
- "./index.js"
22
- ]
23
- },
24
- "lib": [
25
- "esnext",
26
- "dom",
27
- "dom.iterable",
28
- "scripthost"
29
- ],
30
-
31
- "alwaysStrict": true,
32
- "noImplicitReturns": true
33
- }
34
- }