jizy-packer 2.0.0 → 2.0.2
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/lib/Cli.js +43 -0
- package/lib/index.js +16 -0
- package/package.json +3 -32
- package/bin/jpack.js +0 -38
package/lib/Cli.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import yargs from "yargs/yargs";
|
|
2
|
+
import { hideBin } from 'yargs/helpers';
|
|
3
|
+
import jPackBuild from "./Build.js";
|
|
4
|
+
import jPackConfig from "./Config.js";
|
|
5
|
+
|
|
6
|
+
const jPackCli = function (cfg) {
|
|
7
|
+
jPackConfig.set('basePath', process.cwd());
|
|
8
|
+
jPackConfig.sets(cfg);
|
|
9
|
+
|
|
10
|
+
const command = yargs(hideBin(process.argv))
|
|
11
|
+
.usage('Usage: $0 <command> [options]')
|
|
12
|
+
.option('target', {
|
|
13
|
+
alias: 't',
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Target path',
|
|
16
|
+
default: '',
|
|
17
|
+
})
|
|
18
|
+
.option('name', {
|
|
19
|
+
alias: 'n',
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Set the build name',
|
|
22
|
+
default: '',
|
|
23
|
+
})
|
|
24
|
+
.option('zip', {
|
|
25
|
+
alias: 'z',
|
|
26
|
+
type: 'boolean',
|
|
27
|
+
description: 'Create a zip file',
|
|
28
|
+
default: false,
|
|
29
|
+
})
|
|
30
|
+
.option('debug', {
|
|
31
|
+
alias: 'd',
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
description: 'Enable debug mode',
|
|
34
|
+
default: false,
|
|
35
|
+
})
|
|
36
|
+
.help()
|
|
37
|
+
.alias('help', 'h');
|
|
38
|
+
|
|
39
|
+
const argv = command.parse();
|
|
40
|
+
jPackBuild(argv);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default jPackCli;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import jPackBuild from './Build.js';
|
|
2
|
+
import jPackCli from './Cli.js';
|
|
3
|
+
import jPackConfig from './Config.js';
|
|
4
|
+
import LogMe from './LogMe.js';
|
|
5
|
+
import jPackRollup from './Rollup.js';
|
|
6
|
+
import { removeEmptyDirs, cleanBuildFolder } from './utils.js';
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
jPackBuild,
|
|
10
|
+
jPackCli,
|
|
11
|
+
jPackConfig,
|
|
12
|
+
LogMe,
|
|
13
|
+
jPackRollup,
|
|
14
|
+
removeEmptyDirs,
|
|
15
|
+
cleanBuildFolder
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jizy-packer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib/*.js"
|
|
7
7
|
],
|
|
8
|
-
"
|
|
9
|
-
"jizy-pack": "./bin/jpack.js"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"test": "jest",
|
|
13
|
-
"build:export": "node ./bin/jpack.js -t perso",
|
|
14
|
-
"build:export-debug": "node ./bin/jpack.js -t perso --debug",
|
|
15
|
-
"build:dist": "node ./bin/jpack.js -t dist -n default",
|
|
16
|
-
"build:dist-debug": "node ./bin/jpack.js -t dist -n default --debug"
|
|
17
|
-
},
|
|
8
|
+
"main": "lib/index.js",
|
|
18
9
|
"repository": {
|
|
19
10
|
"type": "git",
|
|
20
11
|
"url": "git+https://github.com/joffreydemetz/jizy-packer.git"
|
|
@@ -27,35 +18,15 @@
|
|
|
27
18
|
"author": "Joffrey Demetz <joffrey.demetz@gmail.com> (https://joffreydemetz.com/)",
|
|
28
19
|
"license": "MIT",
|
|
29
20
|
"description": "CLI app to generate optimized builds.",
|
|
30
|
-
"
|
|
31
|
-
"@babel/core": "^7.26.10",
|
|
32
|
-
"@babel/preset-env": "^7.26.9",
|
|
21
|
+
"dependencies": {
|
|
33
22
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
34
23
|
"@rollup/plugin-json": "^6.1.0",
|
|
35
24
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
36
25
|
"@rollup/plugin-terser": "^0.4.4",
|
|
37
26
|
"@rollup/plugin-url": "^8.0.2",
|
|
38
|
-
"autoprefixer": "^10.4.21",
|
|
39
|
-
"babel-jest": "^29.7.0",
|
|
40
|
-
"clean-css": "^5.3.3",
|
|
41
|
-
"cross-env": "^7.0.3",
|
|
42
|
-
"cssnano": "^7.0.6",
|
|
43
|
-
"jest": "^29.7.0",
|
|
44
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
45
|
-
"jsdom": "^26.1.0",
|
|
46
|
-
"less": "^4.3.0",
|
|
47
|
-
"less-plugin-clean-css": "^1.6.0",
|
|
48
|
-
"postcss": "^8.5.3",
|
|
49
27
|
"rollup": "^4.40.1",
|
|
50
28
|
"rollup-plugin-copy": "^3.5.0",
|
|
51
29
|
"rollup-plugin-delete": "^3.0.1",
|
|
52
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
53
30
|
"yargs": "^17.7.2"
|
|
54
|
-
},
|
|
55
|
-
"jest": {
|
|
56
|
-
"testEnvironment": "jsdom",
|
|
57
|
-
"transform": {
|
|
58
|
-
"^.+\\.js$": "babel-jest"
|
|
59
|
-
}
|
|
60
31
|
}
|
|
61
32
|
}
|
package/bin/jpack.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import yargs from "yargs/yargs";
|
|
2
|
-
import { hideBin } from 'yargs/helpers';
|
|
3
|
-
import jPackBuild from "../Build.js";
|
|
4
|
-
import jPackConfig from "../Config.js";
|
|
5
|
-
|
|
6
|
-
jPackConfig.set('basePath', process.cwd());
|
|
7
|
-
|
|
8
|
-
const command = yargs(hideBin(process.argv))
|
|
9
|
-
.usage('Usage: $0 <command> [options]')
|
|
10
|
-
.option('target', {
|
|
11
|
-
alias: 't',
|
|
12
|
-
type: 'string',
|
|
13
|
-
description: 'Target path',
|
|
14
|
-
default: '',
|
|
15
|
-
})
|
|
16
|
-
.option('name', {
|
|
17
|
-
alias: 'n',
|
|
18
|
-
type: 'string',
|
|
19
|
-
description: 'Set the build name',
|
|
20
|
-
default: '',
|
|
21
|
-
})
|
|
22
|
-
.option('zip', {
|
|
23
|
-
alias: 'z',
|
|
24
|
-
type: 'boolean',
|
|
25
|
-
description: 'Create a zip file',
|
|
26
|
-
default: false,
|
|
27
|
-
})
|
|
28
|
-
.option('debug', {
|
|
29
|
-
alias: 'd',
|
|
30
|
-
type: 'boolean',
|
|
31
|
-
description: 'Enable debug mode',
|
|
32
|
-
default: false,
|
|
33
|
-
})
|
|
34
|
-
.help()
|
|
35
|
-
.alias('help', 'h');
|
|
36
|
-
|
|
37
|
-
const argv = command.parse();
|
|
38
|
-
jPackBuild(argv);
|