Skip to content

Commit 20afc0c

Browse files
author
alqmc
committed
feat: gnrm ls and gnrm use
1 parent 009b284 commit 20afc0c

File tree

20 files changed

+626
-111
lines changed

20 files changed

+626
-111
lines changed

build/build.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,25 @@ import { buildTypescriptLib } from '@alqmc/build-ts';
33
import { enterPath, outputPath, rootPath } from './utils/path';
44
import type { DefineLibConfig } from '@alqmc/build-ts';
55

6-
const buildConfig: DefineLibConfig = {
6+
const buildGacmConfig: DefineLibConfig = {
77
baseOptions: {
8-
input: resolve(enterPath, 'main.ts'),
8+
input: resolve(enterPath, 'gacm.ts'),
9+
outPutPath: outputPath,
10+
enterPath,
11+
pkgPath: resolve(enterPath, 'package.json'),
12+
tsConfigPath: resolve(rootPath, 'tsconfig.json'),
13+
preserveModules: false,
14+
extraOptions: {
15+
banner: '#!/usr/bin/env node',
16+
},
17+
},
18+
buildProduct: ['lib'],
19+
pureOutput: true,
20+
};
21+
22+
const buildGnrmConfig: DefineLibConfig = {
23+
baseOptions: {
24+
input: resolve(enterPath, 'gnrm.ts'),
925
outPutPath: outputPath,
1026
enterPath,
1127
pkgPath: resolve(enterPath, 'package.json'),
@@ -20,5 +36,6 @@ const buildConfig: DefineLibConfig = {
2036
};
2137

2238
export const buildBundle = async () => {
23-
return buildTypescriptLib(buildConfig);
39+
await buildTypescriptLib(buildGacmConfig);
40+
await buildTypescriptLib(buildGnrmConfig);
2441
};

dist/main.js renamed to dist/gacm.js

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,70 +17,43 @@ var prompts__default = /*#__PURE__*/_interopDefaultLegacy(prompts);
1717

1818
var name = "gacm";
1919
var version = "1.1.5";
20-
var description = "gacm";
21-
var scripts = {
22-
build: "gulp --require sucrase/register/ts --gulpfile build/gulpfile.ts",
23-
clear: "rimraf dist",
24-
link: "cd dist && pnpm link --global",
25-
push: "git push gitee master && git push github master",
26-
"update:version": "sucrase-node build/utils/version.ts",
27-
log: "changeloger",
28-
release: "sucrase-node script/release.ts",
29-
prepare: "husky install"
30-
};
31-
var author = "alqmc";
20+
var description = "git account manage";
21+
var keywords = [
22+
"git",
23+
"account",
24+
"manage"
25+
];
3226
var license = "MIT";
33-
var devDependencies = {
34-
"@alqmc/build-ts": "^0.0.8",
35-
"@alqmc/build-utils": "^0.0.3",
36-
"@alqmc/eslint-config": "0.0.4",
37-
"@commitlint/cli": "^8.3.5",
38-
"@commitlint/config-angular": "^8.3.4",
39-
"@commitlint/config-conventional": "^16.2.1",
40-
"@types/fs-extra": "^9.0.13",
41-
"@types/gulp": "^4.0.9",
42-
"@types/node": "^17.0.21",
43-
"@types/prompts": "^2.0.14",
44-
changeloger: "0.1.0",
45-
commitizen: "^4.1.2",
46-
"fs-extra": "^10.1.0",
47-
gulp: "^4.0.2",
48-
husky: "^8.0.1",
49-
"lint-staged": "^10.5.4",
50-
prettier: "^2.6.2",
51-
prompts: "^2.4.2",
52-
rimraf: "^3.0.2",
53-
sucrase: "^3.20.3",
54-
tslib: "^2.4.0",
55-
typescript: "^4.6.3"
27+
var author = "alqmc";
28+
var bin = {
29+
gacm: "gacm.js",
30+
gnrm: "gnrm.js"
31+
};
32+
var publishConfig = {
33+
access: "public"
5634
};
5735
var dependencies = {
5836
commander: "^9.3.0",
5937
execa: "5.1.1",
6038
kolorist: "^1.5.1",
61-
minimist: "^1.2.6",
6239
prompts: "^2.4.2"
6340
};
64-
var config = {
65-
commitizen: {
66-
path: "./node_modules/cz-conventional-changelog"
67-
}
68-
};
6941
var pkg = {
7042
name: name,
7143
version: version,
44+
"private": false,
7245
description: description,
73-
scripts: scripts,
74-
author: author,
46+
keywords: keywords,
7547
license: license,
76-
devDependencies: devDependencies,
77-
dependencies: dependencies,
78-
config: config
48+
author: author,
49+
bin: bin,
50+
publishConfig: publishConfig,
51+
dependencies: dependencies
7952
};
8053

8154
const useVersion = async (cmd) => {
8255
if (cmd.version)
83-
console.log(pkg.version);
56+
console.log(`v${pkg.version}`);
8457
};
8558

8659
const rootPath = __dirname;
@@ -89,18 +62,17 @@ path.resolve(rootPath, "package");
8962
const HOME = process.env[process.platform === "win32" ? "USERPROFILE" : "HOME"] || "";
9063
const registriesPath = path.join(HOME, ".gacmrc");
9164

92-
const PREFIX = "[gacm]:";
9365
const success = (msg) => console.log(`
94-
${kolorist.green(PREFIX + msg)}
66+
${kolorist.green(msg)}
9567
`);
9668
const error = (msg) => console.log(`
97-
${kolorist.red(PREFIX + msg)}
69+
${kolorist.red(msg)}
9870
`);
9971
const warning = (msg) => console.log(`
100-
${kolorist.yellow(PREFIX + msg)}
72+
${kolorist.yellow(msg)}
10173
`);
10274
const info = (msg) => console.log(`
103-
${kolorist.blue(PREFIX + msg)}
75+
${kolorist.blue(msg)}
10476
`);
10577
const log = {
10678
success,

0 commit comments

Comments
 (0)