Skip to content

Commit

Permalink
Merge pull request #1416 from blackflux/dev
Browse files Browse the repository at this point in the history
[Gally]: master <- dev
  • Loading branch information
simlu authored Feb 29, 2024
2 parents 651973a + fee4c1d commit 00ae064
Show file tree
Hide file tree
Showing 16 changed files with 1,305 additions and 1,204 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ workflows:
- test-node-v18:
requires:
- gally-create-pr
- test-node-v16:
- test-node-v21:
requires:
- gally-create-pr
- test-node-v20:
Expand All @@ -15,7 +15,7 @@ workflows:
requires:
- gally-create-pr
- test-node-v18
- test-node-v16
- test-node-v21
- test-node-v20
filters:
branches:
Expand All @@ -24,7 +24,7 @@ workflows:
requires:
- gally-create-pr
- test-node-v18
- test-node-v16
- test-node-v21
- test-node-v20
filters:
branches:
Expand All @@ -33,14 +33,14 @@ version: 2.1
jobs:
gally-create-pr:
docker:
- image: cimg/node:16.20
- image: cimg/node:20.11
steps:
- checkout
- run: sudo yarn global add gally
- run: ga promote $CIRCLE_BRANCH
release:
docker:
- image: cimg/node:16.20
- image: cimg/node:20.11
steps:
- checkout
- run:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- run: yarn run semantic-release
gally-auto-approve:
docker:
- image: cimg/node:16.20
- image: cimg/node:20.11
steps:
- run:
name: Set PR number
Expand All @@ -87,9 +87,9 @@ jobs:
- run: >-
ga approve $CIRCLE_PR_NUMBER --condition
"base.ref=dev&state=open&user.login=dependabot-preview[bot]"
test-node-v16:
test-node-v18:
docker:
- image: cimg/node:16.20
- image: cimg/node:18.19
steps:
- checkout
- run:
Expand Down Expand Up @@ -119,9 +119,9 @@ jobs:
- run: >-
(git add . && git diff-index --quiet HEAD --) || (git status && exit
1);
test-node-v18:
test-node-v20:
docker:
- image: cimg/node:18.16
- image: cimg/node:20.11
steps:
- checkout
- run:
Expand Down Expand Up @@ -151,9 +151,9 @@ jobs:
- run: >-
(git add . && git diff-index --quiet HEAD --) || (git status && exit
1);
test-node-v20:
test-node-v21:
docker:
- image: cimg/node:20.4
- image: cimg/node:21.6
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion .gally.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"contexts": [
"ci/circleci: gally-create-pr",
"ci/circleci: test-node-v18",
"ci/circleci: test-node-v16",
"ci/circleci: test-node-v21",
"ci/circleci: test-node-v20"
]
},
Expand Down
2 changes: 1 addition & 1 deletion .roboconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"packageName": "node-tdd",
"projectName": "node-tdd",
"owner": "simlu",
"nodeVersion": "16",
"nodeVersion": "18",
"ownerName": "Lukas Siemon",
"mergeBot": "MrsFlux",
"nccEnabled": false
Expand Down
3 changes: 2 additions & 1 deletion .roboconfig.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"package.json",
"src/index.js",
"test/hot.js",
"test/index.spec.js"
"test/index.spec.js",
"test/reg.js"
]
}
49 changes: 44 additions & 5 deletions CONFDOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Documents configuration tasks managed by [robo-config](https://github.com/blackf
- <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>
- <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>
- <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>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtest-reg">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtest-reg">`struct/test-reg`</a>
- <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>
- <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>
- <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>
Expand Down Expand Up @@ -87,7 +88,8 @@ Manage various configuration files for an open source npm package on github.
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
Expand Down Expand Up @@ -151,7 +153,8 @@ Manage basic project structure for npm package on github.
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
Expand Down Expand Up @@ -224,7 +227,8 @@ Manage basic project structure for npm package on github.
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
Expand All @@ -244,11 +248,40 @@ Manage basic project structure for npm package on github.
</tbody>
</table>

###### :clipboard: <a name="blackfluxrobo-config-plugin-task-ref-structtest-reg">struct/test-reg</a> (<a href="#blackfluxrobo-config-plugin-task-idx-ref-structtest-reg">`index`</a>)

_Updating <a href="#blackfluxrobo-config-plugin-target-ref-testregjs">test/reg.js</a> using <a href="#blackfluxrobo-config-plugin-strat-ref-overwrite">overwrite</a>._

- Create register file.

<table>
<tbody>
<tr>
<th>Targets</th>
<th>Requires</th>
</tr>
<tr>
<td align="left" valign="top">
<ul>
<code>project</code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
<ul>
<li><a href="#blackfluxrobo-config-plugin-req-ref-javascript">javascript</a></li>
</ul>
</td>
</tr>
</tbody>
</table>

###### :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>)

_Updating <a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">test/hot.js</a> using <a href="#blackfluxrobo-config-plugin-strat-ref-overwrite">overwrite</a>._

- Create custom loader file.
- Create loader file.

<table>
<tbody>
Expand Down Expand Up @@ -1651,11 +1684,17 @@ The code owner is the gatekeeper of the project, ultimately responsible for all

Execute all configured js-gardener tasks.

### <a name="blackfluxrobo-config-plugin-target-ref-testregjs">test/reg.js</a>

:small_blue_diamond: `other`

*Registration hook to load custom loader.*

### <a name="blackfluxrobo-config-plugin-target-ref-testhotjs">test/hot.js</a>

:small_blue_diamond: `other`

*Custom loader to allow hot reloading of files for testing.*
*Loader to allow hot reloading of files for testing.*

### <a name="blackfluxrobo-config-plugin-target-ref-readmemd">README.md</a> ([`link`](https://help.github.com/en/articles/about-readmes))

Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"clean": "rm -rf lib",
"build": "cp -rf ./src ./lib",
"build-clean": "yarn run clean && yarn run build",
"test-simple": "c8 mocha --experimental-loader=./test/hot.js \"./test/**/*.spec.js\"",
"test-simple": "c8 mocha --import=./test/reg.js \"./test/**/*.spec.js\"",
"docker": "docker run --net host -u`id -u`:`id -g` -v $(pwd):/user/project -v ~/.aws:/user/.aws -v ~/.npmrc:/user/.npmrc -w /user/project -it --entrypoint /bin/bash",
"t": "yarn test",
"ts": "yarn run test-simple",
Expand Down Expand Up @@ -41,22 +41,22 @@
},
"homepage": "https://github.com/blackflux/node-tdd#readme",
"devDependencies": {
"@aws-sdk/client-sqs": "3.458.0",
"@babel/core": "7.23.3",
"@babel/eslint-parser": "7.23.3",
"@babel/register": "7.22.15",
"@aws-sdk/client-sqs": "3.523.0",
"@babel/core": "7.24.0",
"@babel/eslint-parser": "7.23.10",
"@babel/register": "7.23.7",
"@blackflux/eslint-plugin-rules": "3.0.1",
"@blackflux/robo-config-plugin": "9.2.4",
"aws-sdk-wrap": "13.1.2",
"axios": "1.6.2",
"c8": "8.0.1",
"chai": "4.3.10",
"eslint": "8.54.0",
"@blackflux/robo-config-plugin": "9.3.2",
"aws-sdk-wrap": "13.2.1",
"axios": "1.6.7",
"c8": "9.1.0",
"chai": "5.1.0",
"eslint": "8.57.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-markdown": "3.0.1",
"eslint-plugin-mocha": "10.2.0",
"eslint-plugin-mocha": "10.3.0",
"fancy-log": "2.0.0",
"js-gardener": "5.0.4",
"lambda-monitor-logger": "5.0.1"
Expand All @@ -68,7 +68,7 @@
}
],
"engines": {
"node": ">= 16"
"node": ">= 18"
},
"files": [
"lib"
Expand All @@ -81,12 +81,12 @@
"lodash.isequal": "4.5.0",
"lru-cache-ext": "4.0.0",
"minimist": "1.2.8",
"nock": "13.4.0",
"nock": "13.5.4",
"normalize-url": "2.0.1",
"object-scan": "19.0.5",
"smart-fs": "4.0.1",
"timekeeper": "2.3.1",
"tmp": "0.2.1",
"tmp": "0.2.3",
"xml2js": "0.6.2"
}
}
33 changes: 2 additions & 31 deletions test/hot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,12 @@ import { URL } from 'url';

