js-build-tools 6.1.0 → 6.2.2
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 +89 -25
- package/dist/build.js +5 -2
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +40 -40
- package/dist/bundleMinify.js +18 -18
- package/dist/copyFiles.js +47 -0
- package/dist/copyFiles.min.js +1 -0
- package/dist/copyFonts.js +13 -13
- package/dist/default.js +15 -15
- package/dist/distMinify.js +13 -13
- package/dist/docs.js +19 -0
- package/dist/docs.min.js +1 -0
- package/dist/jsdocDocs.js +15 -0
- package/dist/jsdocDocs.min.js +1 -0
- package/dist/partials/addToReadme.js +25 -25
- package/dist/partials/beginWatcher.js +13 -13
- package/dist/partials/clean.js +15 -15
- package/dist/partials/copyFor.js +10 -2
- package/dist/partials/distFor.js +22 -22
- package/dist/partials/distForSrc.js +12 -12
- package/dist/partials/distSeries.js +20 -20
- package/dist/partials/imagesFor.js +43 -43
- package/dist/partials/jsdocDocsFor.js +155 -0
- package/dist/partials/neostandardLint.js +121 -121
- package/dist/partials/readmeTemplate.js +15 -15
- package/dist/partials/resolveDocsMethod.js +19 -0
- package/dist/partials/runOnChange.js +29 -29
- package/dist/partials/sassFor.js +29 -29
- package/dist/partials/tsFor.js +71 -71
- package/dist/partials/typeDocsFor.js +203 -203
- package/dist/partials.js +149 -135
- package/dist/partials.min.js +1 -1
- package/dist/sourceLint.js +26 -26
- package/dist/test-helpers/neostandardLintWithRealNeostandard.js +49 -49
- package/dist/test-helpers/setUp.js +95 -95
- package/dist/testFull.js +20 -20
- package/dist/testHelpers.js +10 -10
- package/dist/testQuick.js +22 -22
- package/dist/utilities/dotNotate.js +48 -48
- package/dist/utilities/getBundleConfigs.js +28 -28
- package/dist/watchTest.js +16 -16
- package/functions/build.mjs +5 -2
- package/functions/build.test.mjs +50 -1
- package/functions/copyFiles.mjs +32 -0
- package/functions/copyFiles.test.mjs +78 -0
- package/functions/docs.mjs +13 -0
- package/functions/docs.test.mjs +45 -0
- package/functions/jsdocDocs.mjs +10 -0
- package/functions/partials/copyFor.mjs +4 -1
- package/functions/partials/jsdocDocsFor.mjs +132 -0
- package/functions/partials/jsdocDocsFor.test.mjs +101 -0
- package/functions/partials/resolveDocsMethod.mjs +10 -0
- package/functions/partials/resolveDocsMethod.test.mjs +33 -0
- package/functions/partials.mjs +2 -0
- package/functions/partials.test.mjs +1 -1
- package/gulp.config.mjs +28 -5
- package/gulpfile.base.mjs +4 -1
- package/package.json +14 -1
package/dist/partials.js
CHANGED
|
@@ -1,136 +1,150 @@
|
|
|
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, "
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return
|
|
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
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
var
|
|
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, "jsdocDocsFor", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _jsdocDocsFor.jsdocDocsFor;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "minifyFor", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _minifyFor.minifyFor;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "neostandardLint", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _neostandardLint.neostandardLint;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "readmeTemplate", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _readmeTemplate.readmeTemplate;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "removeDirectory", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _removeDirectory.removeDirectory;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "requirePeer", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _loadPeer.requirePeer;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "resolveDocsMethod", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _resolveDocsMethod.resolveDocsMethod;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "runOnChange", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _runOnChange.runOnChange;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "sassFor", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _sassFor.sassFor;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "tsFor", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _tsFor.tsFor;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "typeDocsFor", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _typeDocsFor.typeDocsFor;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
var _addToReadme = require("./partials/addToReadme.js");
|
|
133
|
+
var _beginWatcher = require("./partials/beginWatcher.js");
|
|
134
|
+
var _clean = require("./partials/clean.js");
|
|
135
|
+
var _copyFor = require("./partials/copyFor.js");
|
|
136
|
+
var _distFor = require("./partials/distFor.js");
|
|
137
|
+
var _distForSrc = require("./partials/distForSrc.js");
|
|
138
|
+
var _distSeries = require("./partials/distSeries.js");
|
|
139
|
+
var _imagesFor = require("./partials/imagesFor.js");
|
|
140
|
+
var _loadPeer = require("./partials/loadPeer.js");
|
|
141
|
+
var _jsdocDocsFor = require("./partials/jsdocDocsFor.js");
|
|
142
|
+
var _minifyFor = require("./partials/minifyFor.js");
|
|
143
|
+
var _neostandardLint = require("./partials/neostandardLint.js");
|
|
144
|
+
var _readmeTemplate = require("./partials/readmeTemplate.js");
|
|
145
|
+
var _removeDirectory = require("./partials/removeDirectory.js");
|
|
146
|
+
var _resolveDocsMethod = require("./partials/resolveDocsMethod.js");
|
|
147
|
+
var _runOnChange = require("./partials/runOnChange.js");
|
|
148
|
+
var _sassFor = require("./partials/sassFor.js");
|
|
149
|
+
var _tsFor = require("./partials/tsFor.js");
|
|
136
150
|
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,"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");
|
|
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,"jsdocDocsFor",{enumerable:!0,get:function(){return _jsdocDocsFor.jsdocDocsFor}}),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,"resolveDocsMethod",{enumerable:!0,get:function(){return _resolveDocsMethod.resolveDocsMethod}}),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"),_jsdocDocsFor=require("./partials/jsdocDocsFor.js"),_minifyFor=require("./partials/minifyFor.js"),_neostandardLint=require("./partials/neostandardLint.js"),_readmeTemplate=require("./partials/readmeTemplate.js"),_removeDirectory=require("./partials/removeDirectory.js"),_resolveDocsMethod=require("./partials/resolveDocsMethod.js"),_runOnChange=require("./partials/runOnChange.js"),_sassFor=require("./partials/sassFor.js"),_tsFor=require("./partials/tsFor.js"),_typeDocsFor=require("./partials/typeDocsFor.js");
|
package/dist/sourceLint.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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
|
-
var cache;
|
|
12
|
-
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
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
|
+
var cache;
|
|
12
|
+
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
13
13
|
/**
|
|
14
14
|
* Applies neostandard linting (js-build-tools' chosen style) to the real, hand-written source - not the compiled
|
|
15
15
|
* dist/browser output, which is generated and so was never going to pass a hand-authored-code style check (every
|
|
@@ -18,18 +18,18 @@ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e;
|
|
|
18
18
|
* source. When typescript.enabled, the real TypeScript source is linted too, with type-aware rules.
|
|
19
19
|
* @memberOf module:js-build-tools
|
|
20
20
|
* @returns {*}
|
|
21
|
-
*/
|
|
22
|
-
const sourceLint = () => {
|
|
23
|
-
const srcPath = gulpConfig.get('srcPath');
|
|
24
|
-
const ts = gulpConfig.get('typescript.enabled');
|
|
25
|
-
const patterns = [`${srcPath}/**/*.js`];
|
|
26
|
-
if (ts) {
|
|
27
|
-
patterns.push(`${srcPath}/**/*.ts`);
|
|
28
|
-
}
|
|
29
|
-
return (0, _gulp.src)(patterns).pipe((0, _neostandardLint.neostandardLint)({
|
|
30
|
-
fix: true,
|
|
31
|
-
ts,
|
|
32
|
-
rules: gulpConfig.get('lint.rules')
|
|
33
|
-
})).pipe((0, _gulp.dest)(srcPath));
|
|
34
|
-
};
|
|
21
|
+
*/
|
|
22
|
+
const sourceLint = () => {
|
|
23
|
+
const srcPath = gulpConfig.get('srcPath');
|
|
24
|
+
const ts = gulpConfig.get('typescript.enabled');
|
|
25
|
+
const patterns = [`${srcPath}/**/*.js`];
|
|
26
|
+
if (ts) {
|
|
27
|
+
patterns.push(`${srcPath}/**/*.ts`);
|
|
28
|
+
}
|
|
29
|
+
return (0, _gulp.src)(patterns).pipe((0, _neostandardLint.neostandardLint)({
|
|
30
|
+
fix: true,
|
|
31
|
+
ts,
|
|
32
|
+
rules: gulpConfig.get('lint.rules')
|
|
33
|
+
})).pipe((0, _gulp.dest)(srcPath));
|
|
34
|
+
};
|
|
35
35
|
exports.sourceLint = sourceLint;
|
|
@@ -1,50 +1,50 @@
|
|
|
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, defaultFilePatterns } from \'neostandard\'\n' + 'const { text, filePath, cwd, fix, ts, env, rules } = JSON.parse(readFileSync(0, \'utf8\'))\n' + 'const baseConfig = neostandard({ ts, env })\n' + 'if (Object.keys(rules).length) { baseConfig.push({ files: defaultFilePatterns.all, rules }) }\n' + 'const eslint = new ESLint({ cwd, fix, overrideConfigFile: true, baseConfig })\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
|
-
rules = {}
|
|
27
|
-
}) => Promise.resolve({
|
|
28
|
-
lintText: (text, {
|
|
29
|
-
filePath
|
|
30
|
-
}) => Promise.resolve().then(() => JSON.parse((0, _nodeChild_process.execFileSync)(process.execPath, ['--input-type=module', '--eval', script], {
|
|
31
|
-
input: JSON.stringify({
|
|
32
|
-
text,
|
|
33
|
-
filePath,
|
|
34
|
-
cwd,
|
|
35
|
-
fix,
|
|
36
|
-
ts,
|
|
37
|
-
env: readEnv(cwd),
|
|
38
|
-
rules
|
|
39
|
-
}),
|
|
40
|
-
encoding: 'utf8',
|
|
41
|
-
cwd,
|
|
42
|
-
maxBuffer: 256 * 1024 * 1024
|
|
43
|
-
})))
|
|
44
|
-
});
|
|
45
|
-
exports.loadEslintViaSubprocess = loadEslintViaSubprocess;
|
|
46
|
-
const actual = jest.requireActual('../partials/neostandardLint.js');
|
|
47
|
-
|
|
48
|
-
// Drop-in replacement for the partial module (see jest.mock in the lint/build tests): same API, real neostandard.
|
|
49
|
-
const neostandardLint = options => actual.neostandardLint(options, loadEslintViaSubprocess);
|
|
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, defaultFilePatterns } from \'neostandard\'\n' + 'const { text, filePath, cwd, fix, ts, env, rules } = JSON.parse(readFileSync(0, \'utf8\'))\n' + 'const baseConfig = neostandard({ ts, env })\n' + 'if (Object.keys(rules).length) { baseConfig.push({ files: defaultFilePatterns.all, rules }) }\n' + 'const eslint = new ESLint({ cwd, fix, overrideConfigFile: true, baseConfig })\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
|
+
rules = {}
|
|
27
|
+
}) => Promise.resolve({
|
|
28
|
+
lintText: (text, {
|
|
29
|
+
filePath
|
|
30
|
+
}) => Promise.resolve().then(() => JSON.parse((0, _nodeChild_process.execFileSync)(process.execPath, ['--input-type=module', '--eval', script], {
|
|
31
|
+
input: JSON.stringify({
|
|
32
|
+
text,
|
|
33
|
+
filePath,
|
|
34
|
+
cwd,
|
|
35
|
+
fix,
|
|
36
|
+
ts,
|
|
37
|
+
env: readEnv(cwd),
|
|
38
|
+
rules
|
|
39
|
+
}),
|
|
40
|
+
encoding: 'utf8',
|
|
41
|
+
cwd,
|
|
42
|
+
maxBuffer: 256 * 1024 * 1024
|
|
43
|
+
})))
|
|
44
|
+
});
|
|
45
|
+
exports.loadEslintViaSubprocess = loadEslintViaSubprocess;
|
|
46
|
+
const actual = jest.requireActual('../partials/neostandardLint.js');
|
|
47
|
+
|
|
48
|
+
// Drop-in replacement for the partial module (see jest.mock in the lint/build tests): same API, real neostandard.
|
|
49
|
+
const neostandardLint = options => actual.neostandardLint(options, loadEslintViaSubprocess);
|
|
50
50
|
exports.neostandardLint = neostandardLint;
|