anubis-ui 1.2.6 → 1.2.8

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
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const { init: initConfig, config } = require('./dist/config/config.tool');
3
+ const { init: initConfig, config } = require('./dist/tools/config.tool');
4
4
  const { log, logPrefix, logo } = require('./dist/tools/logger');
5
5
  const { init: initClassExtraction } = require('./dist/tools/extraction/extractClasses');
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anubis-ui",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Class-based css generator",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -15,9 +15,9 @@
15
15
  "vue"
16
16
  ],
17
17
  "scripts": {
18
- "dev": "npm run preinstall; node src/manual/build.js",
18
+ "dev": "rm -rf dist; npm run preinstall; node src/manual/build.js",
19
19
  "build": "tsc",
20
- "preinstall": "npm run build"
20
+ "prepare": "npm run build"
21
21
  },
22
22
  "style": "dist/_anubis.scss",
23
23
  "repository": {
@@ -10,6 +10,9 @@ export interface IEnvConfig {
10
10
  presets: IPreset[],
11
11
  files: IFilePatterns,
12
12
 
13
+ /** User-given classes to force the css rule creation */
14
+ force: string[],
15
+
13
16
  colors: string[],
14
17
  states: string[],
15
18
  [key: string]: any
@@ -1,6 +1,6 @@
1
1
  import { IEnvConfig } from "../interfaces/config.interface";
2
- import { readUserConfigFile, userConfig } from "../tools/fileStuff/configFile"
3
- import { log } from "../tools/logger"
2
+ import { readUserConfigFile, userConfig } from "./fileStuff/configFile"
3
+ import { log } from "./logger"
4
4
 
5
5
  const fs = require('fs')
6
6
  const path = require('path')
@@ -9,7 +9,6 @@ const anubisConfigFolder = path.join(__dirname, '..', '..', 'src', 'config');
9
9
  const anubisConfigFiles = [
10
10
  'qol',
11
11
  'files',
12
- 'force',
13
12
  'colors',
14
13
  'states',
15
14
  'presets',
@@ -19,7 +18,6 @@ const config = {
19
18
  qol: [],
20
19
  presets: [],
21
20
 
22
- /** User-given classes to force the css rule creation */
23
21
  force: [],
24
22
 
25
23
  files: { targets: [], ignore: [] },
@@ -49,6 +47,14 @@ const init = () => {
49
47
  config[file as keyof typeof config] = configToUse
50
48
  }
51
49
 
50
+ const forceClasses = userConfig?.['force']
51
+ console.log({ forceClasses })
52
+
53
+ if (forceClasses?.length) {
54
+ log(`Forcing the creation of ${forceClasses?.length} classes`)
55
+ config.force = userConfig['force']
56
+ }
57
+
52
58
  return config
53
59
  }
54
60
 
@@ -58,7 +64,7 @@ const checkUserConfig = () => {
58
64
  // todo - also check values
59
65
  const userConfigKeys = Object.keys(userConfig)
60
66
 
61
- const unknownKeys = userConfigKeys?.filter(key => !anubisConfigFiles.includes(key))
67
+ const unknownKeys = userConfigKeys?.filter(key => !anubisConfigFiles.includes(key) && key !== 'force')
62
68
  if (!unknownKeys?.length) { return }
63
69
 
64
70
  log(`${unknownKeys?.length} unknown config keys found in user config file`)
@@ -1,7 +1,7 @@
1
1
  import { getFiles } from "../fileStuff/file.tools"
2
2
  import { mapClassesIntoRules } from "../mapping/mapClassIntoRule"
3
3
  import { buildCssRuleFile } from "../fileStuff/cssFile"
4
- import { config } from "../../config/config.tool"
4
+ import { config } from "../config.tool"
5
5
 
6
6
  const fs = require('fs')
7
7
 
@@ -1,4 +1,4 @@
1
- import { config } from "../../config/config.tool"
1
+ import { config } from "../config.tool"
2
2
  import { IPreset } from "../../interfaces/preset.interface"
3
3
  import { log } from "../logger"
4
4