const lookup = {};
let envVars = {};
const port = {}; // dummy variable, not used

/* serialized and passed into main process */
function createListener() {
/* communicate process.env to loader process */
process.env = new Proxy(process.env, {
set(target, key, value) {
// eslint-disable-next-line no-param-reassign
target[key] = value;
port.postMessage(target);
return target[key];
},
deleteProperty(target, key) {
if (!(key in target)) {
return true;
}
// eslint-disable-next-line no-param-reassign
delete target[key];
port.postMessage(target);
return true;
}
});
}

export function globalPreload({ port: p }) {
if (process.versions.node.split('.')[0] < 20) {
/* Skip listener, since process shared before node 20 */
envVars = process.env;
return '(() => {})()';
}
export function initialize({ port }) {
// eslint-disable-next-line no-param-reassign
p.onmessage = ({ data }) => {
port.onmessage = ({ data }) => {
envVars = data;
};
return `(${createListener})()`;
}

export const resolve = async (specifier, context, defaultResolve) => {
Expand Down
2 changes: 2 additions & 0 deletions test/modules/random-seeder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import RandomSeeder from '../../src/modules/random-seeder.js';
describe('Testing RandomSeeder', () => {
describe('Testing RandomSeeder Not Reseeded', () => {
let seeder;

beforeEach(() => {
seeder = RandomSeeder({ seed: 'test', reseed: false });
seeder.inject();
Expand Down Expand Up @@ -107,6 +108,7 @@ describe('Testing RandomSeeder', () => {

describe('Testing RandomSeeder Reseeded', () => {
let seeder;

beforeEach(() => {
seeder = RandomSeeder({ seed: 'test', reseed: true });
assert(seeder.isInjected() === false);
Expand Down
Loading

0 comments on commit 00ae064

Please sign in to comment.