Comparing version 1.0.51 to 1.1.0
@@ -1,2 +0,1 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
@@ -11,3 +10,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) { | ||
const js_beautify_1 = __importDefault(require("js-beautify")); | ||
const webpack_unpack_1 = __importDefault(require("webpack-unpack")); | ||
const unpack_js_1 = __importDefault(require("./unpack.js")); | ||
const currDir = process.cwd(); | ||
@@ -22,3 +21,4 @@ const outDir = path_1.default.join(currDir, "out"); | ||
const dirName = process.argv[2]; | ||
const beautifyIt = process.argv[3] === "-b"; | ||
const beautifyIt = process.argv[3] === "-b" || process.argv[4] === "-b"; | ||
const allowDuplicates = process.argv[3] === "-d" || process.argv[4] === "-d"; | ||
const files = fs_1.default.readdirSync(dirName); | ||
@@ -29,3 +29,3 @@ for (const inFile of files) { | ||
const fileData = fs_1.default.readFileSync(inPath).toString(); | ||
const data = webpack_unpack_1.default(fileData); | ||
const data = unpack_js_1.default(fileData); | ||
if (!data) | ||
@@ -35,2 +35,4 @@ continue; | ||
const newFileName = genNewFilePath(item.id); | ||
if (newFileName === undefined) | ||
continue; | ||
const newFile = path_1.default.join(outDir, `${newFileName}.js`); | ||
@@ -49,2 +51,4 @@ console.log(newFile); | ||
return fileName; | ||
if (!allowDuplicates) | ||
return undefined; | ||
const p = path_1.default.join(outDir, `${fileName}-${i}.js`); | ||
@@ -51,0 +55,0 @@ if (fs_1.default.existsSync(p)) { |
{ | ||
"name": "dpacker", | ||
"version": "1.0.51", | ||
"version": "1.1.0", | ||
"main": "dist/index.js", | ||
@@ -18,13 +18,18 @@ "license": "MIT", | ||
"dependencies": { | ||
"acorn": "^8.7.0", | ||
"assert": "^2.0.0", | ||
"astring": "^1.8.1", | ||
"js-beautify": "^1.14.0", | ||
"multisplice": "^1.0.0", | ||
"rimraf": "^3.0.2", | ||
"webpack-unpack": "^2.0.0" | ||
"scope-analyzer": "^2.1.2" | ||
}, | ||
"devDependencies": { | ||
"@types/js-beautify": "^1.13.2", | ||
"@types/estree": "^0.0.51", | ||
"@types/js-beautify": "^1.13.3", | ||
"@types/node": "^16.4.7", | ||
"@types/rimraf": "^3.0.1", | ||
"@types/rimraf": "^3.0.2", | ||
"ts-node": "^10.1.0", | ||
"typescript": "^4.3.5" | ||
} | ||
} | ||
} |
@@ -15,7 +15,11 @@ # DPacker | ||
```shell | ||
npx dpacker ./assets-canary [-b] | ||
npx dpacker ./assets-canary [-b] [-d] | ||
``` | ||
the `-b` is optional, and will auto-beautify the JS files as they're written. | ||
## Flags: | ||
`-b` is optional, and will auto-beautify the JS files as they're written. | ||
`-d` is optional, and will write duplicate files if they share the ID. (By default, it ignores duplicate files as there's usually not any difference) | ||
The files will be written into an `out` folder :) |
@@ -5,3 +5,3 @@ import fs from "fs"; | ||
import jsBeautify from "js-beautify"; | ||
import unpack from "webpack-unpack"; | ||
import unpack from "./unpack.js"; | ||
@@ -23,3 +23,4 @@ const currDir = process.cwd(); | ||
const beautifyIt = process.argv[3] === "-b"; | ||
const beautifyIt = process.argv[3] === "-b" || process.argv[4] === "-b"; | ||
const allowDuplicates = process.argv[3] === "-d" || process.argv[4] === "-d"; | ||
@@ -40,2 +41,3 @@ const files = fs.readdirSync(dirName); | ||
const newFileName = genNewFilePath(item.id); | ||
if (newFileName === undefined) continue; | ||
const newFile = path.join(outDir, `${newFileName}.js`); | ||
@@ -57,2 +59,4 @@ console.log(newFile); | ||
if (!allowDuplicates) return undefined; | ||
const p = path.join(outDir, `${fileName}-${i}.js`); | ||
@@ -59,0 +63,0 @@ |
@@ -11,2 +11,3 @@ { | ||
"esModuleInterop": true, | ||
"allowJs": true, | ||
"moduleResolution": "Node", | ||
@@ -17,3 +18,4 @@ "baseUrl": ".", | ||
}, | ||
"include": ["src/**/*", "types/types.d.ts"] | ||
"include": ["src/**/*", "types/types.d.ts"], | ||
"exclude": ["node_module"] | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
20506
10
543
25
7
6
1
1
+ Addedacorn@^8.7.0
+ Addedassert@^2.0.0
+ Addedastring@^1.8.1
+ Addedmultisplice@^1.0.0
+ Addedscope-analyzer@^2.1.2
+ Addedacorn@8.14.0(transitive)
+ Addedassert@2.1.0(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedfor-each@0.3.5(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.3.0(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.1.0(transitive)
+ Addedis-nan@1.3.2(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedis-typed-array@1.1.15(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedobject-is@1.1.6(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.7(transitive)
+ Addedpossible-typed-array-names@1.1.0(transitive)
+ Addedsafe-regex-test@1.1.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedwhich-typed-array@1.1.18(transitive)
- Removedwebpack-unpack@^2.0.0
- Removedacorn@5.7.4(transitive)
- Removedminimist@1.2.8(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedwebpack-unpack@2.0.0(transitive)