pubinfo 0.0.1 → 2.0.0-beta.4

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '@pubinfo/cli'
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const themes = require('@pubinfo/config/themes');
4
+
5
+
6
+
7
+ Object.prototype.hasOwnProperty.call(themes, '__proto__') &&
8
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
9
+ Object.defineProperty(exports, '__proto__', {
10
+ enumerable: true,
11
+ value: themes['__proto__']
12
+ });
13
+
14
+ Object.keys(themes).forEach(function (k) {
15
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = themes[k];
16
+ });
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/config/themes';
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/config/themes';
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/config/themes';
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/config/themes';
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ const eslint = require('@pubinfo/config/eslint');
4
+
5
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
6
+
7
+ const eslint__default = /*#__PURE__*/_interopDefaultCompat(eslint);
8
+
9
+
10
+
11
+ module.exports = eslint__default;
@@ -0,0 +1,2 @@
1
+ import _default from '@pubinfo/config/eslint';
2
+ export = _default;
@@ -0,0 +1 @@
1
+ export { default } from '@pubinfo/config/eslint';
@@ -0,0 +1,2 @@
1
+ import _default from '@pubinfo/config/eslint';
2
+ export = _default;
@@ -0,0 +1 @@
1
+ export { default } from '@pubinfo/config/eslint';
package/dist/index.cjs CHANGED
@@ -1,114 +1,16 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
2
+
3
+ const core = require('@pubinfo/core');
29
4
 
30
- // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- download: () => download
34
- });
35
- module.exports = __toCommonJS(src_exports);
36
5
 
37
- // src/download.ts
38
- var import_giget = require("giget");
39
- var import_consola = __toESM(require("consola"), 1);
40
6
 
41
- // src/progress.ts
42
- var import_cli_progress = require("cli-progress");
43
- var import_ansi_colors = __toESM(require("ansi-colors"), 1);
44
- var import_fake_progress = __toESM(require("fake-progress"), 1);
45
- function createMockProgressBar() {
46
- const fakeProgress = new import_fake_progress.default({
47
- timeConstant: 10 * 1e3
48
- });
49
- let complete = false;
50
- const bar = new import_cli_progress.SingleBar(
51
- {
52
- format: `${import_ansi_colors.default.bold.green("Download:")} ${import_ansi_colors.default.blueBright("{bar}")}| {percentage}% || {value}/{total} || Speed: {speed}`,
53
- barCompleteChar: "\u2588",
54
- barIncompleteChar: "\u2591",
55
- hideCursor: true,
56
- linewrap: true,
57
- barsize: 40,
58
- clearOnComplete: true,
59
- stopOnComplete: true
60
- },
61
- import_cli_progress.Presets.shades_classic
62
- );
63
- function interval() {
64
- const startTime = Date.now();
65
- fakeProgress.start();
66
- console.log("\n");
67
- bar.start(100, 0, {
68
- speed: "N/A"
69
- });
70
- const timer = setInterval(() => {
71
- const count = Number((fakeProgress.progress * 100).toFixed(0));
72
- bar.update(count);
73
- if (complete) {
74
- bar.update(100);
75
- console.log(`${import_ansi_colors.default.bold.green("Download complete in")} ${import_ansi_colors.default.bold.yellow(`${Date.now() - startTime}`)} ${import_ansi_colors.default.bold.green("ms.")}`);
76
- clearInterval(timer);
77
- }
78
- }, 100);
79
- }
80
- function stop() {
81
- complete = true;
82
- }
83
- interval();
84
- return stop;
85
- }
7
+ Object.prototype.hasOwnProperty.call(core, '__proto__') &&
8
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
9
+ Object.defineProperty(exports, '__proto__', {
10
+ enumerable: true,
11
+ value: core['__proto__']
12
+ });
86
13
 
