Skip to content

Commit

Permalink
Bumo dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bezoerb committed Oct 7, 2023
1 parent d5a8140 commit 6a0d534
Show file tree
Hide file tree
Showing 9 changed files with 5,014 additions and 4,248 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14, 16]
node: [16, 18]
os: [ubuntu-latest, windows-latest]

steps:
Expand Down
35 changes: 22 additions & 13 deletions cli.js
Expand Up @@ -35,37 +35,37 @@ const cli = meow(help, {
flags: {
css: {
type: 'string',
alias: 'c',
shortFlag: 'c',
},
html: {
type: 'string',
alias: 'h',
shortFlag: 'h',
},
ignore: {
type: 'string',
alias: 'i',
shortFlag: 'i',
isMultiple: true,
},
minify: {
type: 'boolean',
alias: 'm',
shortFlag: 'm',
default: true,
},
extract: {
type: 'boolean',
alias: 'e',
shortFlag: 'e',
},
base: {
type: 'string',
alias: 'b',
shortFlag: 'b',
},
selector: {
type: 'string',
alias: 's',
shortFlag: 's',
},
preload: {
type: 'boolean',
alias: 'p',
shortFlag: 'p',
default: false,
},
polyfill: {
Expand All @@ -89,16 +89,20 @@ cli.flags = Object.entries(cli.flags).reduce((result, [key, value]) => {

switch (key) {
case 'css':
case 'html':
case 'html': {
try {
result[key] = read(value);
} catch {}

break;
case 'base':
}

case 'base': {
result.basePath = value;
break;
case 'ignore':
}

case 'ignore': {
result.ignore = (value || []).map((ignore) => {
// Check regex
const {groups} = /^\/(?<expression>.*)\/(?<flags>[igmy]+)?$/.exec(ignore) || {};
Expand All @@ -111,9 +115,12 @@ cli.flags = Object.entries(cli.flags).reduce((result, [key, value]) => {
return ignore;
});
break;
default:
}

default: {
result[key] = value;
break;
}
}

return result;
Expand Down Expand Up @@ -173,11 +180,13 @@ function run(data) {
}

// Get stdin
stdin().then(run);
setTimeout(() => {
if (ok) {
return;
}

run();
}, 100);

const input = await stdin();
run(input);
1 change: 0 additions & 1 deletion index.js
Expand Up @@ -17,7 +17,6 @@ import isString from 'lodash.isstring';
import isRegExp from 'lodash.isregexp';
import reaver from 'reaver';
import slash from 'slash';

import Dom from './src/dom.js';
import {removeDuplicateStyles} from './src/css.js';

Expand Down

0 comments on commit 6a0d534

Please sign in to comment.