purgetss 5.3.8 → 5.3.9

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/bin/purgetss CHANGED
@@ -10,7 +10,7 @@ const updateNotifier = require('update-notifier');
10
10
  // check if a new version of PurgeTSS is available and print an update notification
11
11
  const notifier = updateNotifier({ pkg });
12
12
  if (notifier.update && notifier.update.latest !== pkg.version) {
13
- notifier.notify({ defer: false, isGlobal: true })
13
+ notifier.notify({ defer: false, isGlobal: true });
14
14
  }
15
15
 
16
16
  program
@@ -101,9 +101,9 @@ program
101
101
  .action((args, options, logger) => {
102
102
  logger.info(`${purgetss.colores.purgeLabel} Updating PurgeTSS to the latest version...`);
103
103
 
104
- const { exec } = require("child_process");
104
+ const { exec } = require('child_process');
105
105
 
106
- exec("npm update -g purgetss", (error, stdout, stderr) => {
106
+ exec('npm update -g purgetss', (error, stdout, stderr) => {
107
107
  if (error) {
108
108
  logger.info(`${purgetss.colores.purgeLabel} error: ${error.message}`);
109
109
  return;
@@ -126,9 +126,9 @@ program
126
126
  .action((args, options, logger) => {
127
127
  logger.info(`${purgetss.colores.purgeLabel} Updating PurgeTSS to the latest version using sudo...`);
128
128
 
129
- const { exec } = require("child_process");
129
+ const { exec } = require('child_process');
130
130
 
131
- exec("sudo npm update -g purgetss", (error, stdout, stderr) => {
131
+ exec('sudo npm update -g purgetss', (error, stdout, stderr) => {
132
132
  if (error) {
133
133
  logger.info(`${purgetss.colores.purgeLabel} error: ${error.message}`);
134
134
  return;
package/index.js CHANGED
@@ -260,7 +260,7 @@ function copyModulesLibrary() {
260
260
  makeSureFolderExists(projectLibFolder);
261
261
 
262
262
  fs.copyFileSync(srcPurgeTSSLibrary, projectLibFolder + '/purgetss.ui.js');
263
- logger.info('PurgeTSS modules copied to', chalk.yellow('./app/lib'), 'folder');
263
+ logger.info(chalk.yellow('purgetss.ui'), 'module copied to', chalk.yellow('./app/lib'), 'folder');
264
264
  }
265
265
  }
266
266
  module.exports.copyModulesLibrary = copyModulesLibrary;
@@ -837,7 +837,16 @@ function addHook() {
837
837
 
838
838
  originalJMKFile.split(/\r?\n/).forEach((line) => {
839
839
  if (line.includes('pre:compile')) {
840
- let execCommand = (isInstalledGlobally) ? 'purgetss' : 'node node_modules/purgetss/bin/purgetss';
840
+ let execCommand = "";
841
+
842
+ if (__dirname.includes('alloy')) {
843
+ execCommand = 'alloy purgetss';
844
+ } else if (isInstalledGlobally) {
845
+ execCommand = 'purgetss';
846
+ } else {
847
+ execCommand = 'node node_modules/purgetss/bin/purgetss';
848
+ };
849
+
841
850
  line += `\n\trequire('child_process').execSync('${execCommand}', logger.warn('::PurgeTSS:: Auto-Purging ' + event.dir.project));`;
842
851
  }
843
852
  updatedJMKFile.push(line);
@@ -2270,9 +2279,9 @@ function saveFile(file, data) {
2270
2279
  }
2271
2280
 
2272
2281
  function createJMKFile() {
2273
- logger.warn(chalk.green('Adding Auto-Purging hook!'));
2274
2282
  fs.copyFileSync(srcJMKFile, projectAlloyJMKFile);
2275
2283
  logger.file('./app/alloy.jmk');
2284
+ addHook();
2276
2285
  }
2277
2286
 
2278
2287
  //! Soon to be deleted
@@ -1,3 +1,2 @@
1
1
  task('pre:compile', function(event, logger) {
2
- require('child_process').execSync('purgetss', logger.warn('::PurgeTSS:: Auto-Purging ' + event.dir.project));
3
2
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purgetss",
3
- "version": "5.3.8",
3
+ "version": "5.3.9",
4
4
  "description": "An extension for Titanium SDK that contains a set of Tailwind-like classes to easily and quickly create beautifully designed mobile apps.",
5
5
  "main": "index.js",
6
6
  "bin": {