neo.mjs 4.3.20 → 4.3.22

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.
@@ -13,15 +13,15 @@ const __dirname = path.resolve(),
13
13
  cwd = process.cwd(),
14
14
  requireJson = path => JSON.parse(fs.readFileSync((path))),
15
15
  packageJson = requireJson(path.resolve(cwd, 'package.json')),
16
- neoPath = path.resolve(packageJson.name === 'neo.mjs' ? './' : './node_modules/neo.mjs/'),
17
16
  insideNeo = packageJson.name === 'neo.mjs',
17
+ neoPath = path.resolve(insideNeo ? './' : './node_modules/neo.mjs/'),
18
18
  programName = `${packageJson.name} buildThemes`,
19
19
  program = new Command(),
20
20
  regexComments = /\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,
21
21
  regexLineBreak = /(\r\n|\n|\r)/gm,
22
22
  regexSassImport = /@import[^'"]+?['"](.+?)['"];?/g,
23
- scssFolders = fs.readdirSync(path.join(neoPath, '/resources/scss')),
24
23
  scssPath = 'resources/scss/',
24
+ scssFolders = fs.readdirSync(path.resolve(scssPath)),
25
25
  themeMapFile = 'resources/theme-map.json',
26
26
  themeMapFileNoVars = 'resources/theme-map-no-vars.json',
27
27
  themeFolders = [],
@@ -166,10 +166,19 @@ if (programOpts.info) {
166
166
  * @returns {Object[]}
167
167
  */
168
168
  function getAllScssFiles(dirPath) {
169
- const files = getScssFiles(path.resolve(neoPath, dirPath));
169
+ let files = [],
170
+ scssPath = path.resolve(neoPath, dirPath);
171
+
172
+ if (fs.existsSync(scssPath)) {
173
+ files.push(...getScssFiles(scssPath));
174
+ }
170
175
 
171
176
  if (!insideNeo) {
172
- files.push(...getScssFiles(path.resolve(cwd, dirPath)));
177
+ scssPath = path.resolve(cwd, dirPath);
178
+
179
+ if (fs.existsSync(scssPath)) {
180
+ files.push(...getScssFiles(scssPath));
181
+ }
173
182
  }
174
183
 
175
184
  return files;
@@ -267,12 +276,13 @@ if (programOpts.info) {
267
276
  * @param {Boolean} useCssVars
268
277
  */
269
278
  function parseScssFiles(files, mode, target, useCssVars) {
270
- let data = '',
271
- devMode = mode === 'development',
272
- mixinPath = path.resolve(neoPath, 'resources/scss/mixins/_all.scss'),
273
- suffix = useCssVars ? '' : '-no-vars',
274
- varsFlag = useCssVars ? 'vars' : 'noVars',
275
- map, neoThemePath, themeBuffer, themePath, workspaceThemePath;
279
+ let data = '',
280
+ devMode = mode === 'development',
281
+ mixinPath = path.resolve(neoPath, 'resources/scss/mixins/_all.scss'),
282
+ suffix = useCssVars ? '' : '-no-vars',
283
+ themeBuffer = '',
284
+ varsFlag = useCssVars ? 'vars' : 'noVars',
285
+ dirName, map, neoThemePath, themePath, workspaceThemePath;
276
286
 
277
287
  totalFiles[mode][varsFlag] += files.length;
278
288
 
@@ -285,7 +295,11 @@ if (programOpts.info) {
285
295
  neoThemePath = path.resolve(neoPath, themePath);
286
296
 
287
297
  if (!sassThemes[target]) {
288
- themeBuffer = scssCombine(fs.readFileSync(neoThemePath).toString(), path.dirname(neoThemePath));
298
+ dirName = path.dirname(neoThemePath);
299
+
300
+ if (fs.existsSync(dirName)) {
301
+ themeBuffer += scssCombine(fs.readFileSync(neoThemePath).toString(), dirName);
302
+ }
289
303
 
290
304
  if (!insideNeo) {
291
305
  workspaceThemePath = path.resolve(cwd, themePath);
@@ -710,6 +710,10 @@ if (programOpts.info) {
710
710
  return 'data.Store';
711
711
  }
712
712
 
713
+ if (className.endsWith('component')) {
714
+ return 'component.Base';
715
+ }
716
+
713
717
  if (className.endsWith('controller')) {
714
718
  return 'controller.Component';
715
719
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.3.20",
3
+ "version": "4.3.22",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,4 +1,3 @@
1
1
  @import "Base";
2
2
  @import "Panel";
3
- @import "Toolbar";
4
- @import "Viewport";
3
+ @import "Viewport";
@@ -1,3 +1,3 @@
1
1
  @import "Container";
2
- @import "HeaderButton";
3
- @import "Strip";
2
+ @import "header/Button";
3
+ @import "Strip";
@@ -1,4 +1,3 @@
1
1
  @import "Base";
2
2
  @import "Panel";
3
- @import "Toolbar";
4
- @import "Viewport";
3
+ @import "Viewport";
@@ -1,3 +1,3 @@
1
1
  @import "Container";
2
- @import "HeaderButton";
3
- @import "Strip";
2
+ @import "header/Button";
3
+ @import "Strip";