vcpm 0.3.0 → 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 +41 -0
- package/dist/commands/build/index.d.ts +1 -0
- package/dist/commands/build/index.js +29 -11
- package/oclif.manifest.json +1 -1
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -8,17 +8,34 @@ new project and build it for release
|
|
|
8
8
|
[](https://oclif.io)
|
|
9
9
|
[](https://npmjs.org/package/vcpm)
|
|
10
10
|
[](https://npmjs.org/package/vcpm)
|
|
11
|
+
[](https://github.com/TraumDE/vcpm/blob/main/LICENSE)
|
|
11
12
|
|
|
12
13
|
- [Installation](#installation)
|
|
13
14
|
- [Usage](#usage)
|
|
14
15
|
- [Commands](#commands)
|
|
16
|
+
- [Roadmap](#roadmap)
|
|
17
|
+
- [Support Shells](#support-shells)
|
|
15
18
|
- [Support OS](#support-os)
|
|
16
19
|
|
|
17
20
|
## Installation
|
|
18
21
|
|
|
22
|
+
### With NPM
|
|
19
23
|
```bash
|
|
20
24
|
npm i -g vcpm
|
|
21
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)
|
|
22
39
|
|
|
23
40
|
## Usage
|
|
24
41
|
|
|
@@ -91,6 +108,30 @@ EXAMPLES
|
|
|
91
108
|
$ vcpm autocomplete --refresh-cache
|
|
92
109
|
```
|
|
93
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
|
+
|
|
94
135
|
## Support OS
|
|
95
136
|
|
|
96
137
|
### Windows
|
|
@@ -9,7 +9,6 @@ export class Build extends Command {
|
|
|
9
9
|
dev: Flags.boolean({ char: 'd', description: 'Build in development mode' }),
|
|
10
10
|
};
|
|
11
11
|
async run() {
|
|
12
|
-
this.log('Start building...');
|
|
13
12
|
await this.build();
|
|
14
13
|
}
|
|
15
14
|
async addFile(file, zipWriter) {
|
|
@@ -17,15 +16,14 @@ export class Build extends Command {
|
|
|
17
16
|
await zipWriter.add(relativePath, new BlobReader(new Blob([new Uint8Array(await fs.readFile(relativePath))])));
|
|
18
17
|
}
|
|
19
18
|
async build() {
|
|
20
|
-
|
|
21
|
-
await fs.access('dist');
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
await fs.mkdir('dist');
|
|
25
|
-
}
|
|
26
|
-
const zipFileWriter = new BlobWriter('application/zip');
|
|
27
|
-
const zipWriter = new ZipWriter(zipFileWriter);
|
|
19
|
+
const packageInfo = await this.readPackage();
|
|
28
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');
|
|
29
27
|
const files = await glob('**/*', {
|
|
30
28
|
cwd: process.cwd(),
|
|
31
29
|
dot: true,
|
|
@@ -33,12 +31,13 @@ export class Build extends Command {
|
|
|
33
31
|
nodir: true,
|
|
34
32
|
withFileTypes: true,
|
|
35
33
|
});
|
|
34
|
+
const zipFileWriter = new BlobWriter('application/zip');
|
|
35
|
+
const zipWriter = new ZipWriter(zipFileWriter);
|
|
36
36
|
const filePromises = files.map((file) => this.addFile(file, zipWriter));
|
|
37
37
|
await Promise.all(filePromises);
|
|
38
38
|
const zipBlob = await zipWriter.close();
|
|
39
39
|
const buffer = Buffer.from(await zipBlob.arrayBuffer());
|
|
40
|
-
|
|
41
|
-
await fs.writeFile(`dist/${packageInfo.id}_${packageInfo.version}.zip`, buffer);
|
|
40
|
+
await fs.writeFile(`dist/${packageInfo.id}_${packageInfo.version}${flags.dev ? '_dev' : ''}.zip`, buffer);
|
|
42
41
|
if (flags.dev) {
|
|
43
42
|
this.log('Development build completed!');
|
|
44
43
|
}
|
|
@@ -46,8 +45,27 @@ export class Build extends Command {
|
|
|
46
45
|
this.log('Production build completed!');
|
|
47
46
|
}
|
|
48
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
|
+
}
|
|
49
57
|
async readPackage() {
|
|
58
|
+
if (!(await this.fileExists('package.json'))) {
|
|
59
|
+
this.error('package.json file does not exist', {
|
|
60
|
+
code: 'ENOENT',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
50
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
|
+
}
|
|
51
69
|
return {
|
|
52
70
|
id: packageJsonParsed.id,
|
|
53
71
|
version: packageJsonParsed.version,
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vcpm",
|
|
3
3
|
"description": "VCPM - Voxel Core Project Manager",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"author": "Eugene301|TraumDE",
|
|
6
6
|
"bin": "./bin/run.js",
|
|
7
7
|
"bugs": "https://github.com/TraumDE/vcpm/issues",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@oclif/core": "^4",
|
|
10
10
|
"@oclif/plugin-autocomplete": "^3.2.39",
|
|
11
|
-
"@oclif/plugin-help": "^6",
|
|
12
|
-
"@oclif/plugin-plugins": "^5",
|
|
13
11
|
"@zip.js/zip.js": "^2.8.15",
|
|
14
12
|
"glob": "^13.0.0"
|
|
15
13
|
},
|
|
@@ -31,7 +29,7 @@
|
|
|
31
29
|
"typescript": "^5"
|
|
32
30
|
},
|
|
33
31
|
"engines": {
|
|
34
|
-
"node": ">=18.
|
|
32
|
+
"node": ">=18.4.0"
|
|
35
33
|
},
|
|
36
34
|
"files": [
|
|
37
35
|
"./bin",
|
|
@@ -44,12 +42,17 @@
|
|
|
44
42
|
"CLI",
|
|
45
43
|
"VCPM",
|
|
46
44
|
"Voxel Core Project Manager",
|
|
47
|
-
"Voxel Core"
|
|
45
|
+
"Voxel Core",
|
|
46
|
+
"Utility",
|
|
47
|
+
"Util"
|
|
48
48
|
],
|
|
49
49
|
"license": "MIT",
|
|
50
50
|
"main": "dist/index.js",
|
|
51
51
|
"type": "module",
|
|
52
52
|
"oclif": {
|
|
53
|
+
"macos": {
|
|
54
|
+
"identifier": "com.voxelcorepackagemanager.cli"
|
|
55
|
+
},
|
|
53
56
|
"bin": "vcpm",
|
|
54
57
|
"dirname": "vcpm",
|
|
55
58
|
"commands": "./dist/commands",
|