react-creates
Advanced tools
Comparing version 1.0.0 to 1.0.1
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -6,6 +9,8 @@ exports.createComponent = void 0; | ||
const parse_language_1 = require("./parsers/parse-language"); | ||
const parse_style_1 = require("./parsers/parse-style"); | ||
const parse_target_1 = require("./parsers/parse-target"); | ||
const parse_type_1 = require("./parsers/parse-type"); | ||
const parse_target_1 = require("./parsers/parse-target"); | ||
const parse_style_1 = require("./parsers/parse-style"); | ||
const run_1 = require("./run"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const options_logger_1 = require("./options-logger"); | ||
exports.createComponent = () => commander_1.program | ||
@@ -41,2 +46,7 @@ .command("component <name>") | ||
try { | ||
console.log(` | ||
React Creates: ${chalk_1.default.blueBright.bold("Component")} | ||
Parsing arguments... | ||
`); | ||
const options = { | ||
@@ -51,2 +61,3 @@ name, | ||
}; | ||
options_logger_1.optionsLogger(options); | ||
await run_1.runCreateComponent(options); | ||
@@ -53,0 +64,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
const readdir = util_1.promisify(fs_1.default.readdir); | ||
exports.parseTarget = async ({ name, target }) => { | ||
const _parseTarget = async ({ name, target }) => { | ||
if (typeof target !== "string") { | ||
@@ -37,2 +37,6 @@ throw new Error("Invalid option: directory"); | ||
}; | ||
exports.parseTarget = async (options) => { | ||
const newTarget = await _parseTarget(options); | ||
return newTarget; | ||
}; | ||
//# sourceMappingURL=parse-target.js.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs_1 = __importDefault(require("fs")); | ||
const path_1 = require("path"); | ||
const util_1 = require("util"); | ||
const exists = util_1.promisify(fs_1.default.exists); | ||
const isInsideTypescript = async (target) => { | ||
let currentPath = target; | ||
let itr = 0; | ||
let found = false; | ||
const MAX_ITERATIONS = +process.env.MAX_TYPESCRIPT_ITERATIONS || 10; | ||
while (itr < MAX_ITERATIONS && !found) { | ||
if (await exists(currentPath)) { | ||
if (await exists(path_1.join(currentPath, "tsconfig.json"))) { | ||
found = true; | ||
} | ||
else { | ||
const currentPathArray = currentPath.split(path_1.sep); | ||
currentPath = currentPathArray.slice(0, currentPathArray.length - 1).join(path_1.sep); | ||
} | ||
} | ||
else { | ||
itr = MAX_ITERATIONS; | ||
} | ||
} | ||
return found; | ||
}; | ||
async function isTypescript(target = process.cwd()) { | ||
let isInsideTypescript; | ||
try { | ||
isInsideTypescript = !!require("typescript"); | ||
} | ||
catch (e) { | ||
isInsideTypescript = false; | ||
} | ||
return isInsideTypescript; | ||
return await isInsideTypescript(target); | ||
} | ||
exports.default = isTypescript; | ||
//# sourceMappingURL=is-typescript.js.map |
{ | ||
"name": "react-creates", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Create React Component folder works on macOS, Windows, and Linux.", | ||
@@ -18,5 +18,8 @@ "files": [ | ||
"lint": "eslint --fix --ext .js,.ts .", | ||
"test": "jest --no-cache --runInBand 2>&1", | ||
"create:cmp": "npm run clean && react-creates component __temp__ -f --scss -d __temp__ ", | ||
"prepublish": "npm run build" | ||
"pretest": "npm run build", | ||
"test": "jest", | ||
"create:cmp": "npm run clean && npx react-creates component __temp__ -f --scss -d __temp__ ", | ||
"deploy:patch": "node deploy -p", | ||
"deploy:minor": "node deploy -m", | ||
"prepublish": "npm run build && npm run deploy:patch" | ||
}, | ||
@@ -52,2 +55,3 @@ "keywords": [ | ||
"@types/chalk": "^2.2.0", | ||
"@types/chance": "^1.1.0", | ||
"@types/commander": "^2.12.2", | ||
@@ -62,2 +66,3 @@ "@types/inquirer": "^6.5.0", | ||
"@types/tempy": "^0.3.0", | ||
"chance": "^1.1.6", | ||
"create-react-app": "^3.4.1", | ||
@@ -70,2 +75,2 @@ "execa": "^4.0.3", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27746
400
18
37
7