@tangelo/tangelo-configuration-toolkit 1.8.2 → 1.8.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 CHANGED
@@ -62,7 +62,7 @@ global._packages = {
62
62
  TCT: {name: '@tangelo/tangelo-configuration-toolkit', version: require('./package.json')?.version},
63
63
  FDT: {name: '@fontoxml/fontoxml-development-tools'}
64
64
  }
65
- _packages.FDT.version = require(`${getPath(_packages.FDT.name)}/package.json`)?.version;
65
+ _packages.FDT.version = fs.readJsonSync(`${getPath(_packages.FDT.name)}/package.json`, {throws: false})?.version;
66
66
 
67
67
  try { global._appconfig = _paths.appconfig && fs.readJsonSync(_paths.appconfig) || {}; }
68
68
  catch({message}) { _error('Error in '+message); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangelo/tangelo-configuration-toolkit",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "Tangelo Configuration Toolkit is a command-line toolkit which offers support for developing a Tangelo configuration.",
5
5
  "bin": {
6
6
  "tct": "bin/index.js",
@@ -34,7 +34,6 @@
34
34
  "gulp-plumber": "^1.2.1",
35
35
  "gulp-print": "^5.0.2",
36
36
  "gulp-sass": "^5.0.0",
37
- "gulp-simple-rename": "^0.1.3",
38
37
  "gulp-sourcemaps": "^3.0.0",
39
38
  "inquirer": "^8.2.0",
40
39
  "istextorbinary": "^6.0.0",
@@ -45,6 +44,7 @@
45
44
  "sass": "^1.43.5",
46
45
  "saxon-js": "^2.3.0",
47
46
  "scp2": "^0.5.0",
47
+ "through2": "^4.0.2",
48
48
  "tiny-lr": "^2.0.0",
49
49
  "yargs": "^16.2.0"
50
50
  },
package/src/cli.js CHANGED
@@ -10,7 +10,8 @@ const checkForPackageUpdate = (package) => (
10
10
  exec(`npm view -g ${_packages[package].name} version`)
11
11
  .then(r => {
12
12
  const versionAvailable = r.stdout.match(/([\d/.]+)/)[1];
13
- if (compare(_packages[package].version, versionAvailable, '<')) {
13
+ if (!_packages[package].version) _warn(`${package} is not installed! Run ` + `npm i -g ${_packages[package].name}`.white);
14
+ else if (compare(_packages[package].version, versionAvailable, '<')) {
14
15
  updateAppdata({[`updateCheck${package}`]: {executed: new Date(), versionAvailable}});
15
16
  return versionAvailable;
16
17
  }
@@ -0,0 +1,11 @@
1
+ // replacement for the official (but deprecated) gulp-simple-rename
2
+ // kept same name because of usage in tdi
3
+
4
+ const through2 = require('through2');
5
+
6
+ module.exports = (fn) => {
7
+ return through2.obj((file, enc, cb) => {
8
+ file.path = fn(file.path);
9
+ cb(null, file);
10
+ });
11
+ };
@@ -6,7 +6,7 @@ const through2 = require('through2');
6
6
  const {spawnSync} = require('child_process');
7
7
 
8
8
  const g_babel_env = require('babel-preset-es2015-without-strict');
9
- const g_babel = require('gulp-babel')({presets: [g_babel_env], comments: false, minified: true});
9
+ const g_babel = require('gulp-babel');
10
10
  const g_eol = require('gulp-eol');
11
11
  const g_filter = require('gulp-filter');
12
12
  const g_plumber = require('gulp-plumber');
@@ -155,7 +155,7 @@ const transfer = (paths, lrServer) => {
155
155
  .pipe(xpsF.restore)
156
156
  .pipe(jsF)
157
157
  .pipe(g_sourcemaps.init())
158
- .pipe(g_babel)
158
+ .pipe(g_babel({presets: [g_babel_env], comments: false, minified: true}))
159
159
  .pipe(g_sourcemaps.write('.'))
160
160
  .pipe(jsF.restore)
161
161
  .pipe(sassF)
@@ -169,7 +169,7 @@ const transfer = (paths, lrServer) => {
169
169
  .pipe(g_plumber.stop())
170
170
  .pipe(g_replace(c.replaceStrings))
171
171
  .pipe(through2.obj((file, enc, cb) => {
172
- if (file.path.match(/fonto[\\\/]dist/)) file.path = file.path.replace(/fonto[\\\/]dist/, 'fonto'); // change destination path for fonto build
172
+ file.path = file.path.replace(/(fonto)(?:[\\\/]dist|.+([\\\/]assets[\\\/]schemas))/, '$1$2'); // change destination path for fonto build and schemas
173
173
  if (!file.relative.endsWith('.map')) files.push(file.relative); // collect all file paths in array for livereload
174
174
  cb(null, file);
175
175
  }))