@build-script/package-tools 0.0.20 → 0.0.21

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.
@@ -6,7 +6,7 @@
6
6
  * https://github.com/GongT/baobao
7
7
  *
8
8
  ******************************************************************************/
9
- export declare const self_package_version = "0.0.20";
9
+ export declare const self_package_version = "0.0.21";
10
10
  export declare const self_package_name = "@build-script/package-tools";
11
- export declare const self_package_repository = "undefined";
11
+ export declare const self_package_repository = "https://github.com/GongT/baobao";
12
12
  //# sourceMappingURL=version.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.generated.d.ts","sourceRoot":"","sources":["../../src/common/version.generated.ts"],"names":[],"mappings":"AAKA;;;;;;;gFAOgF;AAGhF,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,iBAAiB,gCAAgC,CAAC;AAC/D,eAAO,MAAM,uBAAuB,cAAc,CAAC"}
1
+ {"version":3,"file":"version.generated.d.ts","sourceRoot":"","sources":["../../src/common/version.generated.ts"],"names":[],"mappings":"AAKA;;;;;;;gFAOgF;AAGhF,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,iBAAiB,gCAAgC,CAAC;AAC/D,eAAO,MAAM,uBAAuB,oCAAoC,CAAC"}
@@ -10,7 +10,7 @@
10
10
  * https://github.com/GongT/baobao
11
11
  *
12
12
  ******************************************************************************/
13
- export const self_package_version = "0.0.20";
13
+ export const self_package_version = "0.0.21";
14
14
  export const self_package_name = "@build-script/package-tools";
15
- export const self_package_repository = "undefined";
15
+ export const self_package_repository = "https://github.com/GongT/baobao";
16
16
  //# sourceMappingURL=version.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.generated.js","sourceRoot":"","sources":["../../src/common/version.generated.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,0CAA0C;AAC1C,oBAAoB;AACpB,aAAa;AAEb;;;;;;;gFAOgF;AAGhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC"}
1
+ {"version":3,"file":"version.generated.js","sourceRoot":"","sources":["../../src/common/version.generated.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,0CAA0C;AAC1C,oBAAoB;AACpB,aAAa;AAEb;;;;;;;gFAOgF;AAGhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,iCAAiC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@build-script/package-tools",
3
3
  "type": "module",
4
- "version": "0.0.20",
4
+ "version": "0.0.21",
5
5
  "description": "A Node.js package managing tool",
6
6
  "bin": {
7
7
  "package-tools": "./load.js",
@@ -21,15 +21,15 @@
21
21
  "split-cmd": "^1.1.0",
22
22
  "targz": "^1.0.1",
23
23
  "tiny-async-pool": "^2.1.0",
24
- "@build-script/monorepo-lib": "^0.0.19",
25
- "@idlebox/common": "^1.5.15",
26
- "@idlebox/cli": "^0.0.11",
27
- "@idlebox/ensure-symlink": "^1.0.39",
28
- "@idlebox/dependency-graph": "^0.0.16",
29
- "@idlebox/node": "^1.4.25",
30
- "@idlebox/unshare": "^0.0.10",
31
- "@idlebox/source-map-support": "^0.0.17",
32
- "@idlebox/json-edit": "^0.0.10"
24
+ "@idlebox/cli": "^0.0.12",
25
+ "@idlebox/common": "^1.5.16",
26
+ "@idlebox/dependency-graph": "^0.0.17",
27
+ "@idlebox/json-edit": "^0.0.11",
28
+ "@idlebox/node": "^1.4.26",
29
+ "@idlebox/ensure-symlink": "^1.0.40",
30
+ "@build-script/monorepo-lib": "^0.0.20",
31
+ "@idlebox/source-map-support": "^0.0.18",
32
+ "@idlebox/unshare": "^0.0.11"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/cacache": "^20.0.0",
@@ -41,19 +41,22 @@
41
41
  "@types/targz": "^1.0.5",
42
42
  "@types/tiny-async-pool": "^2.0.3",
43
43
  "@types/tinycolor2": "^1.4.6",
44
- "@build-script/codegen": "^1.0.18",
45
- "@idlebox/cli-static-generator": "^0.0.10",
44
+ "@build-script/codegen": "^1.0.19",
46
45
  "@build-script/baseline-rig": "latest",
47
- "@mpis/run": "^0.0.19"
46
+ "@idlebox/cli-static-generator": "^0.0.11",
47
+ "@mpis/run": "^0.0.20"
48
48
  },
49
49
  "sideEffects": false,
50
50
  "license": "MIT",
51
51
  "author": "GongT <admin@gongt.me>",
52
- "repository": "https://github.com/GongT/baobao",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/GongT/baobao",
55
+ "directory": "@build-script/package-tools"
56
+ },
53
57
  "scripts": {
54
58
  "build": "mpis-run build",
55
59
  "watch": "mpis-run watch",
56
- "clean": "mpis-run clean",
57
- "lint": "internal-lint"
60
+ "clean": "mpis-run clean"
58
61
  }
59
62
  }
@@ -13,7 +13,7 @@
13
13
  ******************************************************************************/
14
14
 
15
15
 
16
- export const self_package_version = "0.0.20";
16
+ export const self_package_version = "0.0.21";
17
17
  export const self_package_name = "@build-script/package-tools";
18
- export const self_package_repository = "undefined";
18
+ export const self_package_repository = "https://github.com/GongT/baobao";
19
19
 
@@ -1,15 +1,19 @@
1
- import type { FileBuilder, IOutputShim } from '@build-script/heft-plugin-base';
1
+ import type { FileBuilder, IOutputShim } from '@build-script/codegen';
2
+ import { execa } from 'execa';
2
3
  import * as fs from 'node:fs';
3
4
  import * as path from 'node:path';
4
5
 
5
- export function generate(_builder: FileBuilder, logger: IOutputShim) {
6
+ export async function generate(_builder: FileBuilder, logger: IOutputShim) {
6
7
  const pkgFile = path.resolve(__dirname, '../../package.json');
7
8
  const pkg = JSON.parse(fs.readFileSync(pkgFile, 'utf-8'));
8
9
 
9
10
  logger.log(`package info = ${pkg.name} @ ${pkg.version}`);
10
11
 
12
+ const { stdout } = await execa('git', ['remote', 'get-url', 'origin']);
13
+ const repository = stdout.trim().replace(/\.git$/, '');
14
+
11
15
  return `export const self_package_version = "${pkg.version}";
12
16
  export const self_package_name = "${pkg.name}";
13
- export const self_package_repository = "${pkg.repository}";
17
+ export const self_package_repository = "${repository}";
14
18
  `;
15
19
  }