Skip to content

Commit 1459890

Browse files
authored
Merge pull request #1422 from blackflux/dev
[Gally]: master <- dev
2 parents d602095 + 5c4f87d commit 1459890

20 files changed

+835
-591
lines changed

.c8rc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"gardener.js",
1313
"node_modules/*",
1414
"coverage/*",
15-
"lib/*"
15+
"lib/*",
16+
"test/hot.js"
1617
],
1718
"extension": [],
1819
"skip-full": true,

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ workflows:
99
- test-node-v14:
1010
requires:
1111
- gally-create-pr
12-
- test-node-v17:
12+
- test-node-v18:
1313
requires:
1414
- gally-create-pr
1515
- gally-auto-approve:
1616
requires:
1717
- gally-create-pr
1818
- test-node-v16
1919
- test-node-v14
20-
- test-node-v17
20+
- test-node-v18
2121
filters:
2222
branches:
2323
only: /dependabot\/.*/
@@ -26,7 +26,7 @@ workflows:
2626
- gally-create-pr
2727
- test-node-v16
2828
- test-node-v14
29-
- test-node-v17
29+
- test-node-v18
3030
filters:
3131
branches:
3232
only: master
@@ -157,9 +157,9 @@ jobs:
157157
- run: >-
158158
(git add . && git diff-index --quiet HEAD --) || (git status && exit
159159
1);
160-
test-node-v17:
160+
test-node-v18:
161161
docker:
162-
- image: circleci/node:17
162+
- image: cimg/node:18.0
163163
steps:
164164
- checkout
165165
- run:

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"mocha/no-mocha-arrows": 0,
3939
"mocha/no-hooks-for-single-case": 0,
4040
"import/no-useless-path-segments": [2, {"commonjs": true}],
41-
"import/extensions": [2, "always"]
41+
"import/extensions": [2, "always"],
42+
"import/prefer-default-export": 0
4243
},
4344
"env": {"es6": true, "node": true, "mocha": true},
4445
"globals": {},

.gally.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"ci/circleci: gally-create-pr",
2626
"ci/circleci: test-node-v16",
2727
"ci/circleci: test-node-v14",
28-
"ci/circleci: test-node-v17"
28+
"ci/circleci: test-node-v18"
2929
]
3030
},
3131
"enforce_admins": true,

.roboconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"owner": "simlu",
1111
"nodeVersion": "14",
1212
"ownerName": "Lukas Siemon",
13-
"mergeBot": "MrsFlux"
13+
"mergeBot": "MrsFlux",
14+
"nccEnabled": true
1415
}
1516
}
1617
}

.roboconfig.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"gardener.js",
1717
"package.json",
1818
"src/index.js",
19+
"test/hot.js",
1920
"test/index.spec.js"
2021
]
2122
}

