@master/css-cli 2.0.0-rc.45 → 2.0.0-rc.46

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.
@@ -6,7 +6,7 @@ var commandExtract = ((program)=>program.command('extract').argument('[source pa
6
6
  const extractor = new CSSExtractor(customOptions, cwd);
7
7
  extractor.on('init', (options)=>{
8
8
  if (specifiedSourcePaths?.length) {
9
- options.include = [];
9
+ options.include = specifiedSourcePaths;
10
10
  options.exclude = [];
11
11
  } else {
12
12
  if (!options.exclude?.includes('**/node_modules/**')) {
@@ -20,32 +20,14 @@ var commandExtract = ((program)=>program.command('extract').argument('[source pa
20
20
  options.verbose = verbose ? +verbose : options.verbose;
21
21
  });
22
22
  extractor.init();
23
- const insert = async ()=>{
24
- /**
25
- * true: Ignore `.include` and `.exclude` when specifying sources explicitly.
26
- * else: Insert according to the source of `.include` - `.exclude`.
27
- */ if (specifiedSourcePaths?.length) {
28
- await extractor.insertFiles(specifiedSourcePaths);
29
- } else {
30
- await extractor.insertFiles(extractor.allowedSourcePaths);
31
- }
32
- };
23
+ console.log(extractor.allowedSourcePaths);
33
24
  if (watch) {
34
- const reset = async ()=>{
35
- await insert();
36
- /* If the specified source does not exist, watch the .include - .exclude */ if (!specifiedSourcePaths?.length && extractor.options.include) {
37
- await extractor.watchSource(extractor.options.include, {
38
- ignored: extractor.options.exclude
39
- });
40
- }
41
- };
42
25
  extractor.on('watchStart', async ()=>{
43
26
  await extractor.prepare();
44
- await reset();
45
27
  log``;
46
28
  log.t`Start watching source changes`;
47
29
  }).on('reset', async ()=>{
48
- await reset();
30
+ await extractor.reset();
49
31
  log``;
50
32
  log.t`Restart watching source changes`;
51
33
  }).on('change', ()=>{
@@ -61,7 +43,6 @@ var commandExtract = ((program)=>program.command('extract').argument('[source pa
61
43
  await extractor.startWatch();
62
44
  } else {
63
45
  await extractor.prepare();
64
- await insert();
65
46
  if (options?.export) {
66
47
  extractor.export();
67
48
  } else {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/css-cli","scripts":{"build":"techor build \"src/**/*.ts\" --formats esm","dev":"pnpm build --watch","lint":"eslint ./src","type-check":"tsc --noEmit","test":"vitest"},"type":"module","license":"MIT","description":"Master CSS CLI","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/cli"},"keywords":["cli","css","mastercss"],"bin":{"mcss":"./dist/bin/index.mjs","mastercss":"./dist/bin/index.mjs"},"files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/css":"^2.0.0-rc.45","@master/css-explore-config":"^2.0.0-rc.45","@master/css-extractor":"^2.0.0-rc.45","@master/css-server":"^2.0.0-rc.45","@techor/extend":"^3.0.22","@techor/fs":"^3.0.22","@techor/glob":"^3.0.22","@techor/log":"^3.0.22","bytes":"^3.1.2","chokidar":"^3.6.0","commander":"^12.0.0","minimatch":"^9.0.3","pretty-hrtime":"^1.0.3"},"devDependencies":{"@types/pretty-hrtime":"^1.0.3","fast-glob":"^3.3.2","shared":"^2.0.0-rc.45"},"version":"2.0.0-rc.45"}
1
+ {"name":"@master/css-cli","scripts":{"build":"techor build \"src/**/*.ts\" --formats esm","dev":"pnpm build --watch","lint":"eslint","type-check":"tsc --noEmit","test":"vitest"},"type":"module","license":"MIT","description":"Master CSS CLI","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/cli"},"keywords":["cli","css","mastercss"],"bin":{"mcss":"./dist/bin/index.mjs","mastercss":"./dist/bin/index.mjs"},"files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/css":"^2.0.0-rc.46","@master/css-explore-config":"^2.0.0-rc.46","@master/css-extractor":"^2.0.0-rc.46","@master/css-server":"^2.0.0-rc.46","@techor/extend":"^3.1.6","@techor/fs":"^3.1.6","@techor/glob":"^3.1.6","@techor/log":"^3.1.6","bytes":"^3.1.2","commander":"^12.0.0","minimatch":"^9.0.3","pretty-hrtime":"^1.0.3"},"devDependencies":{"@types/pretty-hrtime":"^1.0.3","fast-glob":"^3.3.2","shared":"^2.0.0-rc.46"},"version":"2.0.0-rc.46"}