create-gluestack-v2-app
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -45,2 +45,35 @@ #!/usr/bin/env node | ||
} | ||
const enableEslint = () => __awaiter(void 0, void 0, void 0, function* () { | ||
const enableEslint = yield (0, prompts_1.confirm)({ | ||
message: 'Would you like to use ESLint?', | ||
}); | ||
if ((0, prompts_1.isCancel)(enableEslint)) { | ||
(0, prompts_1.cancel)('Operation cancelled.'); | ||
process.exit(0); | ||
} | ||
return enableEslint; | ||
}); | ||
function copyFolderSyncWithIgnore(source, destination, ignoreFiles) { | ||
if (!fs_1.default.existsSync(destination)) { | ||
fs_1.default.mkdirSync(destination); | ||
} | ||
if (!ignoreFiles) | ||
ignoreFiles = []; | ||
const files = fs_1.default.readdirSync(source); | ||
for (const file of files) { | ||
if (ignoreFiles.includes(file)) { | ||
// Skip files listed in the ignoreFiles array | ||
continue; | ||
} | ||
const sourceFilePath = path_1.default.join(source, file); | ||
const destinationFilePath = path_1.default.join(destination, file); | ||
const stats = fs_1.default.statSync(sourceFilePath); | ||
if (stats.isDirectory()) { | ||
copyFolderSyncWithIgnore(sourceFilePath, destinationFilePath, ignoreFiles); | ||
} | ||
else { | ||
fs_1.default.copyFileSync(sourceFilePath, destinationFilePath); | ||
} | ||
} | ||
} | ||
function main() { | ||
@@ -67,10 +100,10 @@ return __awaiter(this, void 0, void 0, function* () { | ||
// copy directory | ||
const data = fs_1.default.cpSync(projectPath, path_1.default.join(process.cwd(), projectName), { | ||
recursive: true, | ||
}); | ||
const data = copyFolderSyncWithIgnore(projectPath, path_1.default.join(process.cwd(), projectName), []); | ||
prompts_1.log.info(` Using \x1b[33m npm install \x1b!`); | ||
updatePackageJson(projectName); | ||
(0, cli_utils_1.installDependencies)(projectName, | ||
// @ts-ignore | ||
'npm install'); | ||
// installDependencies( | ||
// projectName, | ||
// // @ts-ignore | ||
// 'npm install' | ||
// ); | ||
}); | ||
@@ -77,0 +110,0 @@ } |
@@ -13,3 +13,3 @@ { | ||
"description": "A fullstack framework.", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"license": "MIT", | ||
@@ -16,0 +16,0 @@ "main": "dist/index.js", |
@@ -9,2 +9,3 @@ #!/usr/bin/env node | ||
cancel, | ||
confirm, | ||
isCancel, | ||
@@ -40,2 +41,49 @@ log, | ||
} | ||
const enableEslint = async (): Promise<any> => { | ||
const enableEslint = await confirm({ | ||
message: 'Would you like to use ESLint?', | ||
}); | ||
if (isCancel(enableEslint)) { | ||
cancel('Operation cancelled.'); | ||
process.exit(0); | ||
} | ||
return enableEslint; | ||
}; | ||
function copyFolderSyncWithIgnore( | ||
source: string, | ||
destination: string, | ||
ignoreFiles?: Array<string> | ||
) { | ||
if (!fs.existsSync(destination)) { | ||
fs.mkdirSync(destination); | ||
} | ||
if (!ignoreFiles) ignoreFiles = []; | ||
const files = fs.readdirSync(source); | ||
for (const file of files) { | ||
if (ignoreFiles.includes(file)) { | ||
// Skip files listed in the ignoreFiles array | ||
continue; | ||
} | ||
const sourceFilePath = path.join(source, file); | ||
const destinationFilePath = path.join(destination, file); | ||
const stats = fs.statSync(sourceFilePath); | ||
if (stats.isDirectory()) { | ||
copyFolderSyncWithIgnore( | ||
sourceFilePath, | ||
destinationFilePath, | ||
ignoreFiles | ||
); | ||
} else { | ||
fs.copyFileSync(sourceFilePath, destinationFilePath); | ||
} | ||
} | ||
} | ||
async function main() { | ||
@@ -60,17 +108,18 @@ let projectPath = path.join(path.resolve(__dirname, '..'), 'src', 'template'); | ||
} | ||
// copy directory | ||
const data = fs.cpSync(projectPath, path.join(process.cwd(), projectName), { | ||
recursive: true, | ||
}); | ||
const data = copyFolderSyncWithIgnore( | ||
projectPath, | ||
path.join(process.cwd(), projectName), | ||
[] | ||
); | ||
log.info(` Using \x1b[33m npm install \x1b!`); | ||
updatePackageJson(projectName); | ||
installDependencies( | ||
projectName, | ||
// @ts-ignore | ||
'npm install' | ||
); | ||
// installDependencies( | ||
// projectName, | ||
// // @ts-ignore | ||
// 'npm install' | ||
// ); | ||
} | ||
main(); |
@@ -9,6 +9,2 @@ { | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gluestack-v2/gluestack-frameworks" | ||
}, | ||
"keywords": [ | ||
@@ -15,0 +11,0 @@ "gluestack", |
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
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
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
307974
8218
0
15
1