@omlet/cli
Advanced tools
Comparing version 0.0.1-alpha.1 to 0.0.1-alpha.2
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,4 +16,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const commander_1 = __importDefault(require("commander")); | ||
const binding_1 = require("./binding"); | ||
const analyzer_1 = require("./analyzer"); | ||
const package_json_1 = require("../package.json"); | ||
const fs_1 = require("fs"); | ||
function accumulateValues(value, previous = []) { | ||
@@ -19,16 +29,35 @@ return previous.concat(value); | ||
.description("Parse JS/TS modules and extract component information") | ||
.requiredOption("-r, --root <path>", "Path to the repository's root directory", process.cwd()) | ||
.requiredOption("-i, --input <glob-pattern>", "List of glob patterns for input files", accumulateValues) | ||
.option("--ignore <glob-pattern>", "List of ignore patterns for skipping input files", accumulateValues, []) | ||
.action((args) => { | ||
const result = (0, binding_1.parse)(args.input[0], args.ignore, ""); | ||
console.log(JSON.stringify(JSON.parse(result), null, 2)); | ||
const result = (0, analyzer_1.parse)(args.root, { | ||
inputPatterns: args.input, | ||
ignorePatterns: args.ignore, | ||
workingDir: process.cwd() | ||
}); | ||
console.log(JSON.stringify(result, null, 2)); | ||
}); | ||
program.command("analyze") | ||
.description("Identify components and analyze their usages across JS/TS modules") | ||
.requiredOption("-r, --root <path>", "Path to the repository's root directory", process.cwd()) | ||
.requiredOption("-i, --input <glob-pattern>", "List of glob patterns for input files", accumulateValues) | ||
.option("--ignore <glob-pattern>", "List of ignore patterns for skipping input files", accumulateValues, []) | ||
.action((args) => { | ||
const result = (0, binding_1.analyze)(args.input[0], args.ignore, ""); | ||
console.log(JSON.stringify(JSON.parse(result), null, 2)); | ||
}); | ||
.option("-c, --core <glob-pattern>", "List of core patterns to identify reusable components", accumulateValues, []) | ||
.requiredOption("-o, --output <path|->", "Specify path for resulting output file", "omlet.json") | ||
.action((args) => __awaiter(void 0, void 0, void 0, function* () { | ||
const result = (0, analyzer_1.analyze)(args.root, { | ||
inputPatterns: args.input, | ||
ignorePatterns: args.ignore, | ||
corePatterns: args.core, | ||
workingDir: process.cwd(), | ||
}); | ||
const output = JSON.stringify(result, null, 2); | ||
if (args.output === "-") { | ||
console.log(output); | ||
} | ||
else { | ||
yield fs_1.promises.writeFile(args.output, JSON.stringify(result, null, 2)); | ||
} | ||
})); | ||
program.on("command:*", () => { | ||
@@ -35,0 +64,0 @@ program.outputHelp(); |
{ | ||
"name": "@omlet/cli", | ||
"version": "0.0.1-alpha.0", | ||
"version": "0.0.1-alpha.1", | ||
"bin": { | ||
@@ -29,5 +29,15 @@ "omlet": "bin/omlet" | ||
"@napi-rs/cli": "^2.4.4", | ||
"@types/jest": "^27.4.1", | ||
"@types/minimatch": "^3.0.5", | ||
"@types/node": "^17.0.21", | ||
"commander": "^9.0.0", | ||
"typescript": "^4.5.5" | ||
"@typescript-eslint/eslint-plugin": "^5.13.0", | ||
"@typescript-eslint/parser": "^5.13.0", | ||
"axios": "^0.26.1", | ||
"eslint": "^8.10.0", | ||
"jest": "^27.5.1", | ||
"ts-jest": "^27.1.3", | ||
"typescript": "^4.5.5", | ||
"verdaccio": "^5.7.1", | ||
"verdaccio-auth-memory": "^10.2.0", | ||
"verdaccio-memory": "^10.2.0" | ||
}, | ||
@@ -39,9 +49,32 @@ "engines": { | ||
"artifacts": "napi artifacts", | ||
"build:dev": "napi build --platform --cargo-name node --js ./node-src/binding.js --dts ./node-src/binding.d.ts && npm run build:ts && mv *.node ./dist/node-src/", | ||
"build:release": "napi build --platform --cargo-name node --js ./node-src/binding.js --dts ./node-src/binding.d.ts --release", | ||
"build:dev": "npm run build:napi && npm run build:ts && mv *.node ./dist/node-src/", | ||
"build:release": "npm run build:napi -- --release", | ||
"build:napi": "napi build --platform --cargo-name node --js ./node-src/binding.js --dts ./node-src/binding.d.ts", | ||
"build:ts": "tsc", | ||
"prepublishOnly": "napi prepublish -t npm", | ||
"test": "echo \"No tests yet\" && exit 0", | ||
"build:test": "npm run build:napi && rm -rf artifacts && mkdir artifacts && mv *.node ./artifacts/ && npm run artifacts && npm run build:ts", | ||
"clean": "rm -rf ./dist", | ||
"prepublishOnly": "napi prepublish -t npm --skip-gh-release", | ||
"pretest:e2e": "npm run clean && npm run build:test", | ||
"test:e2e": "jest", | ||
"test:native": "cargo test", | ||
"test": "npm run test:native && npm run test:e2e", | ||
"version": "napi version" | ||
}, | ||
"optionalDependencies": { | ||
"@omlet/cli-win32-x64-msvc": "0.0.1-alpha.1", | ||
"@omlet/cli-darwin-x64": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-x64-gnu": "0.0.1-alpha.1", | ||
"@omlet/cli-darwin-arm64": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-arm64-gnu": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-arm64-musl": "0.0.1-alpha.1", | ||
"@omlet/cli-win32-arm64-msvc": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-arm-gnueabihf": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-x64-musl": "0.0.1-alpha.1", | ||
"@omlet/cli-freebsd-x64": "0.0.1-alpha.1", | ||
"@omlet/cli-win32-ia32-msvc": "0.0.1-alpha.1" | ||
}, | ||
"dependencies": { | ||
"commander": "^9.0.0", | ||
"minimatch": "^5.0.1" | ||
} | ||
} |
{ | ||
"name": "@omlet/cli", | ||
"version": "0.0.1-alpha.1", | ||
"version": "0.0.1-alpha.2", | ||
"bin": { | ||
@@ -29,4 +29,15 @@ "omlet": "bin/omlet" | ||
"@napi-rs/cli": "^2.4.4", | ||
"@types/jest": "^27.4.1", | ||
"@types/minimatch": "^3.0.5", | ||
"@types/node": "^17.0.21", | ||
"typescript": "^4.5.5" | ||
"@typescript-eslint/eslint-plugin": "^5.13.0", | ||
"@typescript-eslint/parser": "^5.13.0", | ||
"axios": "^0.26.1", | ||
"eslint": "^8.10.0", | ||
"jest": "^27.5.1", | ||
"ts-jest": "^27.1.3", | ||
"typescript": "^4.5.5", | ||
"verdaccio": "^5.7.1", | ||
"verdaccio-auth-memory": "^10.2.0", | ||
"verdaccio-memory": "^10.2.0" | ||
}, | ||
@@ -38,25 +49,32 @@ "engines": { | ||
"artifacts": "napi artifacts", | ||
"build:dev": "napi build --platform --cargo-name node --js ./node-src/binding.js --dts ./node-src/binding.d.ts && npm run build:ts && mv *.node ./dist/node-src/", | ||
"build:release": "napi build --platform --cargo-name node --js ./node-src/binding.js --dts ./node-src/binding.d.ts --release", | ||
"build:dev": "npm run build:napi && npm run build:ts && mv *.node ./dist/node-src/", | ||
"build:release": "npm run build:napi -- --release", | ||
"build:napi": "napi build --platform --cargo-name node --js ./node-src/binding.js --dts ./node-src/binding.d.ts", | ||
"build:ts": "tsc", | ||
"build:test": "npm run build:napi && rm -rf artifacts && mkdir artifacts && mv *.node ./artifacts/ && npm run artifacts && npm run build:ts", | ||
"clean": "rm -rf ./dist", | ||
"prepublishOnly": "napi prepublish -t npm --skip-gh-release", | ||
"test": "echo \"No tests yet\" && exit 0", | ||
"pretest:e2e": "npm run clean && npm run build:test", | ||
"test:e2e": "jest", | ||
"test:native": "cargo test", | ||
"test": "npm run test:native && npm run test:e2e", | ||
"version": "napi version" | ||
}, | ||
"optionalDependencies": { | ||
"@omlet/cli-win32-x64-msvc": "0.0.1-alpha.1", | ||
"@omlet/cli-darwin-x64": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-x64-gnu": "0.0.1-alpha.1", | ||
"@omlet/cli-darwin-arm64": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-arm64-gnu": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-arm64-musl": "0.0.1-alpha.1", | ||
"@omlet/cli-win32-arm64-msvc": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-arm-gnueabihf": "0.0.1-alpha.1", | ||
"@omlet/cli-linux-x64-musl": "0.0.1-alpha.1", | ||
"@omlet/cli-freebsd-x64": "0.0.1-alpha.1", | ||
"@omlet/cli-win32-ia32-msvc": "0.0.1-alpha.1" | ||
"@omlet/cli-win32-x64-msvc": "0.0.1-alpha.2", | ||
"@omlet/cli-darwin-x64": "0.0.1-alpha.2", | ||
"@omlet/cli-linux-x64-gnu": "0.0.1-alpha.2", | ||
"@omlet/cli-darwin-arm64": "0.0.1-alpha.2", | ||
"@omlet/cli-linux-arm64-gnu": "0.0.1-alpha.2", | ||
"@omlet/cli-linux-arm64-musl": "0.0.1-alpha.2", | ||
"@omlet/cli-win32-arm64-msvc": "0.0.1-alpha.2", | ||
"@omlet/cli-linux-arm-gnueabihf": "0.0.1-alpha.2", | ||
"@omlet/cli-linux-x64-musl": "0.0.1-alpha.2", | ||
"@omlet/cli-freebsd-x64": "0.0.1-alpha.2", | ||
"@omlet/cli-win32-ia32-msvc": "0.0.1-alpha.2" | ||
}, | ||
"dependencies": { | ||
"commander": "^9.0.0" | ||
"commander": "^9.0.0", | ||
"minimatch": "^5.0.1" | ||
} | ||
} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
21187
10
428
2
0
2
13
14
3
+ Addedminimatch@^5.0.1
+ Added@omlet/cli-darwin-arm64@0.0.1-alpha.2(transitive)
+ Added@omlet/cli-darwin-x64@0.0.1-alpha.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedminimatch@5.1.6(transitive)
- Removed@omlet/cli-darwin-arm64@0.0.1-alpha.1(transitive)
- Removed@omlet/cli-darwin-x64@0.0.1-alpha.1(transitive)