js-build-tools 5.7.0 → 6.0.0
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/README.md +1 -1
- package/dist/build.js +65 -64
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +40 -40
- package/dist/bundleMinify.js +18 -18
- package/dist/compileReadme.js +7 -7
- package/dist/copyFonts.js +10 -10
- package/dist/default.js +12 -12
- package/dist/dist.js +7 -7
- package/dist/distMinify.js +10 -10
- package/dist/images.js +7 -7
- package/dist/partials/addToReadme.js +24 -24
- package/dist/partials/imagesFor.js +42 -42
- package/dist/partials/loadPeer.js +70 -70
- package/dist/partials/neostandardLint.js +144 -0
- package/dist/partials/tsFor.js +70 -70
- package/dist/partials/typeDocsFor.js +202 -202
- package/dist/partials.js +136 -136
- package/dist/partials.min.js +1 -1
- package/dist/sass.js +7 -7
- package/dist/sourceLint.js +33 -0
- package/dist/sourceLint.min.js +1 -0
- package/dist/test-helpers/neostandardLintWithRealNeostandard.js +48 -0
- package/dist/test-helpers/setUp.js +94 -94
- package/dist/testFull.js +13 -13
- package/dist/testHelpers.js +8 -8
- package/dist/testQuick.js +13 -13
- package/dist/typeDocs.js +9 -9
- package/dist/typeScript.js +6 -6
- package/dist/utilities/convertMjsFilesForDocs.js +36 -36
- package/dist/utilities/esmNamedExportsToCjs.js +18 -18
- package/dist/utilities/getBundleConfigs.js +27 -27
- package/dist/watchFull.js +7 -7
- package/dist/watchTest.js +11 -11
- package/functions/build.mjs +9 -8
- package/functions/build.test.mjs +18 -25
- package/functions/partials/neostandardLint.mjs +118 -0
- package/functions/partials/neostandardLint.test.mjs +109 -0
- package/functions/partials.mjs +1 -1
- package/functions/sourceLint.mjs +24 -0
- package/functions/sourceLint.test.mjs +73 -0
- package/functions/test-helpers/neostandardLintWithRealNeostandard.mjs +38 -0
- package/gulpfile.base.js +2 -4
- package/gulpfile.base.mjs +1 -2
- package/package.json +7 -6
- package/dist/bundleLint.js +0 -28
- package/dist/bundleLint.min.js +0 -1
- package/dist/distLint.js +0 -20
- package/dist/distLint.min.js +0 -1
- package/dist/partials/standardLint.js +0 -94
- package/dist/test-helpers/standardLintWithRealStandard.js +0 -28
- package/functions/bundleLint.mjs +0 -18
- package/functions/bundleLint.test.mjs +0 -85
- package/functions/distLint.mjs +0 -12
- package/functions/distLint.test.mjs +0 -62
- package/functions/partials/standardLint.mjs +0 -78
- package/functions/partials/standardLint.test.mjs +0 -99
- package/functions/test-helpers/standardLintWithRealStandard.mjs +0 -21
package/dist/partials.js
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
Object.defineProperty(exports,
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _addToReadme.addToReadme
|
|
10
|
-
}
|
|
11
|
-
})
|
|
12
|
-
Object.defineProperty(exports,
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _beginWatcher.beginWatcher
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
Object.defineProperty(exports,
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _clean.clean
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
Object.defineProperty(exports,
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _copyFor.copyFor
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
Object.defineProperty(exports,
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _distFor.distFor
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
Object.defineProperty(exports,
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _distForSrc.distForSrc
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
Object.defineProperty(exports,
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _distSeries.distSeries
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
Object.defineProperty(exports,
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _imagesFor.imagesFor
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
Object.defineProperty(exports,
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _loadPeer.importModule
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
Object.defineProperty(exports,
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _loadPeer.importPeer
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
Object.defineProperty(exports,
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _minifyFor.minifyFor
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
Object.defineProperty(exports,
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
Object.defineProperty(exports,
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
Object.defineProperty(exports,
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
Object.defineProperty(exports,
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return
|
|
94
|
-
}
|
|
95
|
-
})
|
|
96
|
-
Object.defineProperty(exports,
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
Object.defineProperty(exports,
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
Object.defineProperty(exports,
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return _tsFor.tsFor
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
Object.defineProperty(exports,
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return _typeDocsFor.typeDocsFor
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
var _addToReadme = require(
|
|
121
|
-
var _beginWatcher = require(
|
|
122
|
-
var _clean = require(
|
|
123
|
-
var _copyFor = require(
|
|
124
|
-
var _distFor = require(
|
|
125
|
-
var _distForSrc = require(
|
|
126
|
-
var _distSeries = require(
|
|
127
|
-
var _imagesFor = require(
|
|
128
|
-
var _loadPeer = require(
|
|
129
|
-
var _minifyFor = require(
|
|
130
|
-
var
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var _tsFor = require(
|
|
136
|
-
var _typeDocsFor = require(
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "addToReadme", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _addToReadme.addToReadme;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "beginWatcher", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _beginWatcher.beginWatcher;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "clean", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _clean.clean;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "copyFor", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _copyFor.copyFor;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "distFor", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _distFor.distFor;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "distForSrc", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _distForSrc.distForSrc;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "distSeries", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _distSeries.distSeries;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "imagesFor", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _imagesFor.imagesFor;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "importModule", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _loadPeer.importModule;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "importPeer", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _loadPeer.importPeer;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "minifyFor", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _minifyFor.minifyFor;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "neostandardLint", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _neostandardLint.neostandardLint;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "readmeTemplate", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _readmeTemplate.readmeTemplate;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "removeDirectory", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _removeDirectory.removeDirectory;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "requirePeer", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _loadPeer.requirePeer;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "runOnChange", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _runOnChange.runOnChange;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "sassFor", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _sassFor.sassFor;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "tsFor", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _tsFor.tsFor;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "typeDocsFor", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _typeDocsFor.typeDocsFor;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
var _addToReadme = require("./partials/addToReadme.js");
|
|
121
|
+
var _beginWatcher = require("./partials/beginWatcher.js");
|
|
122
|
+
var _clean = require("./partials/clean.js");
|
|
123
|
+
var _copyFor = require("./partials/copyFor.js");
|
|
124
|
+
var _distFor = require("./partials/distFor.js");
|
|
125
|
+
var _distForSrc = require("./partials/distForSrc.js");
|
|
126
|
+
var _distSeries = require("./partials/distSeries.js");
|
|
127
|
+
var _imagesFor = require("./partials/imagesFor.js");
|
|
128
|
+
var _loadPeer = require("./partials/loadPeer.js");
|
|
129
|
+
var _minifyFor = require("./partials/minifyFor.js");
|
|
130
|
+
var _neostandardLint = require("./partials/neostandardLint.js");
|
|
131
|
+
var _readmeTemplate = require("./partials/readmeTemplate.js");
|
|
132
|
+
var _removeDirectory = require("./partials/removeDirectory.js");
|
|
133
|
+
var _runOnChange = require("./partials/runOnChange.js");
|
|
134
|
+
var _sassFor = require("./partials/sassFor.js");
|
|
135
|
+
var _tsFor = require("./partials/tsFor.js");
|
|
136
|
+
var _typeDocsFor = require("./partials/typeDocsFor.js");
|
package/dist/partials.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"addToReadme",{enumerable:!0,get:function(){return _addToReadme.addToReadme}}),Object.defineProperty(exports,"beginWatcher",{enumerable:!0,get:function(){return _beginWatcher.beginWatcher}}),Object.defineProperty(exports,"clean",{enumerable:!0,get:function(){return _clean.clean}}),Object.defineProperty(exports,"copyFor",{enumerable:!0,get:function(){return _copyFor.copyFor}}),Object.defineProperty(exports,"distFor",{enumerable:!0,get:function(){return _distFor.distFor}}),Object.defineProperty(exports,"distForSrc",{enumerable:!0,get:function(){return _distForSrc.distForSrc}}),Object.defineProperty(exports,"distSeries",{enumerable:!0,get:function(){return _distSeries.distSeries}}),Object.defineProperty(exports,"imagesFor",{enumerable:!0,get:function(){return _imagesFor.imagesFor}}),Object.defineProperty(exports,"importModule",{enumerable:!0,get:function(){return _loadPeer.importModule}}),Object.defineProperty(exports,"importPeer",{enumerable:!0,get:function(){return _loadPeer.importPeer}}),Object.defineProperty(exports,"minifyFor",{enumerable:!0,get:function(){return _minifyFor.minifyFor}}),Object.defineProperty(exports,"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"addToReadme",{enumerable:!0,get:function(){return _addToReadme.addToReadme}}),Object.defineProperty(exports,"beginWatcher",{enumerable:!0,get:function(){return _beginWatcher.beginWatcher}}),Object.defineProperty(exports,"clean",{enumerable:!0,get:function(){return _clean.clean}}),Object.defineProperty(exports,"copyFor",{enumerable:!0,get:function(){return _copyFor.copyFor}}),Object.defineProperty(exports,"distFor",{enumerable:!0,get:function(){return _distFor.distFor}}),Object.defineProperty(exports,"distForSrc",{enumerable:!0,get:function(){return _distForSrc.distForSrc}}),Object.defineProperty(exports,"distSeries",{enumerable:!0,get:function(){return _distSeries.distSeries}}),Object.defineProperty(exports,"imagesFor",{enumerable:!0,get:function(){return _imagesFor.imagesFor}}),Object.defineProperty(exports,"importModule",{enumerable:!0,get:function(){return _loadPeer.importModule}}),Object.defineProperty(exports,"importPeer",{enumerable:!0,get:function(){return _loadPeer.importPeer}}),Object.defineProperty(exports,"minifyFor",{enumerable:!0,get:function(){return _minifyFor.minifyFor}}),Object.defineProperty(exports,"neostandardLint",{enumerable:!0,get:function(){return _neostandardLint.neostandardLint}}),Object.defineProperty(exports,"readmeTemplate",{enumerable:!0,get:function(){return _readmeTemplate.readmeTemplate}}),Object.defineProperty(exports,"removeDirectory",{enumerable:!0,get:function(){return _removeDirectory.removeDirectory}}),Object.defineProperty(exports,"requirePeer",{enumerable:!0,get:function(){return _loadPeer.requirePeer}}),Object.defineProperty(exports,"runOnChange",{enumerable:!0,get:function(){return _runOnChange.runOnChange}}),Object.defineProperty(exports,"sassFor",{enumerable:!0,get:function(){return _sassFor.sassFor}}),Object.defineProperty(exports,"tsFor",{enumerable:!0,get:function(){return _tsFor.tsFor}}),Object.defineProperty(exports,"typeDocsFor",{enumerable:!0,get:function(){return _typeDocsFor.typeDocsFor}});var _addToReadme=require("./partials/addToReadme.js"),_beginWatcher=require("./partials/beginWatcher.js"),_clean=require("./partials/clean.js"),_copyFor=require("./partials/copyFor.js"),_distFor=require("./partials/distFor.js"),_distForSrc=require("./partials/distForSrc.js"),_distSeries=require("./partials/distSeries.js"),_imagesFor=require("./partials/imagesFor.js"),_loadPeer=require("./partials/loadPeer.js"),_minifyFor=require("./partials/minifyFor.js"),_neostandardLint=require("./partials/neostandardLint.js"),_readmeTemplate=require("./partials/readmeTemplate.js"),_removeDirectory=require("./partials/removeDirectory.js"),_runOnChange=require("./partials/runOnChange.js"),_sassFor=require("./partials/sassFor.js"),_tsFor=require("./partials/tsFor.js"),_typeDocsFor=require("./partials/typeDocsFor.js");
|
package/dist/sass.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.sass = void 0
|
|
7
|
-
|
|
5
|
+
});
|
|
6
|
+
exports.sass = void 0;
|
|
7
|
+
var _sassFor = require("./partials/sassFor.js");
|
|
8
8
|
// Compile sass into CSS & auto-inject into browsers
|
|
9
|
-
const sass = () => (0, _sassFor.sassFor)()
|
|
10
|
-
exports.sass = sass
|
|
9
|
+
const sass = () => (0, _sassFor.sassFor)();
|
|
10
|
+
exports.sass = sass;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.sourceLint = void 0;
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
+
var _gulp = require("gulp");
|
|
10
|
+
var _neostandardLint = require("./partials/neostandardLint.js");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* Applies neostandard linting (js-build-tools' chosen style) to the real, hand-written source - not the compiled
|
|
14
|
+
* dist/browser output, which is generated and so was never going to pass a hand-authored-code style check (every
|
|
15
|
+
* compiler/bundler emits its own boilerplate - import aliasing, interop headers - that only looks like a style
|
|
16
|
+
* violation). Includes test files: there is no reason to hold tests to a lower style bar than the rest of the
|
|
17
|
+
* source. When typescript.enabled, the real TypeScript source is linted too, with type-aware rules.
|
|
18
|
+
* @memberOf module:js-build-tools
|
|
19
|
+
* @returns {*}
|
|
20
|
+
*/
|
|
21
|
+
const sourceLint = () => {
|
|
22
|
+
const srcPath = gulpConfig.get('srcPath');
|
|
23
|
+
const ts = gulpConfig.get('typescript.enabled');
|
|
24
|
+
const patterns = [`${srcPath}/**/*.js`];
|
|
25
|
+
if (ts) {
|
|
26
|
+
patterns.push(`${srcPath}/**/*.ts`);
|
|
27
|
+
}
|
|
28
|
+
return (0, _gulp.src)(patterns).pipe((0, _neostandardLint.neostandardLint)({
|
|
29
|
+
fix: true,
|
|
30
|
+
ts
|
|
31
|
+
})).pipe((0, _gulp.dest)(srcPath));
|
|
32
|
+
};
|
|
33
|
+
exports.sourceLint = sourceLint;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.sourceLint=void 0;var gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_gulp=require("gulp"),_neostandardLint=require("./partials/neostandardLint.js");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var i,o,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(i=t?n:r){if(i.has(e))return i.get(e);i.set(e,u)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?i(u,t,o):u[t]=e[t]);return u})(e,t)}const sourceLint=()=>{const e=gulpConfig.get("srcPath"),t=gulpConfig.get("typescript.enabled"),r=[`${e}/**/*.js`];return t&&r.push(`${e}/**/*.ts`),(0,_gulp.src)(r).pipe((0,_neostandardLint.neostandardLint)({fix:!0,ts:t})).pipe((0,_gulp.dest)(e))};exports.sourceLint=sourceLint;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.neostandardLint = exports.loadEslintViaSubprocess = void 0;
|
|
7
|
+
require("core-js/modules/es.json.stringify.js");
|
|
8
|
+
var _nodeChild_process = require("node:child_process");
|
|
9
|
+
var _nodeFs = _interopRequireDefault(require("node:fs"));
|
|
10
|
+
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
// Jest's CommonJS transform cannot load `neostandard` (ESM-only) or run a real dynamic import(), so tests that need
|
|
13
|
+
// genuine neostandard behavior run the actual package in a plain Node subprocess instead of faking it.
|
|
14
|
+
const script = 'import { readFileSync } from \'node:fs\'\n' + 'import { ESLint } from \'eslint\'\n' + 'import { neostandard } from \'neostandard\'\n' + 'const { text, filePath, cwd, fix, ts, env } = JSON.parse(readFileSync(0, \'utf8\'))\n' + 'const eslint = new ESLint({ cwd, fix, overrideConfigFile: true, baseConfig: neostandard({ ts, env }) })\n' + 'process.stdout.write(JSON.stringify(await eslint.lintText(text, { filePath })))\n';
|
|
15
|
+
const readEnv = cwd => {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse(_nodeFs.default.readFileSync(_nodePath.default.join(cwd, 'package.json'), 'utf8')).standard?.env ?? [];
|
|
18
|
+
} catch {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const loadEslintViaSubprocess = ({
|
|
23
|
+
cwd,
|
|
24
|
+
ts,
|
|
25
|
+
fix
|
|
26
|
+
}) => Promise.resolve({
|
|
27
|
+
lintText: (text, {
|
|
28
|
+
filePath
|
|
29
|
+
}) => Promise.resolve().then(() => JSON.parse((0, _nodeChild_process.execFileSync)(process.execPath, ['--input-type=module', '--eval', script], {
|
|
30
|
+
input: JSON.stringify({
|
|
31
|
+
text,
|
|
32
|
+
filePath,
|
|
33
|
+
cwd,
|
|
34
|
+
fix,
|
|
35
|
+
ts,
|
|
36
|
+
env: readEnv(cwd)
|
|
37
|
+
}),
|
|
38
|
+
encoding: 'utf8',
|
|
39
|
+
cwd,
|
|
40
|
+
maxBuffer: 256 * 1024 * 1024
|
|
41
|
+
})))
|
|
42
|
+
});
|
|
43
|
+
exports.loadEslintViaSubprocess = loadEslintViaSubprocess;
|
|
44
|
+
const actual = jest.requireActual('../partials/neostandardLint.js');
|
|
45
|
+
|
|
46
|
+
// Drop-in replacement for the partial module (see jest.mock in the lint/build tests): same API, real neostandard.
|
|
47
|
+
const neostandardLint = options => actual.neostandardLint(options, loadEslintViaSubprocess);
|
|
48
|
+
exports.neostandardLint = neostandardLint;
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "afterEach", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _testFilesystem.afterEach;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "beforeEach", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _testFilesystem.beforeEach;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "countMatches", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _testFilesystem.countMatches;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "createTempDir", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _testFilesystem.createTempDir;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "fileExists", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () {
|
|
34
|
-
return _testFilesystem.fileExists;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
exports.gulpConfig = void 0;
|
|
38
|
-
Object.defineProperty(exports, "logObject", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _testFilesystem.logObject;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "removeDirectory", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () {
|
|
47
|
-
return _testFilesystem.removeDirectory;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
exports.setDefaults = void 0;
|
|
51
|
-
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
52
|
-
exports.gulpConfig = gulpConfig;
|
|
53
|
-
var _testFilesystem = require("test-filesystem");
|
|
54
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
55
|
-
// Import the configurations and override some of them to direct to the temp directory.
|
|
56
|
-
|
|
57
|
-
let tempDir = 'test-temp/';
|
|
58
|
-
let srcPath = `${tempDir}src`;
|
|
59
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "afterEach", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _testFilesystem.afterEach;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "beforeEach", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _testFilesystem.beforeEach;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "countMatches", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _testFilesystem.countMatches;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "createTempDir", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _testFilesystem.createTempDir;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "fileExists", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _testFilesystem.fileExists;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
exports.gulpConfig = void 0;
|
|
38
|
+
Object.defineProperty(exports, "logObject", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _testFilesystem.logObject;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "removeDirectory", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _testFilesystem.removeDirectory;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
exports.setDefaults = void 0;
|
|
51
|
+
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
52
|
+
exports.gulpConfig = gulpConfig;
|
|
53
|
+
var _testFilesystem = require("test-filesystem");
|
|
54
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
55
|
+
// Import the configurations and override some of them to direct to the temp directory.
|
|
56
|
+
|
|
57
|
+
let tempDir = 'test-temp/';
|
|
58
|
+
let srcPath = `${tempDir}src`;
|
|
59
|
+
|
|
60
60
|
/**
|
|
61
61
|
* Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
|
|
62
62
|
* @memberOf module:testHelpers
|
|
63
63
|
* @param {string} testDir
|
|
64
|
-
*/
|
|
65
|
-
const setDefaults = (testDir = 'test-temp') => {
|
|
66
|
-
tempDir = `${testDir}/`;
|
|
67
|
-
srcPath = `${tempDir}src`;
|
|
68
|
-
_testFilesystem.setUp.setDefaults(tempDir);
|
|
69
|
-
const distPath = `${tempDir}dist`;
|
|
70
|
-
const browserPath = `${tempDir}browser`;
|
|
71
|
-
const sassPath = `${tempDir}sass`;
|
|
72
|
-
gulpConfig.set('browser.from', `${distPath}/**/*.js`);
|
|
73
|
-
gulpConfig.set('browser.to', browserPath);
|
|
74
|
-
gulpConfig.set('cleanPaths', [distPath, browserPath]);
|
|
75
|
-
gulpConfig.set('dist.from', `${srcPath}/**/!(*.test).js`);
|
|
76
|
-
gulpConfig.set('dist.main', `${distPath}/main`);
|
|
77
|
-
gulpConfig.set('dist.to', distPath);
|
|
78
|
-
gulpConfig.set('fonts.from', `${srcPath}/fonts/**/*`);
|
|
79
|
-
gulpConfig.set('fonts.to', `${browserPath}/fonts`);
|
|
80
|
-
gulpConfig.set('images.from', `${srcPath}/img/**/*.+(png|jpg|jpeg|gif|svg)`);
|
|
81
|
-
gulpConfig.set('images.to', `${browserPath}/img`);
|
|
82
|
-
gulpConfig.set('readme.template', `${tempDir}MAIN.md`);
|
|
83
|
-
gulpConfig.set('readme.to', tempDir);
|
|
84
|
-
gulpConfig.set('readme.from', `${srcPath}/**/!(*.test).js`);
|
|
85
|
-
// Reset explicitly: gulpConfig is a process-wide singleton seeded once from this real project's own
|
|
86
|
-
// build-tools.config.json, so without this, this project's own real readme.fromEsm value (gulp.config.mjs)
|
|
87
|
-
// would leak into every test that exercises addToReadme/compileReadme but never sets this path itself -
|
|
88
|
-
// doing real file I/O and a real jsdoc-to-markdown parse of this project's own, much larger, config file.
|
|
89
|
-
gulpConfig.set('readme.fromEsm', []);
|
|
90
|
-
gulpConfig.set('rootPath', tempDir);
|
|
91
|
-
gulpConfig.set('sass.from', `${sassPath}/**/*.+(scss|sass)`);
|
|
92
|
-
gulpConfig.set('sass.path', sassPath);
|
|
93
|
-
gulpConfig.set('sass.to', `${browserPath}/css`);
|
|
94
|
-
gulpConfig.set('srcPath', srcPath);
|
|
95
|
-
gulpConfig.set('typescript.from', `${srcPath}/**/*.ts`);
|
|
96
|
-
gulpConfig.set('typescript.to', distPath);
|
|
97
|
-
gulpConfig.set('test.watch', `${srcPath}/**/*.js`);
|
|
98
|
-
};
|
|
64
|
+
*/
|
|
65
|
+
const setDefaults = (testDir = 'test-temp') => {
|
|
66
|
+
tempDir = `${testDir}/`;
|
|
67
|
+
srcPath = `${tempDir}src`;
|
|
68
|
+
_testFilesystem.setUp.setDefaults(tempDir);
|
|
69
|
+
const distPath = `${tempDir}dist`;
|
|
70
|
+
const browserPath = `${tempDir}browser`;
|
|
71
|
+
const sassPath = `${tempDir}sass`;
|
|
72
|
+
gulpConfig.set('browser.from', `${distPath}/**/*.js`);
|
|
73
|
+
gulpConfig.set('browser.to', browserPath);
|
|
74
|
+
gulpConfig.set('cleanPaths', [distPath, browserPath]);
|
|
75
|
+
gulpConfig.set('dist.from', `${srcPath}/**/!(*.test).js`);
|
|
76
|
+
gulpConfig.set('dist.main', `${distPath}/main`);
|
|
77
|
+
gulpConfig.set('dist.to', distPath);
|
|
78
|
+
gulpConfig.set('fonts.from', `${srcPath}/fonts/**/*`);
|
|
79
|
+
gulpConfig.set('fonts.to', `${browserPath}/fonts`);
|
|
80
|
+
gulpConfig.set('images.from', `${srcPath}/img/**/*.+(png|jpg|jpeg|gif|svg)`);
|
|
81
|
+
gulpConfig.set('images.to', `${browserPath}/img`);
|
|
82
|
+
gulpConfig.set('readme.template', `${tempDir}MAIN.md`);
|
|
83
|
+
gulpConfig.set('readme.to', tempDir);
|
|
84
|
+
gulpConfig.set('readme.from', `${srcPath}/**/!(*.test).js`);
|
|
85
|
+
// Reset explicitly: gulpConfig is a process-wide singleton seeded once from this real project's own
|
|
86
|
+
// build-tools.config.json, so without this, this project's own real readme.fromEsm value (gulp.config.mjs)
|
|
87
|
+
// would leak into every test that exercises addToReadme/compileReadme but never sets this path itself -
|
|
88
|
+
// doing real file I/O and a real jsdoc-to-markdown parse of this project's own, much larger, config file.
|
|
89
|
+
gulpConfig.set('readme.fromEsm', []);
|
|
90
|
+
gulpConfig.set('rootPath', tempDir);
|
|
91
|
+
gulpConfig.set('sass.from', `${sassPath}/**/*.+(scss|sass)`);
|
|
92
|
+
gulpConfig.set('sass.path', sassPath);
|
|
93
|
+
gulpConfig.set('sass.to', `${browserPath}/css`);
|
|
94
|
+
gulpConfig.set('srcPath', srcPath);
|
|
95
|
+
gulpConfig.set('typescript.from', `${srcPath}/**/*.ts`);
|
|
96
|
+
gulpConfig.set('typescript.to', distPath);
|
|
97
|
+
gulpConfig.set('test.watch', `${srcPath}/**/*.js`);
|
|
98
|
+
};
|
|
99
99
|
exports.setDefaults = setDefaults;
|
package/dist/testFull.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
require(
|
|
4
|
-
Object.defineProperty(exports,
|
|
3
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
|
-
})
|
|
7
|
-
exports.testFull = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function _interopRequireWildcard
|
|
6
|
+
});
|
|
7
|
+
exports.testFull = void 0;
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
+
var _jest = require("jest");
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
11
|
/**
|
|
12
12
|
* Run all tests with jest.
|
|
13
13
|
* Configure where tests are located by using 'testPath'.
|
|
@@ -15,11 +15,11 @@ function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var
|
|
|
15
15
|
* @returns {Promise<*>}
|
|
16
16
|
*/
|
|
17
17
|
const testFull = () => {
|
|
18
|
-
let testPath = gulpConfig.get('test.path')
|
|
18
|
+
let testPath = gulpConfig.get('test.path');
|
|
19
19
|
if (!Array.isArray(testPath)) {
|
|
20
20
|
// The testPath must be an array of strings
|
|
21
|
-
testPath = [testPath]
|
|
21
|
+
testPath = [testPath];
|
|
22
22
|
}
|
|
23
|
-
return (0, _jest.runCLI)(gulpConfig.get('test.options'), testPath)
|
|
24
|
-
}
|
|
25
|
-
exports.testFull = testFull
|
|
23
|
+
return (0, _jest.runCLI)(gulpConfig.get('test.options'), testPath);
|
|
24
|
+
};
|
|
25
|
+
exports.testFull = testFull;
|