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 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
- - Creates a zip archive for production use, removing in production build all files and folders which starts on dot, and remove type declarations folder.
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
@@ -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 output = fs_1.default.createWriteStream(`dist/${packData.id}_${packData.version}.zip`);
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
@@ -14,5 +14,6 @@ program
14
14
  program
15
15
  .command("build")
16
16
  .description("Build project for production")
17
+ .option("-d, --dev", "Build project for development", false)
17
18
  .action(build_1.default);
18
19
  program.parse();
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./packInfo"), exports);
18
+ __exportStar(require("./buildOptions"), exports);
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "vcpm",
3
- "version": "0.1.1",
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
- "vcpm": "./dist/index.js"
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
@@ -1,8 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- indent_size = 2
7
- indent_style = space
8
- insert_final_newline = true
package/.gitattributes DELETED
@@ -1,4 +0,0 @@
1
- /.yarn/** linguist-vendored
2
- /.yarn/releases/* binary
3
- /.yarn/plugins/**/* binary
4
- /.pnp.* binary linguist-generated
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "arcanis.vscode-zipfs"
4
- ]
5
- }
@@ -1,8 +0,0 @@
1
- {
2
- "search.exclude": {
3
- "**/.yarn": true,
4
- "**/.pnp.*": true
5
- },
6
- "typescript.tsdk": ".yarn/sdks/typescript/lib",
7
- "typescript.enablePromptUseWorkspaceTsdk": true
8
- }
package/.yarnrc.yml DELETED
@@ -1 +0,0 @@
1
- nodeLinker: node-modules
@@ -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();
@@ -1 +0,0 @@
1
- export * from "./packInfo";
@@ -1,4 +0,0 @@
1
- export interface PackInfo {
2
- id: string;
3
- version: string;
4
- }
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
- }