customizr 2.0.0 → 2.0.4
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/.github/workflows/testing.yml +29 -0
- package/LICENSE +21 -21
- package/README.md +258 -259
- package/bin/customizr +71 -71
- package/build/modernizr-custom.js +6 -6
- package/build/modernizr-exclude.js +438 -73
- package/build/modernizr-package.js +6 -6
- package/build/modernizr-prefixed.js +9 -10
- package/build/modernizr-select.js +11 -12
- package/cache/options.json +14 -1
- package/package.json +62 -60
- package/src/builder.js +118 -118
- package/src/crawler.js +298 -298
- package/src/index.js +64 -64
- package/src/metadata.js +33 -33
- package/src/settings.json +34 -34
- package/src/utils.js +226 -226
- package/test/css/should-ignore.scss +9 -9
- package/test/css/vanilla.css +174 -161
- package/test/js/amd.js +23 -3
- package/test/js/vanilla.js +23 -3
- package/test/pretest.js +133 -133
- package/test/runner.js +17 -17
- package/test/settings/cache-invalidate.json +9 -9
- package/test/settings/custom.json +8 -8
- package/test/settings/exclude.json +14 -14
- package/test/settings/prefixed.json +10 -10
- package/test/settings/select.json +15 -15
- package/test/tests.js +415 -415
package/bin/customizr
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var fs = require("fs"),
|
|
5
|
-
pkg = require("../package.json"),
|
|
6
|
-
nopt = require("nopt"),
|
|
7
|
-
path = require("path"),
|
|
8
|
-
customizr = require("../src");
|
|
9
|
-
|
|
10
|
-
var opts = nopt({
|
|
11
|
-
help: Boolean,
|
|
12
|
-
version: Boolean,
|
|
13
|
-
config: path,
|
|
14
|
-
force: Boolean
|
|
15
|
-
}, {
|
|
16
|
-
h: "--help",
|
|
17
|
-
v: "--version",
|
|
18
|
-
c: "--config",
|
|
19
|
-
f: "--force"
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
function help() {
|
|
23
|
-
var out = [
|
|
24
|
-
"Usage: customizr [options]",
|
|
25
|
-
"",
|
|
26
|
-
"General options:",
|
|
27
|
-
" -h, --help # Print options and usage",
|
|
28
|
-
" -v, --version # Print the version number",
|
|
29
|
-
" -c, --config # Path to your Modernizr config JSON file",
|
|
30
|
-
" -f, --force # Ignore cached versions and force build Modernizr",
|
|
31
|
-
""
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
return out.join("\n");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function configInPackage() {
|
|
38
|
-
var config = JSON.parse(fs.readFileSync('package.json'));
|
|
39
|
-
if ('customizr' in config) {
|
|
40
|
-
return config.customizr;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return {};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (opts.help) {
|
|
47
|
-
process.stdout.write(help());
|
|
48
|
-
return process.exit();
|
|
49
|
-
} else if (opts.version) {
|
|
50
|
-
process.stdout.write(pkg.version + "\n");
|
|
51
|
-
return process.exit();
|
|
52
|
-
} else {
|
|
53
|
-
var config = {};
|
|
54
|
-
|
|
55
|
-
if (opts.config) {
|
|
56
|
-
if (fs.existsSync(opts.config)) {
|
|
57
|
-
config = JSON.parse(fs.readFileSync(opts.config));
|
|
58
|
-
|
|
59
|
-
if (path.basename(opts.config) === 'package.json') {
|
|
60
|
-
config = configInPackage();
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
process.stderr.write("Path does not exist.");
|
|
64
|
-
return process.exit();
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
config = configInPackage();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return customizr(config, process.exit);
|
|
71
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var fs = require("fs"),
|
|
5
|
+
pkg = require("../package.json"),
|
|
6
|
+
nopt = require("nopt"),
|
|
7
|
+
path = require("path"),
|
|
8
|
+
customizr = require("../src");
|
|
9
|
+
|
|
10
|
+
var opts = nopt({
|
|
11
|
+
help: Boolean,
|
|
12
|
+
version: Boolean,
|
|
13
|
+
config: path,
|
|
14
|
+
force: Boolean
|
|
15
|
+
}, {
|
|
16
|
+
h: "--help",
|
|
17
|
+
v: "--version",
|
|
18
|
+
c: "--config",
|
|
19
|
+
f: "--force"
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
function help() {
|
|
23
|
+
var out = [
|
|
24
|
+
"Usage: customizr [options]",
|
|
25
|
+
"",
|
|
26
|
+
"General options:",
|
|
27
|
+
" -h, --help # Print options and usage",
|
|
28
|
+
" -v, --version # Print the version number",
|
|
29
|
+
" -c, --config # Path to your Modernizr config JSON file",
|
|
30
|
+
" -f, --force # Ignore cached versions and force build Modernizr",
|
|
31
|
+
""
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
return out.join("\n");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function configInPackage() {
|
|
38
|
+
var config = JSON.parse(fs.readFileSync('package.json'));
|
|
39
|
+
if ('customizr' in config) {
|
|
40
|
+
return config.customizr;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (opts.help) {
|
|
47
|
+
process.stdout.write(help());
|
|
48
|
+
return process.exit();
|
|
49
|
+
} else if (opts.version) {
|
|
50
|
+
process.stdout.write(pkg.version + "\n");
|
|
51
|
+
return process.exit();
|
|
52
|
+
} else {
|
|
53
|
+
var config = {};
|
|
54
|
+
|
|
55
|
+
if (opts.config) {
|
|
56
|
+
if (fs.existsSync(opts.config)) {
|
|
57
|
+
config = JSON.parse(fs.readFileSync(opts.config));
|
|
58
|
+
|
|
59
|
+
if (path.basename(opts.config) === 'package.json') {
|
|
60
|
+
config = configInPackage();
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
process.stderr.write("Path does not exist.");
|
|
64
|
+
return process.exit();
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
config = configInPackage();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return customizr(config, process.exit);
|
|
71
|
+
}
|