CONFDOCS.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Documents configuration tasks managed by [robo-config](https://github.com/blackf
88
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structnpm-default">:open_file_folder:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structnpm-default">`struct/#npm-default`</a>
99
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structforce-gardener">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structforce-gardener">`struct/force-gardener`</a>
1010
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structnpm-base">:open_file_folder:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structnpm-base">`struct/#npm-base`</a>
11+
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtest-hot">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtest-hot">`struct/test-hot`</a>
1112
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-readme">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-readme">`struct/template-readme`</a>
1213
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-mocharc">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-mocharc">`struct/template-mocharc`</a>
1314
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-index-test">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-index-test">`struct/template-index-test`</a>
@@ -88,6 +89,7 @@ Manage various configuration files for an open source npm package on github.
8889
<code>├─&nbsp;src</code><br/>
8990
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
9091
<code>└─&nbsp;test</code><br/>
92+
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
9193
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
9294
</ul>
9395
</td>
@@ -116,6 +118,7 @@ Manage various configuration files for an open source npm package on github.
116118
<td align="left" valign="top">
117119
<ul>
118120
<li><a href="#blackfluxrobo-config-plugin-var-ref-packagename">packageName</a></li>
121+
<li><a href="#blackfluxrobo-config-plugin-var-ref-nccenabled">nccEnabled</a></li>
119122
<li><a href="#blackfluxrobo-config-plugin-var-ref-nodeversion">nodeVersion</a></li>
120123
<li><a href="#blackfluxrobo-config-plugin-var-ref-repokey">repoKey</a></li>
121124
<li><a href="#blackfluxrobo-config-plugin-var-ref-ownername">ownerName</a></li>
@@ -150,6 +153,7 @@ Manage basic project structure for npm package on github.
150153
<code>├─&nbsp;src</code><br/>
151154
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
152155
<code>└─&nbsp;test</code><br/>
156+
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
153157
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
154158
</ul>
155159
</td>
@@ -221,6 +225,7 @@ Manage basic project structure for npm package on github.
221225
<code>├─&nbsp;src</code><br/>
222226
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
223227
<code>└─&nbsp;test</code><br/>
228+
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
224229
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
225230
</ul>
226231
</td>
@@ -241,6 +246,35 @@ Manage basic project structure for npm package on github.
241246
</tbody>
242247
</table>
243248

249+
###### :clipboard: <a name="blackfluxrobo-config-plugin-task-ref-structtest-hot">struct/test-hot</a> (<a href="#blackfluxrobo-config-plugin-task-idx-ref-structtest-hot">`index`</a>)
250+
251+
_Updating <a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">test/hot.js</a> using <a href="#blackfluxrobo-config-plugin-strat-ref-overwrite">overwrite</a>._
252+
253+
- Create custom loader file.
254+
255+
<table>
256+
<tbody>
257+
<tr>
258+
<th>Targets</th>
259+
<th>Requires</th>
260+
</tr>
261+
<tr>
262+
<td align="left" valign="top">
263+
<ul>
264+
<code>project</code><br/>
265+
<code>└─&nbsp;test</code><br/>
266+
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
267+
</ul>
268+
</td>
269+
<td align="left" valign="top">
270+
<ul>
271+
<li><a href="#blackfluxrobo-config-plugin-req-ref-javascript">javascript</a></li>
272+
</ul>
273+
</td>
274+
</tr>
275+
</tbody>
276+
</table>
277+
244278
###### :clipboard: <a name="blackfluxrobo-config-plugin-task-ref-structtemplate-readme">struct/template-readme</a> (<a href="#blackfluxrobo-config-plugin-task-idx-ref-structtemplate-readme">`index`</a>)
245279

246280
_Updating <a href="#blackfluxrobo-config-plugin-target-ref-readmemd">README.md</a> using <a href="#blackfluxrobo-config-plugin-strat-ref-create-only">create-only</a>._
@@ -465,6 +499,7 @@ Manage package.json for npm package on github.
465499
</td>
466500
<td align="left" valign="top">
467501
<ul>
502+
<li><a href="#blackfluxrobo-config-plugin-var-ref-nccenabled">nccEnabled</a></li>
468503
<li><a href="#blackfluxrobo-config-plugin-var-ref-nodeversion">nodeVersion</a></li>
469504
<li><a href="#blackfluxrobo-config-plugin-var-ref-repokey">repoKey</a></li>
470505
<li><a href="#blackfluxrobo-config-plugin-var-ref-packagename">packageName</a></li>
@@ -485,6 +520,7 @@ _Updating <a href="#blackfluxrobo-config-plugin-target-ref-packagejson">package.
485520
<tr>
486521
<th>Targets</th>
487522
<th>Requires</th>
523+
<th>Variables</th>
488524
</tr>
489525
<tr>
490526
<td align="left" valign="top">
@@ -498,6 +534,11 @@ _Updating <a href="#blackfluxrobo-config-plugin-target-ref-packagejson">package.
498534
<li><a href="#blackfluxrobo-config-plugin-req-ref-javascript">javascript</a></li>
499535
</ul>
500536
</td>
537+
<td align="left" valign="top">
538+
<ul>
539+
<li><a href="#blackfluxrobo-config-plugin-var-ref-nccenabled">nccEnabled</a></li>
540+
</ul>
541+
</td>
501542
</tr>
502543
</tbody>
503544
</table>
@@ -1698,6 +1739,13 @@ Enables displaying of a status badge indicated whether the dependencies are outd
16981739
The name of the project as published to npm.
16991740
Note that for scoped packages the name can differ significantly from the repo name.
17001741

1742+
### <a name="blackfluxrobo-config-plugin-var-ref-nccenabled">nccEnabled</a> : `boolean`
1743+
1744+
*Enable ncc for service.*
1745+
1746+
Uses NCC to compile service.
1747+
Please ensure that the service still works after ncc compilation.
1748+
17011749
### <a name="blackfluxrobo-config-plugin-var-ref-nodeversion">nodeVersion</a> : `string`
17021750

17031751
*The minimum node version targeted.*
@@ -1746,6 +1794,12 @@ The code owner is the gatekeeper of the project, ultimately responsible for all
17461794

17471795
Execute all configured js-gardener tasks.
17481796

1797+
### <a name="blackfluxrobo-config-plugin-target-ref-testhotjs">test/hot.js</a>
1798+
1799+
:small_blue_diamond: `other`
1800+
1801+
*Custom loader to allow hot reloading of files for testing.*
1802+
17491803
### <a name="blackfluxrobo-config-plugin-target-ref-readmemd">README.md</a> ([`link`](https://help.github.com/en/articles/about-readmes))
17501804

17511805
:small_blue_diamond: `nostruct`

gardener.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// eslint-disable-next-line import/no-extraneous-dependencies
1+
/* eslint-disable import/no-extraneous-dependencies */
22
import gardener from 'js-gardener';
3-
4-
import { fileURLToPath } from 'url';
3+
import fs from 'smart-fs';
54
import process from 'process';
65

7-
if (process.argv[1] === fileURLToPath(import.meta.url)) {
6+
if (process.argv[1] === fs.filename(import.meta.url)) {
87
gardener({
98
skip: []
109
}).catch(() => process.exit(1));

package.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,34 @@
1111
"joi-strict": "2.0.1",
1212
"lodash.set": "4.3.2",
1313
"object-fields": "3.0.1",
14-
"object-scan": "17.1.0"
14+
"object-scan": "18.1.2"
1515
},
1616
"devDependencies": {
17-
"@babel/core": "7.17.2",
18-
"@babel/eslint-parser": "7.17.0",
19-
"@babel/register": "7.17.0",
17+
"@babel/core": "7.18.5",
18+
"@babel/eslint-parser": "7.18.2",
19+
"@babel/register": "7.17.7",
2020
"@blackflux/eslint-plugin-rules": "2.1.0",
21-
"@blackflux/robo-config-plugin": "7.0.2",
22-
"c8": "7.11.0",
21+
"@blackflux/robo-config-plugin": "7.8.5",
22+
"@vercel/ncc": "0.34.0",
23+
"c8": "7.11.3",
2324
"chai": "4.3.6",
2425
"coveralls": "3.1.1",
25-
"eslint": "8.8.0",
26+
"eslint": "8.17.0",
2627
"eslint-config-airbnb-base": "15.0.0",
27-
"eslint-plugin-import": "2.25.4",
28+
"eslint-plugin-import": "2.26.0",
2829
"eslint-plugin-json": "3.1.0",
2930
"eslint-plugin-markdown": "2.2.1",
30-
"eslint-plugin-mocha": "10.0.3",
31+
"eslint-plugin-mocha": "10.0.5",
3132
"js-gardener": "3.0.5",
3233
"lodash.get": "4.4.2",
33-
"lodash.shuffle": "4.2.0"
34+
"lodash.shuffle": "4.2.0",
35+
"smart-fs": "3.0.1"
3436
},
3537
"scripts": {
3638
"clean": "rm -rf lib",
37-
"build": "cp -rf ./src ./lib",
39+
"build": "cp -rf ./src ./lib && ncc build -m -o lib && mv lib/index.js lib/index.min.js && cp src/index.js lib/index.js && rm lib/package.json",
3840
"build-clean": "yarn run clean && yarn run build",
39-
"test-simple": "c8 mocha \"./test/**/*.spec.js\"",
41+
"test-simple": "c8 mocha --experimental-loader=./test/hot.js \"./test/**/*.spec.js\"",
4042
"test": "yarn run clean && yarn run gardener && yarn run test-simple",
4143
"coveralls": "node ./node_modules/coveralls/bin/coveralls.js < ./coverage/lcov.info",
4244
"semantic-release": "yarn run build-clean && npx semantic-release",
@@ -47,7 +49,8 @@
4749
"tsv": "yarn run test-simple --verbose",
4850
"u": "yarn upgrade --latest --force",
4951
"i": "yarn install --frozen-lockfile",
50-
"it": "yarn run i && yarn run t"
52+
"it": "yarn run i && yarn run t",
53+
"ncc-analyze": "yarn clean && ncc build -m -s -o lib && npx source-map-explorer lib/index.js --only-mapped --html source.html && yarn clean"
5154
},
5255
"keywords": [
5356
"object",

src/module/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import assert from 'assert';
21
import Joi from 'joi-strict';
2+
import assert from '../util/assert.js';
33
import validationCompile from './plugin/validation-compile.js';
44
import validationExtractKeys from './plugin/validation-extract-keys.js';
55
import joinPath from './plugin/join-path.js';

0 commit comments

Comments
 (0)