vcpm 0.2.2 → 0.4.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 +132 -10
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +5 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/commands/build/index.d.ts +12 -0
- package/dist/commands/build/index.js +74 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -19
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -18
- package/dist/types/package-info.d.ts +4 -0
- package/dist/types/package-info.js +1 -0
- package/oclif.manifest.json +34 -0
- package/package.json +71 -29
- package/dist/commands/build.js +0 -54
- package/dist/types/buildOptions.js +0 -2
- package/dist/types/packInfo.js +0 -2
package/README.md
CHANGED
|
@@ -1,25 +1,147 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# VCPM - Voxel Core Project Manager
|
|
2
4
|
|
|
3
|
-
CLI util for managing voxel core content packs, with vcpm we can start
|
|
5
|
+
CLI util for managing voxel core content packs, with vcpm we can start
|
|
6
|
+
new project and build it for release
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
[](https://oclif.io)
|
|
9
|
+
[](https://npmjs.org/package/vcpm)
|
|
10
|
+
[](https://npmjs.org/package/vcpm)
|
|
11
|
+
[](https://github.com/TraumDE/vcpm/blob/main/LICENSE)
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
- [Installation](#installation)
|
|
14
|
+
- [Usage](#usage)
|
|
15
|
+
- [Commands](#commands)
|
|
16
|
+
- [Roadmap](#roadmap)
|
|
17
|
+
- [Support Shells](#support-shells)
|
|
18
|
+
- [Support OS](#support-os)
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
### With NPM
|
|
23
|
+
```bash
|
|
8
24
|
npm i -g vcpm
|
|
9
25
|
```
|
|
26
|
+
### Standalone
|
|
27
|
+
#### Windows
|
|
28
|
+
- [Windows-arm64 (.exe)](https://github.com/TraumDE/vcpm/releases/download/0.4.0/vcpm-v0.4.0-ef8c1e4-arm64.exe)
|
|
29
|
+
- [Windows-x64 (.exe)](https://github.com/TraumDE/vcpm/releases/download/0.4.0/vcpm-v0.4.0-ef8c1e4-x64.exe)
|
|
30
|
+
#### Linux
|
|
31
|
+
- [Deb-amd64 (.deb)](https://github.com/TraumDE/vcpm/releases/download/0.4.0/vcpm_0.4.0.ef8c1e4-1_amd64.deb)
|
|
32
|
+
- [Deb-arm64 (.deb)](https://github.com/TraumDE/vcpm/releases/download/0.4.0/vcpm_0.4.0.ef8c1e4-1_arm64.deb)
|
|
33
|
+
|
|
34
|
+
#### MacOS
|
|
35
|
+
- [MacOS-x64 (.pkg)](https://github.com/TraumDE/vcpm/releases/download/0.4.0/vcpm-v0.4.0-ef8c1e4-x64.pkg)
|
|
36
|
+
- [MacOS-arm64 (.pkg)](https://github.com/TraumDE/vcpm/releases/download/0.4.0/vcpm-v0.4.0-ef8c1e4-arm64.pkg)
|
|
37
|
+
|
|
38
|
+
Other releases can be found in latest release [here](https://github.com/TraumDE/vcpm/releases/latest)
|
|
10
39
|
|
|
11
40
|
## Usage
|
|
12
41
|
|
|
13
|
-
###
|
|
42
|
+
### Run command
|
|
43
|
+
|
|
44
|
+
```Bash
|
|
45
|
+
vcpm COMMAND
|
|
14
46
|
```
|
|
15
|
-
|
|
47
|
+
|
|
48
|
+
### Check version
|
|
49
|
+
|
|
50
|
+
```Bash
|
|
51
|
+
vcpm --version | -v
|
|
16
52
|
```
|
|
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.
|
|
18
53
|
|
|
19
|
-
###
|
|
54
|
+
### Help with command
|
|
55
|
+
|
|
56
|
+
```Bash
|
|
57
|
+
vcpm COMMAND --help
|
|
20
58
|
```
|
|
21
|
-
|
|
59
|
+
|
|
60
|
+
## Commands
|
|
61
|
+
|
|
62
|
+
- [`vcpm build`](#vcpm-build)
|
|
63
|
+
- [`vcpm autocomplete`](#vcpm-autocomplete)
|
|
64
|
+
|
|
65
|
+
### `vcpm build`
|
|
66
|
+
|
|
67
|
+
Build project
|
|
68
|
+
|
|
69
|
+
```Bash
|
|
70
|
+
USAGE
|
|
71
|
+
$ vcpm build [-d]
|
|
72
|
+
|
|
73
|
+
FLAGS
|
|
74
|
+
-d, --dev build in development mode
|
|
75
|
+
|
|
76
|
+
DESCRIPTION
|
|
77
|
+
build project
|
|
22
78
|
```
|
|
23
|
-
Creates a zip archive for development use, without removing any files or folders.
|
|
24
79
|
|
|
25
|
-
|
|
80
|
+
_See code: [src/commands/build/index.ts](https://github.com/TraumDE/vcpm/blob/main/src/commands/build/index.ts)_
|
|
81
|
+
|
|
82
|
+
### `vcpm autocomplete`
|
|
83
|
+
|
|
84
|
+
Display autocomplete installation instructions.
|
|
85
|
+
|
|
86
|
+
```Bash
|
|
87
|
+
USAGE
|
|
88
|
+
$ vcpm autocomplete [SHELL] [-r]
|
|
89
|
+
|
|
90
|
+
ARGUMENTS
|
|
91
|
+
[SHELL] (zsh|bash|powershell) Shell type
|
|
92
|
+
|
|
93
|
+
FLAGS
|
|
94
|
+
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
95
|
+
|
|
96
|
+
DESCRIPTION
|
|
97
|
+
Display autocomplete installation instructions.
|
|
98
|
+
|
|
99
|
+
EXAMPLES
|
|
100
|
+
$ vcpm autocomplete
|
|
101
|
+
|
|
102
|
+
$ vcpm autocomplete bash
|
|
103
|
+
|
|
104
|
+
$ vcpm autocomplete zsh
|
|
105
|
+
|
|
106
|
+
$ vcpm autocomplete powershell
|
|
107
|
+
|
|
108
|
+
$ vcpm autocomplete --refresh-cache
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Roadmap
|
|
112
|
+
|
|
113
|
+
### Plans
|
|
114
|
+
|
|
115
|
+
- [ ] Made standalone verison
|
|
116
|
+
- [ ] Package management function
|
|
117
|
+
- [ ] Create new project command
|
|
118
|
+
- [ ] More features coming soon
|
|
119
|
+
- [ ] Project Website
|
|
120
|
+
|
|
121
|
+
### Ready
|
|
122
|
+
|
|
123
|
+
- [x] Building project for production and development
|
|
124
|
+
- [x] Autocomplete for crossplaforms
|
|
125
|
+
|
|
126
|
+
## Support Shells
|
|
127
|
+
|
|
128
|
+
- [x] Bash
|
|
129
|
+
- [x] Zsh
|
|
130
|
+
- [x] Powershell 7+
|
|
131
|
+
- [x] Fish (Without Autocomplete)
|
|
132
|
+
- [x] CMD (Without Autocomplete)
|
|
133
|
+
- [x] Powershell < 7 (Without Autocomplete)
|
|
134
|
+
|
|
135
|
+
## Support OS
|
|
136
|
+
|
|
137
|
+
### Windows
|
|
138
|
+
|
|
139
|
+
- Windows 11 ❓ - 0.2.2 (need update)
|
|
140
|
+
|
|
141
|
+
### Linux
|
|
142
|
+
|
|
143
|
+
- Arch Linux ✅ - 0.3.0
|
|
144
|
+
|
|
145
|
+
### MacOS
|
|
146
|
+
|
|
147
|
+
No tests on MacOS
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export declare class Build extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
dev: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
};
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
private addFile;
|
|
9
|
+
private build;
|
|
10
|
+
private fileExists;
|
|
11
|
+
private readPackage;
|
|
12
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { BlobReader, BlobWriter, ZipWriter } from '@zip.js/zip.js';
|
|
3
|
+
import { glob } from 'glob';
|
|
4
|
+
import { Buffer } from 'node:buffer';
|
|
5
|
+
import { promises as fs } from 'node:fs';
|
|
6
|
+
export class Build extends Command {
|
|
7
|
+
static description = 'Build project';
|
|
8
|
+
static flags = {
|
|
9
|
+
dev: Flags.boolean({ char: 'd', description: 'Build in development mode' }),
|
|
10
|
+
};
|
|
11
|
+
async run() {
|
|
12
|
+
await this.build();
|
|
13
|
+
}
|
|
14
|
+
async addFile(file, zipWriter) {
|
|
15
|
+
const relativePath = file.relative();
|
|
16
|
+
await zipWriter.add(relativePath, new BlobReader(new Blob([new Uint8Array(await fs.readFile(relativePath))])));
|
|
17
|
+
}
|
|
18
|
+
async build() {
|
|
19
|
+
const packageInfo = await this.readPackage();
|
|
20
|
+
const { flags } = await this.parse(Build);
|
|
21
|
+
this.log('Start building...');
|
|
22
|
+
if (await this.fileExists('dist')) {
|
|
23
|
+
this.log('Remove previous build...');
|
|
24
|
+
await fs.rm('dist', { force: true, recursive: true });
|
|
25
|
+
}
|
|
26
|
+
await fs.mkdir('dist');
|
|
27
|
+
const files = await glob('**/*', {
|
|
28
|
+
cwd: process.cwd(),
|
|
29
|
+
dot: true,
|
|
30
|
+
ignore: flags.dev ? [] : ['**/.*', '**/.*/**', 'dist/**/*', 'modules/types/**/*'],
|
|
31
|
+
nodir: true,
|
|
32
|
+
withFileTypes: true,
|
|
33
|
+
});
|
|
34
|
+
const zipFileWriter = new BlobWriter('application/zip');
|
|
35
|
+
const zipWriter = new ZipWriter(zipFileWriter);
|
|
36
|
+
const filePromises = files.map((file) => this.addFile(file, zipWriter));
|
|
37
|
+
await Promise.all(filePromises);
|
|
38
|
+
const zipBlob = await zipWriter.close();
|
|
39
|
+
const buffer = Buffer.from(await zipBlob.arrayBuffer());
|
|
40
|
+
await fs.writeFile(`dist/${packageInfo.id}_${packageInfo.version}${flags.dev ? '_dev' : ''}.zip`, buffer);
|
|
41
|
+
if (flags.dev) {
|
|
42
|
+
this.log('Development build completed!');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.log('Production build completed!');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async fileExists(file) {
|
|
49
|
+
try {
|
|
50
|
+
await fs.access(file, fs.constants.F_OK);
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async readPackage() {
|
|
58
|
+
if (!(await this.fileExists('package.json'))) {
|
|
59
|
+
this.error('package.json file does not exist', {
|
|
60
|
+
code: 'ENOENT',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const packageJsonParsed = JSON.parse(await fs.readFile('package.json', 'utf8'));
|
|
64
|
+
if (!packageJsonParsed.id && !packageJsonParsed.version) {
|
|
65
|
+
this.error('Its not voxel core content pack', {
|
|
66
|
+
code: 'EINVAL',
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
id: packageJsonParsed.id,
|
|
71
|
+
version: packageJsonParsed.version,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from '@oclif/core';
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const commander_1 = require("commander");
|
|
8
|
-
const build_1 = __importDefault(require("./commands/build"));
|
|
9
|
-
const program = new commander_1.Command();
|
|
10
|
-
program
|
|
11
|
-
.name("vcpm")
|
|
12
|
-
.description("VCPM - Voxel Core Project Manager. Is unoficall CLI util for managing content packs")
|
|
13
|
-
.version("0.1.0");
|
|
14
|
-
program
|
|
15
|
-
.command("build")
|
|
16
|
-
.description("Build project for production")
|
|
17
|
-
.option("-d, --dev", "Build project for development", false)
|
|
18
|
-
.action(build_1.default);
|
|
19
|
-
program.parse();
|
|
1
|
+
export { run } from '@oclif/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './package-info.js';
|
package/dist/types/index.js
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./packInfo"), exports);
|
|
18
|
-
__exportStar(require("./buildOptions"), exports);
|
|
1
|
+
export * from './package-info.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"build": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Build project",
|
|
7
|
+
"flags": {
|
|
8
|
+
"dev": {
|
|
9
|
+
"char": "d",
|
|
10
|
+
"description": "Build in development mode",
|
|
11
|
+
"name": "dev",
|
|
12
|
+
"allowNo": false,
|
|
13
|
+
"type": "boolean"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"hasDynamicHelp": false,
|
|
17
|
+
"hiddenAliases": [],
|
|
18
|
+
"id": "build",
|
|
19
|
+
"pluginAlias": "vcpm",
|
|
20
|
+
"pluginName": "vcpm",
|
|
21
|
+
"pluginType": "core",
|
|
22
|
+
"strict": true,
|
|
23
|
+
"enableJsonFlag": false,
|
|
24
|
+
"isESM": true,
|
|
25
|
+
"relativePath": [
|
|
26
|
+
"dist",
|
|
27
|
+
"commands",
|
|
28
|
+
"build",
|
|
29
|
+
"index.js"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"version": "0.4.0"
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,39 +1,81 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vcpm",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"description": "VCPM - Voxel Core Project Manager",
|
|
4
|
+
"version": "0.4.0",
|
|
5
|
+
"author": "Eugene301|TraumDE",
|
|
6
|
+
"bin": "./bin/run.js",
|
|
7
|
+
"bugs": "https://github.com/TraumDE/vcpm/issues",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@oclif/core": "^4",
|
|
10
|
+
"@oclif/plugin-autocomplete": "^3.2.39",
|
|
11
|
+
"@zip.js/zip.js": "^2.8.15",
|
|
12
|
+
"glob": "^13.0.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@eslint/compat": "^1",
|
|
16
|
+
"@oclif/prettier-config": "^0.2.1",
|
|
17
|
+
"@oclif/test": "^4",
|
|
18
|
+
"@types/chai": "^4",
|
|
19
|
+
"@types/mocha": "^10",
|
|
20
|
+
"@types/node": "^18",
|
|
21
|
+
"chai": "^4",
|
|
22
|
+
"eslint": "^9",
|
|
23
|
+
"eslint-config-oclif": "^6",
|
|
24
|
+
"eslint-config-prettier": "^10",
|
|
25
|
+
"mocha": "^10",
|
|
26
|
+
"oclif": "^4",
|
|
27
|
+
"shx": "^0.3.3",
|
|
28
|
+
"ts-node": "^10",
|
|
29
|
+
"typescript": "^5"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.4.0"
|
|
33
|
+
},
|
|
8
34
|
"files": [
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
35
|
+
"./bin",
|
|
36
|
+
"./dist",
|
|
37
|
+
"./oclif.manifest.json"
|
|
12
38
|
],
|
|
13
|
-
"
|
|
14
|
-
"build": "tsc",
|
|
15
|
-
"dev": "ts-node src/index.ts"
|
|
16
|
-
},
|
|
39
|
+
"homepage": "https://github.com/TraumDE/vcpm",
|
|
17
40
|
"keywords": [
|
|
18
|
-
"
|
|
41
|
+
"oclif",
|
|
19
42
|
"CLI",
|
|
20
|
-
"
|
|
43
|
+
"VCPM",
|
|
44
|
+
"Voxel Core Project Manager",
|
|
45
|
+
"Voxel Core",
|
|
46
|
+
"Utility",
|
|
47
|
+
"Util"
|
|
21
48
|
],
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "https://github.com/TraumDE/vcpm.git"
|
|
25
|
-
},
|
|
26
|
-
"author": "Eugene301|TraumDE",
|
|
27
49
|
"license": "MIT",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
"main": "dist/index.js",
|
|
51
|
+
"type": "module",
|
|
52
|
+
"oclif": {
|
|
53
|
+
"macos": {
|
|
54
|
+
"identifier": "com.voxelcorepackagemanager.cli"
|
|
55
|
+
},
|
|
56
|
+
"bin": "vcpm",
|
|
57
|
+
"dirname": "vcpm",
|
|
58
|
+
"commands": "./dist/commands",
|
|
59
|
+
"plugins": [
|
|
60
|
+
"@oclif/plugin-autocomplete"
|
|
61
|
+
],
|
|
62
|
+
"topicSeparator": " ",
|
|
63
|
+
"topics": {
|
|
64
|
+
"hello": {
|
|
65
|
+
"description": "Say hello to the world and others"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
34
68
|
},
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
69
|
+
"repository": "TraumDE/vcpm",
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
72
|
+
"lint": "eslint",
|
|
73
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
74
|
+
"posttest": "yarn lint",
|
|
75
|
+
"prepack": "oclif manifest && oclif readme",
|
|
76
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
77
|
+
"version": "oclif readme && git add README.md"
|
|
78
|
+
},
|
|
79
|
+
"types": "dist/index.d.ts",
|
|
80
|
+
"packageManager": "yarn@4.12.0"
|
|
39
81
|
}
|
package/dist/commands/build.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const process_1 = require("process");
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const archiver_1 = __importDefault(require("archiver"));
|
|
10
|
-
const isExists = (path) => {
|
|
11
|
-
return fs_1.default.existsSync((0, path_1.join)((0, process_1.cwd)(), path));
|
|
12
|
-
};
|
|
13
|
-
const getPackData = () => {
|
|
14
|
-
const jsonData = JSON.parse(fs_1.default.readFileSync((0, path_1.join)((0, process_1.cwd)(), "package.json"), "utf-8"));
|
|
15
|
-
return {
|
|
16
|
-
id: jsonData.id,
|
|
17
|
-
version: jsonData.version,
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
const createDistZip = (isDev) => {
|
|
21
|
-
if (!isExists("package.json")) {
|
|
22
|
-
console.log("Not found package.json!");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const packData = getPackData();
|
|
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);
|
|
31
|
-
const archive = (0, archiver_1.default)("zip", { zlib: { level: 9 } });
|
|
32
|
-
archive.pipe(output);
|
|
33
|
-
archive.glob("**/*", {
|
|
34
|
-
cwd: ".",
|
|
35
|
-
ignore: isDev ? [] : ["**/.*/**", "**/.*", "modules/types/**", "dist/**"],
|
|
36
|
-
dot: true,
|
|
37
|
-
});
|
|
38
|
-
archive.finalize();
|
|
39
|
-
if (isDev) {
|
|
40
|
-
console.log("Project builded for development!");
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
console.log("Project builded for production!");
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const checkDistFolder = () => {
|
|
47
|
-
if (!isExists("dist")) {
|
|
48
|
-
fs_1.default.mkdirSync("dist");
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
exports.default = (options) => {
|
|
52
|
-
checkDistFolder();
|
|
53
|
-
createDistZip(options.dev);
|
|
54
|
-
};
|
package/dist/types/packInfo.js
DELETED