feng3d-cli 0.0.9 → 0.0.11

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": "feng3d-cli",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "feng3d 项目通用标准,包含代码规范、配置模板和 CLI 工具",
5
5
  "homepage": "https://feng3d.com/feng3d-cli/",
6
6
  "author": "feng",
@@ -11,7 +11,7 @@
11
11
  "module": "./dist/index.js",
12
12
  "exports": {
13
13
  ".": {
14
- "types": "./src/index.ts",
14
+ "types": "./lib/index.d.ts",
15
15
  "import": "./dist/index.js",
16
16
  "require": "./dist/index.umd.cjs"
17
17
  }
@@ -6,13 +6,13 @@ const pkgpath = path.resolve('package.json');
6
6
  let pkg = fs.readFileSync(pkgpath, 'utf8');
7
7
 
8
8
  pkg = pkg
9
- .replace(`"types": "./lib/index.d.ts"`, `"types": "./src/index.ts"`)
9
+ .replaceAll(`"types": "./lib/index.d.ts"`, `"types": "./src/index.ts"`)
10
10
  //
11
- .replace(`"module": "./dist/index.js"`, `"module": "./src/index.ts"`)
12
- .replace(`"main": "./dist/index.umd.cjs"`, `"main": "./src/index.ts"`)
11
+ .replaceAll(`"module": "./dist/index.js"`, `"module": "./src/index.ts"`)
12
+ .replaceAll(`"main": "./dist/index.umd.cjs"`, `"main": "./src/index.ts"`)
13
13
  //
14
- .replace(`"import": "./dist/index.js"`, `"import": "./src/index.ts"`)
15
- .replace(`"require": "./dist/index.umd.cjs"`, `"require": "./src/index.ts"`)
14
+ .replaceAll(`"import": "./dist/index.js"`, `"import": "./src/index.ts"`)
15
+ .replaceAll(`"require": "./dist/index.umd.cjs"`, `"require": "./src/index.ts"`)
16
16
  ;
17
17
 
18
18
  fs.writeFileSync(pkgpath, pkg, 'utf8');
@@ -6,13 +6,13 @@ const pkgpath = path.resolve('package.json');
6
6
  let pkg = fs.readFileSync(pkgpath, 'utf8');
7
7
 
8
8
  pkg = pkg
9
- .replace(`"types": "./src/index.ts"`, `"types": "./lib/index.d.ts"`)
9
+ .replaceAll(`"types": "./src/index.ts"`, `"types": "./lib/index.d.ts"`)
10
10
  //
11
- .replace(`"module": "./src/index.ts"`, `"module": "./dist/index.js"`)
12
- .replace(`"main": "./src/index.ts"`, `"main": "./dist/index.umd.cjs"`)
11
+ .replaceAll(`"module": "./src/index.ts"`, `"module": "./dist/index.js"`)
12
+ .replaceAll(`"main": "./src/index.ts"`, `"main": "./dist/index.umd.cjs"`)
13
13
  //
14
- .replace(`"import": "./src/index.ts"`, `"import": "./dist/index.js"`)
15
- .replace(`"require": "./src/index.ts"`, `"require": "./dist/index.umd.cjs"`)
14
+ .replaceAll(`"import": "./src/index.ts"`, `"import": "./dist/index.js"`)
15
+ .replaceAll(`"require": "./src/index.ts"`, `"require": "./dist/index.umd.cjs"`)
16
16
  ;
17
17
 
18
18
  fs.writeFileSync(pkgpath, pkg, 'utf8');
@@ -7,6 +7,7 @@
7
7
  "emitDeclarationOnly": true,
8
8
  "declaration": true,
9
9
  "declarationMap": true,
10
+ "rootDir": "src",
10
11
  "outDir": "lib",
11
12
  "esModuleInterop": true,
12
13
  "allowSyntheticDefaultImports": true,
@@ -8,8 +8,10 @@ const namespace = 'feng3d';
8
8
  const external = pkg.standalone ? [] : Object.keys(pkg.dependencies || []);
9
9
  const globals = () => namespace;
10
10
 
11
+ // 构建时在输出文件底部添加版本号打印
12
+ const versionBanner = `console.log("${pkg.name} v${pkg.version}");`;
13
+
11
14
  export default defineConfig({
12
- publicDir: false,
13
15
  build: {
14
16
  lib: {
15
17
  // Could also be a dictionary or array of multiple entry points
@@ -26,6 +28,8 @@ export default defineConfig({
26
28
  output: {
27
29
  // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
28
30
  globals,
31
+ // 在输出文件底部添加版本号打印
32
+ footer: versionBanner,
29
33
  },
30
34
  },
31
35
  },
@@ -8,7 +8,6 @@ export default defineConfig({
8
8
  // 设置测试环境
9
9
  test: {
10
10
  globals: true,
11
- include: ['test/**/*.spec.ts'],
12
11
  },
13
12
  });
14
13