purgetss 6.2.2 → 6.2.3
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/index.js +14 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -433,48 +433,48 @@ function createProject(workspace, argsName, projectID, options) {
|
|
|
433
433
|
|
|
434
434
|
logger.info('Creating a new Titanium project');
|
|
435
435
|
|
|
436
|
-
let
|
|
437
|
-
exec(
|
|
436
|
+
let tiCreateCmd = `ti create -t app -p all -n ${projectName} --no-prompt --id ${projectID}`;
|
|
437
|
+
exec(tiCreateCmd, (error) => {
|
|
438
438
|
if (error) return logger.error(error);
|
|
439
439
|
|
|
440
|
-
let
|
|
440
|
+
let theFontsCmd = (options.vendor) ? `&& purgetss f -m -v=${options.vendor}` : '';
|
|
441
441
|
|
|
442
442
|
if (options.vendor) {
|
|
443
443
|
logger.info('Installing requested fonts');
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
let
|
|
447
|
-
exec(
|
|
446
|
+
let cdToProjectCmd = `cd ${workspace}/${projectName} && alloy new && purgetss w && purgetss b ${theFontsCmd}`;
|
|
447
|
+
exec(cdToProjectCmd, (error) => {
|
|
448
448
|
if (error) return logger.error(error);
|
|
449
449
|
|
|
450
|
-
let
|
|
450
|
+
let theOpenCmd;
|
|
451
451
|
if (commandExistsSync('code')) {
|
|
452
|
-
|
|
452
|
+
theOpenCmd = `cd ${workspace}/${projectName} && code .`;
|
|
453
453
|
} else if (commandExistsSync('subl')) {
|
|
454
|
-
|
|
454
|
+
theOpenCmd = `cd ${workspace}/${projectName} && subl .`;
|
|
455
455
|
} else {
|
|
456
|
-
|
|
456
|
+
theOpenCmd = `cd ${workspace}/${projectName} && open .`;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
if (options.tailwind) {
|
|
460
460
|
logger.info('Installing Tailwind CSS');
|
|
461
461
|
|
|
462
|
-
fs.writeFileSync(`${workspace}
|
|
462
|
+
fs.writeFileSync(`${workspace}/${argsName}/package.json`, JSON.stringify({ "name": `${argsName.replace(/ /g, '-').toLowerCase()}`, "private": true }));
|
|
463
463
|
|
|
464
|
-
let
|
|
465
|
-
exec(
|
|
464
|
+
let installTailwindCmd = `cd ${workspace}/${projectName} && npm init -y && npm i tailwindcss -D && npx tailwindcss init`;
|
|
465
|
+
exec(installTailwindCmd, (error) => {
|
|
466
466
|
if (error) return logger.error(error);
|
|
467
467
|
|
|
468
468
|
finish(chalk.yellow(`‘${argsName}’`) + ' project created successfully in');
|
|
469
469
|
|
|
470
|
-
exec(
|
|
470
|
+
exec(theOpenCmd, (error) => {
|
|
471
471
|
if (error) return logger.error(error);
|
|
472
472
|
});
|
|
473
473
|
});
|
|
474
474
|
} else {
|
|
475
475
|
finish(chalk.yellow(`‘${argsName}’`) + ' project created successfully in');
|
|
476
476
|
|
|
477
|
-
exec(
|
|
477
|
+
exec(theOpenCmd, (error) => {
|
|
478
478
|
if (error) return logger.error(error);
|
|
479
479
|
});
|
|
480
480
|
}
|
package/package.json
CHANGED