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.
- package/buildScripts/buildThemes.mjs +25 -11
- package/buildScripts/createClass.mjs +4 -0
- package/package.json +1 -1
- package/resources/scss/theme-dark/container/_all.scss +1 -2
- package/resources/scss/theme-dark/tab/_all.scss +2 -2
- package/resources/scss/theme-light/container/_all.scss +1 -2
- package/resources/scss/theme-light/tab/_all.scss +2 -2
@@ -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
|
-
|
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
|
-
|
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
|
272
|
-
mixinPath
|
273
|
-
suffix
|
274
|
-
|
275
|
-
|
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
|
-
|
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);
|
package/package.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
@import "Container";
|
2
|
-
@import "
|
3
|
-
@import "Strip";
|
2
|
+
@import "header/Button";
|
3
|
+
@import "Strip";
|
@@ -1,3 +1,3 @@
|
|
1
1
|
@import "Container";
|
2
|
-
@import "
|
3
|
-
@import "Strip";
|
2
|
+
@import "header/Button";
|
3
|
+
@import "Strip";
|