js-build-tools 5.6.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 +98 -3
- 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 +14 -3
- 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 +5 -0
- 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 +48 -0
- package/dist/utilities/esmNamedExportsToCjs.js +33 -0
- 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/addToReadme.mjs +14 -5
- 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/functions/test-helpers/setUp.mjs +5 -0
- package/functions/utilities/convertMjsFilesForDocs.mjs +33 -0
- package/functions/utilities/convertMjsFilesForDocs.test.mjs +57 -0
- package/functions/utilities/esmNamedExportsToCjs.mjs +29 -0
- package/functions/utilities/esmNamedExportsToCjs.test.mjs +47 -0
- package/gulp.config.mjs +4 -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;
|
|
@@ -82,6 +82,11 @@ const setDefaults = (testDir = 'test-temp') => {
|
|
|
82
82
|
gulpConfig.set('readme.template', `${tempDir}MAIN.md`);
|
|
83
83
|
gulpConfig.set('readme.to', tempDir);
|
|
84
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', []);
|
|
85
90
|
gulpConfig.set('rootPath', tempDir);
|
|
86
91
|
gulpConfig.set('sass.from', `${sassPath}/**/*.+(scss|sass)`);
|
|
87
92
|
gulpConfig.set('sass.path', sassPath);
|
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;
|
package/dist/testHelpers.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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.testHelpers = void 0
|
|
8
|
-
|
|
9
|
-
exports.testHelpers = _testHelpers
|
|
10
|
-
function _interopRequireWildcard
|
|
6
|
+
});
|
|
7
|
+
exports.testHelpers = void 0;
|
|
8
|
+
var _testHelpers = _interopRequireWildcard(require("./test-helpers/setUp.js"));
|
|
9
|
+
exports.testHelpers = _testHelpers;
|
|
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); }
|
package/dist/testQuick.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.testQuick = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function _interopRequireWildcard
|
|
6
|
+
});
|
|
7
|
+
exports.testQuick = 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 the Jest tests for files which have been modified (based on git status).
|
|
13
13
|
* Configure where tests are located by using 'testPath'.
|
|
@@ -15,13 +15,13 @@ function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var
|
|
|
15
15
|
* @returns {Promise<*>}
|
|
16
16
|
*/
|
|
17
17
|
const testQuick = () => {
|
|
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
23
|
return (0, _jest.runCLI)({
|
|
24
24
|
onlyChanged: true
|
|
25
|
-
}, testPath)
|
|
26
|
-
}
|
|
27
|
-
exports.testQuick = testQuick
|
|
25
|
+
}, testPath);
|
|
26
|
+
};
|
|
27
|
+
exports.testQuick = testQuick;
|
package/dist/typeDocs.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.typeDocs = void 0
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.typeDocs = void 0;
|
|
7
|
+
var _typeDocsFor = require("./partials/typeDocsFor.js");
|
|
8
8
|
/**
|
|
9
9
|
* Generate the HTML documentation of a TypeScript project from its source, with the modules mirroring the source
|
|
10
10
|
* folders. Turn it on with docs.enabled, see {@link module:partials.typeDocsFor}.
|
|
11
11
|
* @memberOf module:js-build-tools
|
|
12
12
|
* @returns {Function}
|
|
13
|
-
*/
|
|
14
|
-
const typeDocs = exports.typeDocs = (0, _typeDocsFor.typeDocsFor)()
|
|
13
|
+
*/
|
|
14
|
+
const typeDocs = exports.typeDocs = (0, _typeDocsFor.typeDocsFor)();
|
package/dist/typeScript.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.typeScript = void 0
|
|
7
|
-
|
|
5
|
+
});
|
|
6
|
+
exports.typeScript = void 0;
|
|
7
|
+
var _tsFor = require("./partials/tsFor.js");
|
|
8
8
|
/**
|
|
9
9
|
* Simplified typescript task using tsFor.
|
|
10
10
|
* @memberOf module:js-build-tools
|
|
11
11
|
* @returns {Function}
|
|
12
12
|
*/
|
|
13
|
-
const typeScript = exports.typeScript = (0, _tsFor.tsFor)()
|
|
13
|
+
const typeScript = exports.typeScript = (0, _tsFor.tsFor)();
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.convertMjsFilesForDocs = void 0;
|
|
7
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
9
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
10
|
+
var _os = _interopRequireDefault(require("os"));
|
|
11
|
+
var _path = _interopRequireDefault(require("path"));
|
|
12
|
+
var _esmNamedExportsToCjs = require("./esmNamedExportsToCjs.js");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/**
|
|
15
|
+
* Writes a rewritten (see {@link esmNamedExportsToCjs}) copy of each given `.mjs` file into a fresh, unique
|
|
16
|
+
* directory under the OS temp directory, with a `.js` extension - jsdoc-to-markdown only recognizes `.js` as a
|
|
17
|
+
* documentable file, regardless of whether its contents are actually CommonJS or ESM (it parses the real ESM
|
|
18
|
+
* syntax of the rest of a file fine; the extension is the only thing it filters on). Writing outside the project
|
|
19
|
+
* tree means there is nothing to gitignore and nothing left behind in the project - call the returned `cleanUp`
|
|
20
|
+
* once done (for example, right after jsdoc-to-markdown has read the files) to remove the temp directory.
|
|
21
|
+
* @memberOf module:utilities
|
|
22
|
+
* @param {Array<string>} mjsFilePaths - Real `.mjs` files to convert. An empty array is a safe, cheap no-op.
|
|
23
|
+
* @returns {{filePaths: Array<string>, cleanUp: function(): void}} The temp `.js` file paths to pass to
|
|
24
|
+
* jsdoc-to-markdown instead of the real `.mjs` ones, and a function to remove the temp directory afterward.
|
|
25
|
+
*/
|
|
26
|
+
const convertMjsFilesForDocs = (mjsFilePaths = []) => {
|
|
27
|
+
if (mjsFilePaths.length === 0) {
|
|
28
|
+
return {
|
|
29
|
+
filePaths: [],
|
|
30
|
+
cleanUp: () => {}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const tempDir = _fs.default.mkdtempSync(_path.default.join(_os.default.tmpdir(), 'js-build-tools-docs-'));
|
|
34
|
+
const filePaths = mjsFilePaths.map(mjsFilePath => {
|
|
35
|
+
const tempFilePath = _path.default.join(tempDir, _path.default.basename(mjsFilePath, '.js') + '.js');
|
|
36
|
+
const source = _fs.default.readFileSync(mjsFilePath, 'utf8');
|
|
37
|
+
_fs.default.writeFileSync(tempFilePath, (0, _esmNamedExportsToCjs.esmNamedExportsToCjs)(source));
|
|
38
|
+
return tempFilePath;
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
filePaths,
|
|
42
|
+
cleanUp: () => _fs.default.rmSync(tempDir, {
|
|
43
|
+
recursive: true,
|
|
44
|
+
force: true
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
exports.convertMjsFilesForDocs = convertMjsFilesForDocs;
|