vcpm 0.1.1 → 0.2.0
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 +7 -1
- package/dist/commands/build.js +9 -8
- package/dist/index.js +1 -0
- package/dist/types/buildOptions.js +2 -0
- package/dist/types/index.js +1 -0
- package/package.json +11 -4
- package/.editorconfig +0 -8
- package/.gitattributes +0 -4
- package/.vscode/extensions.json +0 -5
- package/.vscode/settings.json +0 -8
- package/.yarnrc.yml +0 -1
- package/src/commands/build.ts +0 -58
- package/src/index.ts +0 -19
- package/src/types/index.ts +0 -1
- package/src/types/packInfo.ts +0 -4
- package/tsconfig.json +0 -18
package/README.md
CHANGED
|
@@ -10,10 +10,16 @@ npm i -g vcpm
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
+
### Build
|
|
13
14
|
```
|
|
14
15
|
vcpm build
|
|
15
16
|
```
|
|
17
|
+
Creates a zip archive for production use, removing in production build all files and folders which starts on dot, and remove type declarations folder.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
### Development Build
|
|
20
|
+
```
|
|
21
|
+
vcpm build -d | -dev
|
|
22
|
+
```
|
|
23
|
+
Creates a zip archive for development use, without removing any files or folders.
|
|
18
24
|
|
|
19
25
|
Archive format [pack_id]\_[version].zip
|
package/dist/commands/build.js
CHANGED
|
@@ -17,21 +17,22 @@ const getPackData = () => {
|
|
|
17
17
|
version: jsonData.version,
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
const createDistZip = () => {
|
|
20
|
+
const createDistZip = (isDev) => {
|
|
21
21
|
if (!isExists("package.json")) {
|
|
22
22
|
console.log("Not found package.json!");
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
if (isExists("dist/build.zip")) {
|
|
26
|
-
fs_1.default.rmSync("dist/build.zip");
|
|
27
|
-
}
|
|
28
25
|
const packData = getPackData();
|
|
29
|
-
const
|
|
26
|
+
const distPath = `dist/${packData.id}_${packData.version}.zip`;
|
|
27
|
+
if (isExists(distPath)) {
|
|
28
|
+
fs_1.default.rmSync(distPath);
|
|
29
|
+
}
|
|
30
|
+
const output = fs_1.default.createWriteStream(distPath);
|
|
30
31
|
const archive = (0, archiver_1.default)("zip", { zlib: { level: 9 } });
|
|
31
32
|
archive.pipe(output);
|
|
32
33
|
archive.glob("**/*", {
|
|
33
34
|
cwd: ".",
|
|
34
|
-
ignore: ["**/.*/**", "**/.*", "modules/types/**", "dist/**"],
|
|
35
|
+
ignore: isDev ? [] : ["**/.*/**", "**/.*", "modules/types/**", "dist/**"],
|
|
35
36
|
dot: true,
|
|
36
37
|
});
|
|
37
38
|
archive.finalize();
|
|
@@ -42,7 +43,7 @@ const checkDistFolder = () => {
|
|
|
42
43
|
fs_1.default.mkdirSync("dist");
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
exports.default = () => {
|
|
46
|
+
exports.default = (options) => {
|
|
46
47
|
checkDistFolder();
|
|
47
|
-
createDistZip();
|
|
48
|
+
createDistZip(options.dev);
|
|
48
49
|
};
|
package/dist/index.js
CHANGED
package/dist/types/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vcpm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "VCPM - Voxel Core Project Manager. Is unoficall CLI util for managing content packs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"preferGlobal": "true",
|
|
7
|
-
"bin":
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
"bin": "./dist/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
10
13
|
"scripts": {
|
|
11
14
|
"build": "tsc",
|
|
12
15
|
"dev": "ts-node src/index.ts"
|
|
@@ -16,6 +19,10 @@
|
|
|
16
19
|
"CLI",
|
|
17
20
|
"Utility"
|
|
18
21
|
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/TraumDE/vcpm.git"
|
|
25
|
+
},
|
|
19
26
|
"author": "Eugene301|TraumDE",
|
|
20
27
|
"license": "MIT",
|
|
21
28
|
"packageManager": "yarn@4.12.0",
|
package/.editorconfig
DELETED
package/.gitattributes
DELETED
package/.vscode/extensions.json
DELETED
package/.vscode/settings.json
DELETED
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
package/src/commands/build.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { cwd } from "process";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import { join } from "path";
|
|
4
|
-
import archiver from "archiver";
|
|
5
|
-
import type { PackInfo } from "../types";
|
|
6
|
-
|
|
7
|
-
const isExists = (path: string): boolean => {
|
|
8
|
-
return fs.existsSync(join(cwd(), path));
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const getPackData = (): PackInfo => {
|
|
12
|
-
const jsonData = JSON.parse(
|
|
13
|
-
fs.readFileSync(join(cwd(), "package.json"), "utf-8")
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
id: jsonData.id,
|
|
18
|
-
version: jsonData.version,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const createDistZip = (): void => {
|
|
23
|
-
if (!isExists("package.json")) {
|
|
24
|
-
console.log("Not found package.json!");
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const packData: PackInfo = getPackData();
|
|
29
|
-
const distPath = `dist/${packData.id}_${packData.version}.zip`;
|
|
30
|
-
|
|
31
|
-
if (isExists(distPath)) {
|
|
32
|
-
fs.rmSync(distPath);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const output = fs.createWriteStream(distPath);
|
|
36
|
-
const archive = archiver("zip", { zlib: { level: 9 } });
|
|
37
|
-
|
|
38
|
-
archive.pipe(output);
|
|
39
|
-
archive.glob("**/*", {
|
|
40
|
-
cwd: ".",
|
|
41
|
-
ignore: ["**/.*/**", "**/.*", "modules/types/**", "dist/**"],
|
|
42
|
-
dot: true,
|
|
43
|
-
});
|
|
44
|
-
archive.finalize();
|
|
45
|
-
|
|
46
|
-
console.log("Project builded for production!");
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const checkDistFolder = (): void => {
|
|
50
|
-
if (!isExists("dist")) {
|
|
51
|
-
fs.mkdirSync("dist");
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default (): void => {
|
|
56
|
-
checkDistFolder();
|
|
57
|
-
createDistZip();
|
|
58
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
import build from "./commands/build";
|
|
4
|
-
|
|
5
|
-
const program: Command = new Command();
|
|
6
|
-
|
|
7
|
-
program
|
|
8
|
-
.name("vcpm")
|
|
9
|
-
.description(
|
|
10
|
-
"VCPM - Voxel Core Project Manager. Is unoficall CLI util for managing content packs"
|
|
11
|
-
)
|
|
12
|
-
.version("0.1.0");
|
|
13
|
-
|
|
14
|
-
program
|
|
15
|
-
.command("build")
|
|
16
|
-
.description("Build project for production")
|
|
17
|
-
.action(build);
|
|
18
|
-
|
|
19
|
-
program.parse();
|
package/src/types/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./packInfo";
|
package/src/types/packInfo.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"forceConsistentCasingInFileNames": true,
|
|
13
|
-
"declaration": false,
|
|
14
|
-
"sourceMap": false,
|
|
15
|
-
"resolveJsonModule": true
|
|
16
|
-
},
|
|
17
|
-
"include": ["src/**/*"]
|
|
18
|
-
}
|