87
- // src/download.ts
88
- var pubinfo = async (input, { auth }) => {
89
- return {
90
- name: "pubinfo",
91
- version: input,
92
- headers: { Authorization: `token ${auth}` },
93
- tar: "http://124.223.184.245:10000/monorepo-project-template.tar.gz"
94
- };
95
- };
96
- async function download(options = {}) {
97
- const stop = createMockProgressBar();
98
- try {
99
- await (0, import_giget.downloadTemplate)("pubinfo:monorepo-project-template", {
100
- providers: { pubinfo },
101
- force: true,
102
- auth: options.auth,
103
- dir: options.dir
104
- });
105
- } catch (error) {
106
- import_consola.default.error(error);
107
- } finally {
108
- stop();
109
- }
110
- }
111
- // Annotate the CommonJS export names for ESM import in node:
112
- 0 && (module.exports = {
113
- download
14
+ Object.keys(core).forEach(function (k) {
15
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = core[k];
114
16
  });
@@ -0,0 +1,7 @@
1
+ export * from '@pubinfo/core';
2
+ import '@pubinfo/core/request';
3
+ import '@pubinfo/config/themes';
4
+ import '@pubinfo/config/unocss';
5
+ import '@pubinfo/vite';
6
+ import '@pubinfo/config/eslint';
7
+ import '@pubinfo/config/stylelint';
@@ -0,0 +1,7 @@
1
+ export * from '@pubinfo/core';
2
+ import '@pubinfo/core/request';
3
+ import '@pubinfo/config/themes';
4
+ import '@pubinfo/config/unocss';
5
+ import '@pubinfo/vite';
6
+ import '@pubinfo/config/eslint';
7
+ import '@pubinfo/config/stylelint';
@@ -0,0 +1,7 @@
1
+ export * from '@pubinfo/core';
2
+ import '@pubinfo/core/request';
3
+ import '@pubinfo/config/themes';
4
+ import '@pubinfo/config/unocss';
5
+ import '@pubinfo/vite';
6
+ import '@pubinfo/config/eslint';
7
+ import '@pubinfo/config/stylelint';
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/core';
package/dist/node.cjs ADDED
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ const unocss = require('@pubinfo/config/unocss');
4
+ const vite = require('@pubinfo/vite');
5
+
6
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
7
+
8
+ const unocss__default = /*#__PURE__*/_interopDefaultCompat(unocss);
9
+
10
+
11
+
12
+ exports.presetUnocss = unocss__default;
13
+ Object.prototype.hasOwnProperty.call(vite, '__proto__') &&
14
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
15
+ Object.defineProperty(exports, '__proto__', {
16
+ enumerable: true,
17
+ value: vite['__proto__']
18
+ });
19
+
20
+ Object.keys(vite).forEach(function (k) {
21
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = vite[k];
22
+ });
@@ -0,0 +1,2 @@
1
+ export { default as presetUnocss } from '@pubinfo/config/unocss';
2
+ export * from '@pubinfo/vite';
@@ -0,0 +1,2 @@
1
+ export { default as presetUnocss } from '@pubinfo/config/unocss';
2
+ export * from '@pubinfo/vite';
package/dist/node.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default as presetUnocss } from '@pubinfo/config/unocss';
2
+ export * from '@pubinfo/vite';
package/dist/node.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export { default as presetUnocss } from '@pubinfo/config/unocss';
2
+ export * from '@pubinfo/vite';
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const request = require('@pubinfo/core/request');
4
+
5
+
6
+
7
+ Object.prototype.hasOwnProperty.call(request, '__proto__') &&
8
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
9
+ Object.defineProperty(exports, '__proto__', {
10
+ enumerable: true,
11
+ value: request['__proto__']
12
+ });
13
+
14
+ Object.keys(request).forEach(function (k) {
15
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = request[k];
16
+ });
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/core/request';
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/core/request';
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/core/request';
@@ -0,0 +1 @@
1
+ export * from '@pubinfo/core/request';
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @import "@pubinfo/core/style.css"
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ const stylelint = require('@pubinfo/config/stylelint');
4
+
5
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
6
+
7
+ const stylelint__default = /*#__PURE__*/_interopDefaultCompat(stylelint);
8
+
9
+
10
+
11
+ module.exports = stylelint__default;
@@ -0,0 +1,2 @@
1
+ import _default from '@pubinfo/config/stylelint';
2
+ export = _default;
@@ -0,0 +1 @@
1
+ export { default } from '@pubinfo/config/stylelint';
@@ -0,0 +1,2 @@
1
+ import _default from '@pubinfo/config/stylelint';
2
+ export = _default;
@@ -0,0 +1 @@
1
+ export { default } from '@pubinfo/config/stylelint';
package/package.json CHANGED
@@ -1,37 +1,78 @@
1
1
  {
2
2
  "name": "pubinfo",
3
3
  "type": "module",
4
- "version": "0.0.1",
5
- "description": "pubinfo项目框架",
6
- "author": "Werheng <werheng.zhang@gmail.com>",
7
- "license": "MIT",
8
- "repository": "https://github.com/werheng/pubinfo-cli",
9
- "bugs": {
10
- "url": "https://github.com/werheng/pubinfo-cli/issues"
4
+ "version": "2.0.0-beta.4",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.mjs",
9
+ "require": "./dist/index.cjs"
10
+ },
11
+ "./request": {
12
+ "types": "./dist/request.d.ts",
13
+ "import": "./dist/request.mjs",
14
+ "require": "./dist/request.cjs"
15
+ },
16
+ "./client": {
17
+ "types": "./dist/client.d.ts",
18
+ "import": "./dist/client.mjs",
19
+ "require": "./dist/client.cjs"
20
+ },
21
+ "./node": {
22
+ "types": "./dist/node.d.ts",
23
+ "import": "./dist/node.mjs",
24
+ "require": "./dist/node.cjs"
25
+ },
26
+ "./eslint": {
27
+ "types": "./dist/eslint.d.ts",
28
+ "import": "./dist/eslint.mjs",
29
+ "require": "./dist/eslint.cjs"
30
+ },
31
+ "./stylelint": {
32
+ "types": "./dist/stylelint.d.ts",
33
+ "import": "./dist/stylelint.mjs",
34
+ "require": "./dist/stylelint.cjs"
35
+ },
36
+ "./style.css": {
37
+ "import": "./dist/style.css",
38
+ "require": "./dist/style.css"
39
+ },
40
+ "./types": "./types.d.ts"
11
41
  },
42
+ "main": "dist/index.cjs",
43
+ "module": "dist/index.mjs",
44
+ "types": "dist/index.d.ts",
12
45
  "bin": {
13
- "pubinfo": "./dist/index.js"
46
+ "pubinfo": "./bin/pubinfo.mjs"
14
47
  },
15
48
  "files": [
49
+ "*.d.ts",
16
50
  "dist"
17
51
  ],
18
- "scripts": {
19
- "dev": "tsup --watch src",
20
- "build": "tsup",
21
- "cli": "tsx src/index.ts",
22
- "cli:clean": "rimraf ./my-app"
52
+ "peerDependencies": {
53
+ "alova": "^3.2.6",
54
+ "eslint": "^9.16.0",
55
+ "stylelint": "^16.11.0"
23
56
  },
24
57
  "dependencies": {
25
- "@inquirer/prompts": "^4.3.3",
26
- "ansi-colors": "^4.1.3",
27
- "cfonts": "^3.3.0",
28
- "commander": "^12.1.0",
29
- "confbox": "^0.1.7",
30
- "consola": "^3.2.3",
31
- "giget": "^1.2.3",
32
- "ofetch": "^1.3.4",
33
- "ora": "^8.0.1",
34
- "rimraf": "^5.0.7",
35
- "semver": "^7.6.2"
58
+ "@iconify/json": "^2.2.312",
59
+ "@iconify/vue": "^4.3.0",
60
+ "pinia": "^2.3.1",
61
+ "sass": "1.77.8",
62
+ "unocss": "^65.5.0",
63
+ "vue": "^3.5.13",
64
+ "vue-i18n": "^9.14.2",
65
+ "vue-router": "^4.5.0",
66
+ "@pubinfo/config": "2.0.0-beta.4",
67
+ "@pubinfo/core": "2.0.0-beta.4",
68
+ "@pubinfo/vite": "2.0.0-beta.4",
69
+ "@pubinfo/cli": "2.0.0-beta.4"
70
+ },
71
+ "devDependencies": {
72
+ "unbuild": "^3.5.0"
73
+ },
74
+ "scripts": {
75
+ "stub": "unbuild --stub",
76
+ "build": "unbuild"
36
77
  }
37
- }
78
+ }
package/types.d.ts ADDED
@@ -0,0 +1 @@
1
+ import '@pubinfo/core/types';
package/README.md DELETED
@@ -1,20 +0,0 @@
1
- # create-pubinfo
2
-
3
- [![npm version][npm-version-src]][npm-version-href]
4
- [![Monorepo][monorepo-src]][monorepo-href]
5
- ![License][License-src]
6
-
7
- > 一键生成项目模板
8
-
9
- ## 基本用法
10
-
11
- ```bash
12
- npm create pubinfo
13
- ```
14
-
15
- <!-- Badges -->
16
- [npm-version-src]: https://img.shields.io/npm/v/create-pubinfo?style=flat-square
17
- [npm-version-href]: https://npmjs.com/package/create-pubinfo
18
- [monorepo-src]: https://img.shields.io/badge/Monorepo-with%20pnpm-F5871D.svg
19
- [monorepo-href]: https://pnpm.io/workspaces
20
- [License-src]: https://img.shields.io/badge/license-MIT-green
@@ -1,78 +0,0 @@
1
- // src/download.ts
2
- import { downloadTemplate } from "giget";
3
- import consola from "consola";
4
-
5
- // src/progress.ts
6
- import { Presets, SingleBar } from "cli-progress";
7
- import colors from "ansi-colors";
8
- import FackProgress from "fake-progress";
9
- function createMockProgressBar() {
10
- const fakeProgress = new FackProgress({
11
- timeConstant: 10 * 1e3
12
- });
13
- let complete = false;
14
- const bar = new SingleBar(
15
- {
16
- format: `${colors.bold.green("Download:")} ${colors.blueBright("{bar}")}| {percentage}% || {value}/{total} || Speed: {speed}`,
17
- barCompleteChar: "\u2588",
18
- barIncompleteChar: "\u2591",
19
- hideCursor: true,
20
- linewrap: true,
21
- barsize: 40,
22
- clearOnComplete: true,
23
- stopOnComplete: true
24
- },
25
- Presets.shades_classic
26
- );
27
- function interval() {
28
- const startTime = Date.now();
29
- fakeProgress.start();
30
- console.log("\n");
31
- bar.start(100, 0, {
32
- speed: "N/A"
33
- });
34
- const timer = setInterval(() => {
35
- const count = Number((fakeProgress.progress * 100).toFixed(0));
36
- bar.update(count);
37
- if (complete) {
38
- bar.update(100);
39
- console.log(`${colors.bold.green("Download complete in")} ${colors.bold.yellow(`${Date.now() - startTime}`)} ${colors.bold.green("ms.")}`);
40
- clearInterval(timer);
41
- }
42
- }, 100);
43
- }
44
- function stop() {
45
- complete = true;
46
- }
47
- interval();
48
- return stop;
49
- }
50
-
51
- // src/download.ts
52
- var pubinfo = async (input, { auth }) => {
53
- return {
54
- name: "pubinfo",
55
- version: input,
56
- headers: { Authorization: `token ${auth}` },
57
- tar: "http://124.223.184.245:10000/monorepo-project-template.tar.gz"
58
- };
59
- };
60
- async function download(options = {}) {
61
- const stop = createMockProgressBar();
62
- try {
63
- await downloadTemplate("pubinfo:monorepo-project-template", {
64
- providers: { pubinfo },
65
- force: true,
66
- auth: options.auth,
67
- dir: options.dir
68
- });
69
- } catch (error) {
70
- consola.error(error);
71
- } finally {
72
- stop();
73
- }
74
- }
75
-
76
- export {
77
- download
78
- };
package/dist/cli.cjs DELETED
@@ -1,194 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
- // If the importer is in node compatibility mode or this is not an ESM
19
- // file that has been converted to a CommonJS file using a Babel-
20
- // compatible transform (i.e. "__esModule" has not been set), then set
21
- // "default" to the CommonJS "module.exports" for node compatibility.
22
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
- mod
24
- ));
25
-
26
- // src/cli.ts
27
- var import_node_process = __toESM(require("process"), 1);
28
- var import_commander = require("commander");
29
- var import_prompts = require("@inquirer/prompts");
30
- var import_consola2 = __toESM(require("consola"), 1);
31
-
32
- // package.json
33
- var package_default = {
34
- name: "create-pubinfo",
35
- type: "module",
36
- version: "0.3.0",
37
- description: "Start a Pubinfo project.",
38
- author: "Werheng <werheng.zhang@gmail.com>",
39
- license: "MIT",
40
- repository: "https://github.com/werheng/pubinfo-cli",
41
- bugs: {
42
- url: "https://github.com/werheng/pubinfo-cli/issues"
43
- },
44
- bin: "./dist/cli.js",
45
- files: [
46
- "dist"
47
- ],
48
- scripts: {
49
- dev: "tsup --watch src",
50
- build: "tsup",
51
- cli: "tsx src/cli.ts"
52
- },
53
- dependencies: {
54
- "@inquirer/prompts": "^4.3.1",
55
- "ansi-colors": "^4.1.3",
56
- boxen: "^7.1.1",
57
- cfonts: "^3.2.0",
58
- "cli-progress": "^3.12.0",
59
- commander: "^12.0.0",
60
- consola: "^3.2.3",
61
- "fake-progress": "^1.0.4",
62
- giget: "^1.2.3",
63
- progress: "^2.0.3",
64
- radash: "^12.1.0"
65
- },
66
- devDependencies: {
67
- "@types/cli-progress": "^3.11.5"
68
- }
69
- };
70
-
71
- // src/download.ts
72
- var import_giget = require("giget");
73
- var import_consola = __toESM(require("consola"), 1);
74
-
75
- // src/progress.ts
76
- var import_cli_progress = require("cli-progress");
77
- var import_ansi_colors = __toESM(require("ansi-colors"), 1);
78
- var import_fake_progress = __toESM(require("fake-progress"), 1);
79
- function createMockProgressBar() {
80
- const fakeProgress = new import_fake_progress.default({
81
- timeConstant: 10 * 1e3
82
- });
83
- let complete = false;
84
- const bar = new import_cli_progress.SingleBar(
85
- {
86
- format: `${import_ansi_colors.default.bold.green("Download:")} ${import_ansi_colors.default.blueBright("{bar}")}| {percentage}% || {value}/{total} || Speed: {speed}`,
87
- barCompleteChar: "\u2588",
88
- barIncompleteChar: "\u2591",
89
- hideCursor: true,
90
- linewrap: true,
91
- barsize: 40,
92
- clearOnComplete: true,
93
- stopOnComplete: true
94
- },
95
- import_cli_progress.Presets.shades_classic
96
- );
97
- function interval() {
98
- const startTime = Date.now();
99
- fakeProgress.start();
100
- console.log("\n");
101
- bar.start(100, 0, {
102
- speed: "N/A"
103
- });
104
- const timer = setInterval(() => {
105
- const count = Number((fakeProgress.progress * 100).toFixed(0));
106
- bar.update(count);
107
- if (complete) {
108
- bar.update(100);
109
- console.log(`${import_ansi_colors.default.bold.green("Download complete in")} ${import_ansi_colors.default.bold.yellow(`${Date.now() - startTime}`)} ${import_ansi_colors.default.bold.green("ms.")}`);
110
- clearInterval(timer);
111
- }
112
- }, 100);
113
- }
114
- function stop() {
115
- complete = true;
116
- }
117
- interval();
118
- return stop;
119
- }
120
-
121
- // src/download.ts
122
- var pubinfo = async (input2, { auth }) => {
123
- return {
124
- name: "pubinfo",
125
- version: input2,
126
- headers: { Authorization: `token ${auth}` },
127
- tar: "http://124.223.184.245:10000/monorepo-project-template.tar.gz"
128
- };
129
- };
130
- async function download(options = {}) {
131
- const stop = createMockProgressBar();
132
- try {
133
- await (0, import_giget.downloadTemplate)("pubinfo:monorepo-project-template", {
134
- providers: { pubinfo },
135
- force: true,
136
- auth: options.auth,
137
- dir: options.dir
138
- });
139
- } catch (error) {
140
- import_consola.default.error(error);
141
- } finally {
142
- stop();
143
- }
144
- }
145
-
146
- // src/rewrite.ts
147
- async function rewrite(_) {
148
- }
149
-
150
- // src/log.ts
151
- var import_cfonts = __toESM(require("cfonts"), 1);
152
- function bootstrop() {
153
- printLoGo("PUBINFO");
154
- function printLoGo(logo) {
155
- import_cfonts.default.say(logo, {
156
- font: "simple3d",
157
- align: "left",
158
- background: "transparent",
159
- letterSpacing: 1,
160
- lineHeight: 1,
161
- space: true,
162
- maxLength: 0,
163
- spaceless: false,
164
- gradient: ["blue", "magenta"],
165
- independentGradient: false,
166
- transitionGradient: false,
167
- env: "node"
168
- });
169
- }
170
- }
171
-
172
- // src/cli.ts
173
- async function main() {
174
- const program = new import_commander.Command();
175
- program.name(package_default.name).description(package_default.description).version(package_default.version);
176
- program.parse();
177
- bootstrop();
178
- const answer = {};
179
- try {
180
- answer.dir = await (0, import_prompts.input)({ message: "\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0", default: "my-app" });
181
- answer.key = await (0, import_prompts.input)({ message: "\u8BF7\u8F93\u5165\u9879\u76EE\u6807\u8BC6(key)", default: answer.dir });
182
- } catch (error) {
183
- import_consola2.default.fail("Operation cancelled");
184
- }
185
- try {
186
- await download(answer);
187
- await rewrite(answer);
188
- } catch (error) {
189
- import_consola2.default.error(error);
190
- } finally {
191
- import_node_process.default.exit(0);
192
- }
193
- }
194
- main();
package/dist/cli.js DELETED
@@ -1,99 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- download
4
- } from "./chunk-WFEMVKQK.js";
5
-
6
- // src/cli.ts
7
- import process from "node:process";
8
- import { Command } from "commander";
9
- import { input } from "@inquirer/prompts";
10
- import consola from "consola";
11
-
12
- // package.json
13
- var package_default = {
14
- name: "create-pubinfo",
15
- type: "module",
16
- version: "0.3.0",
17
- description: "Start a Pubinfo project.",
18
- author: "Werheng <werheng.zhang@gmail.com>",
19
- license: "MIT",
20
- repository: "https://github.com/werheng/pubinfo-cli",
21
- bugs: {
22
- url: "https://github.com/werheng/pubinfo-cli/issues"
23
- },
24
- bin: "./dist/cli.js",
25
- files: [
26
- "dist"
27
- ],
28
- scripts: {
29
- dev: "tsup --watch src",
30
- build: "tsup",
31
- cli: "tsx src/cli.ts"
32
- },
33
- dependencies: {
34
- "@inquirer/prompts": "^4.3.1",
35
- "ansi-colors": "^4.1.3",
36
- boxen: "^7.1.1",
37
- cfonts: "^3.2.0",
38
- "cli-progress": "^3.12.0",
39
- commander: "^12.0.0",
40
- consola: "^3.2.3",
41
- "fake-progress": "^1.0.4",
42
- giget: "^1.2.3",
43
- progress: "^2.0.3",
44
- radash: "^12.1.0"
45
- },
46
- devDependencies: {
47
- "@types/cli-progress": "^3.11.5"
48
- }
49
- };
50
-
51
- // src/rewrite.ts
52
- async function rewrite(_) {
53
- }
54
-
55
- // src/log.ts
56
- import fonts from "cfonts";
57
- function bootstrop() {
58
- printLoGo("PUBINFO");
59
- function printLoGo(logo) {
60
- fonts.say(logo, {
61
- font: "simple3d",
62
- align: "left",
63
- background: "transparent",
64
- letterSpacing: 1,
65
- lineHeight: 1,
66
- space: true,
67
- maxLength: 0,
68
- spaceless: false,
69
- gradient: ["blue", "magenta"],
70
- independentGradient: false,
71
- transitionGradient: false,
72
- env: "node"
73
- });
74
- }
75
- }
76
-
77
- // src/cli.ts
78
- async function main() {
79
- const program = new Command();
80
- program.name(package_default.name).description(package_default.description).version(package_default.version);
81
- program.parse();
82
- bootstrop();
83
- const answer = {};
84
- try {
85
- answer.dir = await input({ message: "\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0", default: "my-app" });
86
- answer.key = await input({ message: "\u8BF7\u8F93\u5165\u9879\u76EE\u6807\u8BC6(key)", default: answer.dir });
87
- } catch (error) {
88
- consola.fail("Operation cancelled");
89
- }
90
- try {
91
- await download(answer);
92
- await rewrite(answer);
93
- } catch (error) {
94
- consola.error(error);
95
- } finally {
96
- process.exit(0);
97
- }
98
- }
99
- main();
package/dist/index.js DELETED
@@ -1,6 +0,0 @@
1
- import {
2
- download
3
- } from "./chunk-WFEMVKQK.js";
4
- export {
5
- download
6
- };