@utoo/pack-cli 0.0.1-alpha.14
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/README.md +1 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +7 -0
- package/dist/commands/build.d.ts +10 -0
- package/dist/commands/build.js +70 -0
- package/dist/commands/dev.d.ts +10 -0
- package/dist/commands/dev.js +70 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class Build extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
root: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const core_1 = require("@oclif/core");
|
|
40
|
+
const utooPack = __importStar(require("@utoo/pack"));
|
|
41
|
+
const fs_1 = __importDefault(require("fs"));
|
|
42
|
+
const path_1 = __importDefault(require("path"));
|
|
43
|
+
class Build extends core_1.Command {
|
|
44
|
+
static description = "Utoo pack build";
|
|
45
|
+
static examples = [
|
|
46
|
+
`<%= config.bin %> <%= command.id %> build --project .`,
|
|
47
|
+
`<%= config.bin %> <%= command.id %> build --project . --root ../..`,
|
|
48
|
+
];
|
|
49
|
+
static flags = {
|
|
50
|
+
project: core_1.Flags.string({
|
|
51
|
+
char: "p",
|
|
52
|
+
description: "Set the project path",
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
root: core_1.Flags.string({
|
|
56
|
+
char: "r",
|
|
57
|
+
description: "Set the root path",
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
async run() {
|
|
62
|
+
const { flags: { project, root }, } = await this.parse(Build);
|
|
63
|
+
const cwd = process.cwd();
|
|
64
|
+
const projectOptions = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(cwd, project || "", "project_options.json"), {
|
|
65
|
+
encoding: "utf-8",
|
|
66
|
+
}));
|
|
67
|
+
await utooPack.build(projectOptions, path_1.default.resolve(cwd, project || cwd), path_1.default.resolve(cwd, root || project || cwd));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.default = Build;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class Dev extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
root: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const core_1 = require("@oclif/core");
|
|
40
|
+
const utooPack = __importStar(require("@utoo/pack"));
|
|
41
|
+
const fs_1 = __importDefault(require("fs"));
|
|
42
|
+
const path_1 = __importDefault(require("path"));
|
|
43
|
+
class Dev extends core_1.Command {
|
|
44
|
+
static description = "Utoo pack dev";
|
|
45
|
+
static examples = [
|
|
46
|
+
`<%= config.bin %> <%= command.id %> dev --project .`,
|
|
47
|
+
`<%= config.bin %> <%= command.id %> dev --project . --root ../..`,
|
|
48
|
+
];
|
|
49
|
+
static flags = {
|
|
50
|
+
project: core_1.Flags.string({
|
|
51
|
+
char: "p",
|
|
52
|
+
description: "Set the project path",
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
root: core_1.Flags.string({
|
|
56
|
+
char: "r",
|
|
57
|
+
description: "Set the root path",
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
async run() {
|
|
62
|
+
const { flags: { project, root }, } = await this.parse(Dev);
|
|
63
|
+
const cwd = process.cwd();
|
|
64
|
+
const projectOptions = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(cwd, project || "", "project_options.json"), {
|
|
65
|
+
encoding: "utf-8",
|
|
66
|
+
}));
|
|
67
|
+
await utooPack.serve(projectOptions, path_1.default.resolve(cwd, project || cwd), path_1.default.resolve(cwd, root || project || cwd));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.default = Dev;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from "@oclif/core";
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@utoo/pack-cli",
|
|
3
|
+
"description": "Utoo pack cli",
|
|
4
|
+
"version": "0.0.1-alpha.14",
|
|
5
|
+
"author": "xusd320",
|
|
6
|
+
"bin": {
|
|
7
|
+
"utoo-pack": "./bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@oclif/core": "^4",
|
|
11
|
+
"@utoo/pack": "0.0.1-alpha.14"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/node": "^18",
|
|
15
|
+
"oclif": "^4",
|
|
16
|
+
"ts-node": "^10.9.2",
|
|
17
|
+
"typescript": "^5"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18.0.0"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"./bin",
|
|
24
|
+
"./dist",
|
|
25
|
+
"./oclif.manifest.json"
|
|
26
|
+
],
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"main": "dist/index.js",
|
|
29
|
+
"oclif": {
|
|
30
|
+
"bin": "utoo-pack",
|
|
31
|
+
"commands": "./dist/commands",
|
|
32
|
+
"topicSeparator": " ",
|
|
33
|
+
"topics": {
|
|
34
|
+
"build": {
|
|
35
|
+
"description": "Build with production"
|
|
36
|
+
},
|
|
37
|
+
"dev": {
|
|
38
|
+
"description": "Build with development and HMR"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "rm -rf dist && tsc -b",
|
|
44
|
+
"prepublishOnly": "npm run build"
|
|
45
|
+
},
|
|
46
|
+
"types": "dist/index.d.ts"
|
|
47
|
+
}
|