Skip to content

Commit

Permalink
Merge pull request #1403 from blackflux/dev
Browse files Browse the repository at this point in the history
[Gally]: master <- dev
  • Loading branch information
simlu committed Nov 15, 2023
2 parents 3145290 + 74a39e7 commit 83c9b47
Show file tree
Hide file tree
Showing 10 changed files with 1,199 additions and 1,012 deletions.
3 changes: 2 additions & 1 deletion .c8rc.json
Expand Up @@ -4,7 +4,8 @@
"node_modules/*",
"coverage/*",
"lib/*",
"test/hot.js"
"test/hot.js",
"eslint.config.js"
],
"temp-directory": "./coverage/.c8_output",
"reports-dir": "./coverage",
Expand Down
3 changes: 1 addition & 2 deletions .circleci/config.yml
@@ -1,5 +1,4 @@
workflows:
version: 2
node-multi-build:
jobs:
- gally-create-pr
Expand Down Expand Up @@ -30,7 +29,7 @@ workflows:
filters:
branches:
only: master
version: 2
version: 2.1
jobs:
gally-create-pr:
docker:
Expand Down
1 change: 1 addition & 0 deletions .roboconfig.lock
Expand Up @@ -13,6 +13,7 @@
".releaserc.json",
"LICENSE",
"README.md",
"eslint.config.js",
"gardener.js",
"package.json",
"src/index.js",
Expand Down
41 changes: 41 additions & 0 deletions CONFDOCS.md
Expand Up @@ -14,6 +14,7 @@ Documents configuration tasks managed by [robo-config](https://github.com/blackf
- <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>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-index">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-index">`struct/template-index`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-eslintrc">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-eslintrc">`struct/template-eslintrc`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-eslint-config">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-eslint-config">`struct/template-eslint-config`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-semantic-releasenpm-default">:open_file_folder:</a> <a href="#blackfluxrobo-config-plugin-task-ref-semantic-releasenpm-default">`semantic-release/#npm-default`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-semantic-releasecommit-conventions">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-semantic-releasecommit-conventions">`semantic-release/commit-conventions`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-packagenpm-default">:open_file_folder:</a> <a href="#blackfluxrobo-config-plugin-task-ref-packagenpm-default">`package/#npm-default`</a>
Expand Down Expand Up @@ -71,6 +72,7 @@ Manage various configuration files for an open source npm package on github.
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-ideaprojectnameiml">${projectName}.iml</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-c8rcjson">.c8rc.json</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-editorconfig">.editorconfig</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-eslintconfigjs">eslint.config.js</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-eslintrcjson">.eslintrc.json</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-gallyjson">.gally.json</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-gardenerjs">gardener.js</a></code><br/>
Expand Down Expand Up @@ -140,6 +142,7 @@ Manage basic project structure for npm package on github.
<td align="left" valign="top">
<ul>
<code>project</code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-eslintconfigjs">eslint.config.js</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-eslintrcjson">.eslintrc.json</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-gardenerjs">gardener.js</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-mocharcyml">.mocharc.yml</a></code><br/>
Expand Down Expand Up @@ -213,6 +216,7 @@ Manage basic project structure for npm package on github.
<td align="left" valign="top">
<ul>
<code>project</code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-eslintconfigjs">eslint.config.js</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-eslintrcjson">.eslintrc.json</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-mocharcyml">.mocharc.yml</a></code><br/>
<code>├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-readmemd">README.md</a></code><br/>
Expand Down Expand Up @@ -414,6 +418,35 @@ _Updating <a href="#blackfluxrobo-config-plugin-target-ref-eslintrcjson">.eslint
</tbody>
</table>

###### :clipboard: <a name="blackfluxrobo-config-plugin-task-ref-structtemplate-eslint-config">struct/template-eslint-config</a> (<a href="#blackfluxrobo-config-plugin-task-idx-ref-structtemplate-eslint-config">`index`</a>)

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

- Create configuration file for eslint enforcing opinionated, best practices.

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

#### :open_file_folder: <a name="blackfluxrobo-config-plugin-task-ref-semantic-releasenpm-default">semantic-release/#npm-default</a> (<a href="#blackfluxrobo-config-plugin-task-idx-ref-semantic-releasenpm-default">`index`</a>)

Manage semantic-release configuration for npm package on github.
Expand Down Expand Up @@ -1668,6 +1701,14 @@ Main file for the project. Exposes functionality for libraries.

*Configuration file for eslint.*

### <a name="blackfluxrobo-config-plugin-target-ref-eslintconfigjs">eslint.config.js</a> ([`link`](https://eslint.org/docs/latest/use/configure/configuration-files-new))

:small_red_triangle: <a href="#blackfluxrobo-config-plugin-req-ref-eslint">eslint</a>

:small_blue_diamond: `nostruct`

*Configuration file for eslint.*

### <a name="blackfluxrobo-config-plugin-target-ref-releasercjson">.releaserc.json</a> ([`link`](https://semantic-release.gitbook.io/semantic-release/usage/configuration#configuration-file))

:small_red_triangle: <a href="#blackfluxrobo-config-plugin-req-ref-semantic-release">semantic-release</a>
Expand Down
65 changes: 65 additions & 0 deletions eslint.config.js
@@ -0,0 +1,65 @@
/* eslint-disable import/no-extraneous-dependencies */
import fs from 'smart-fs';
import { FlatCompat } from '@eslint/eslintrc';
import parser from '@babel/eslint-parser';
import blackfluxRulesPlugin from '@blackflux/eslint-plugin-rules';

const compat = new FlatCompat({
baseDirectory: fs.dirname(import.meta.url),
resolvePluginsRelativeTo: fs.dirname(import.meta.url)
});

export default [
...compat.extends(
'airbnb-base',
'plugin:mocha/recommended',
'plugin:markdown/recommended'
),
...compat.env({ es6: true, node: true, mocha: true }),
...compat.plugins('json', 'mocha'),
{
plugins: {
'@blackflux/rules': blackfluxRulesPlugin
},
languageOptions: {
parser,
parserOptions: { requireConfigFile: false }
},
rules: {
'@blackflux/rules/c8-prevent-ignore': 1,
'@blackflux/rules/kebab-case-enforce': 1,
'max-len': ['error', { code: 120 }],
'mocha/no-exclusive-tests': 'error',
'prefer-destructuring': ['error', { object: false, array: false }],
'comma-dangle': ['error', 'never'],
indent: ['error', 2, { SwitchCase: 1 }],
quotes: [2, 'single', { avoidEscape: true }],
'linebreak-style': [2, 'unix'],
semi: [2, 'always'],
'no-unused-vars': [
1,
{ vars: 'all', args: 'none', ignoreRestSiblings: true }
],
'no-var': [1],
'no-fallthrough': [1],
'spaced-comment': [
'error',
'always',
{
line: { exceptions: ['-', '+'], markers: ['=', '!'] },
block: {
exceptions: ['-', '+'],
markers: ['=', '!', ':', '::'],
balanced: true
}
}
],
'@blackflux/rules/prevent-typeof-object': 1,
'mocha/no-mocha-arrows': 0,
'mocha/no-hooks-for-single-case': 0,
'import/no-useless-path-segments': [2, { commonjs: true }],
'import/extensions': [2, 'always'],
'import/prefer-default-export': 0
}
}
];
36 changes: 18 additions & 18 deletions package.json
Expand Up @@ -42,24 +42,24 @@
"homepage": "https://github.com/blackflux/node-tdd#readme",
"devDependencies": {
"@aws-sdk/client-sqs": "3.385.0",
"@babel/core": "7.22.9",
"@babel/eslint-parser": "7.22.9",
"@babel/register": "7.22.5",
"@blackflux/eslint-plugin-rules": "3.0.0",
"@blackflux/robo-config-plugin": "9.1.9",
"aws-sdk-wrap": "13.0.6",
"axios": "1.4.0",
"@babel/core": "7.23.3",
"@babel/eslint-parser": "7.23.3",
"@babel/register": "7.22.15",
"@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.7",
"eslint": "8.46.0",
"chai": "4.3.10",
"eslint": "8.53.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.28.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-markdown": "3.0.1",
"eslint-plugin-mocha": "10.1.0",
"eslint-plugin-mocha": "10.2.0",
"fancy-log": "2.0.0",
"js-gardener": "5.0.1",
"lambda-monitor-logger": "5.0.0"
"js-gardener": "5.0.4",
"lambda-monitor-logger": "5.0.1"
},
"licenses": [
{
Expand All @@ -74,16 +74,16 @@
"lib"
],
"dependencies": {
"callsites": "4.0.0",
"joi-strict": "3.0.0",
"callsites": "4.1.0",
"joi-strict": "3.0.1",
"lodash.clonedeep": "4.5.0",
"lodash.get": "4.4.2",
"lru-cache-ext": "4.0.0",
"minimist": "1.2.8",
"nock": "13.3.2",
"nock": "13.3.8",
"normalize-url": "2.0.1",
"object-scan": "19.0.1",
"smart-fs": "4.0.0",
"object-scan": "19.0.5",
"smart-fs": "4.0.1",
"timekeeper": "2.3.1",
"tmp": "0.2.1",
"xml2js": "0.6.2"
Expand Down
12 changes: 6 additions & 6 deletions test/modules/request-recorder.spec.js
Expand Up @@ -260,7 +260,7 @@ describe('Testing RequestRecorder', { useTmpDir: true, timestamp: 0 }, () => {
accept: 'application/json, text/plain, */*',
'content-type': 'application/json',
'accept-encoding': 'gzip, compress, deflate, br',
'user-agent': 'axios/1.4.0',
'user-agent': 'axios/1.6.2',
'content-length': '59'
},
response: { data: `${id}` },
Expand Down Expand Up @@ -424,7 +424,7 @@ describe('Testing RequestRecorder', { useTmpDir: true, timestamp: 0 }, () => {
host: server.host,
'content-length': '59',
'accept-encoding': 'gzip, compress, deflate, br',
'user-agent': 'axios/1.4.0'
'user-agent': 'axios/1.6.2'
}
}),
makeCassetteEntry(3)
Expand Down Expand Up @@ -454,7 +454,7 @@ describe('Testing RequestRecorder', { useTmpDir: true, timestamp: 0 }, () => {
host: server.host,
'content-length': '59',
'accept-encoding': 'gzip, compress, deflate, br',
'user-agent': 'axios/1.4.0'
'user-agent': 'axios/1.6.2'
}
}),
makeCassetteEntry(3)
Expand All @@ -476,7 +476,7 @@ describe('Testing RequestRecorder', { useTmpDir: true, timestamp: 0 }, () => {
accept: 'application/json, text/plain, */*',
host: server.host,
'accept-encoding': 'gzip, compress, deflate, br',
'user-agent': 'axios/1.4.0'
'user-agent': 'axios/1.6.2'
},
response: {},
responseIsBinary: false,
Expand Down Expand Up @@ -513,7 +513,7 @@ describe('Testing RequestRecorder', { useTmpDir: true, timestamp: 0 }, () => {
reqheaders: {
accept: 'application/json, text/plain, */*',
'accept-encoding': 'gzip, compress, deflate, br',
host: `${server2.host} @ axios/1.4.0`,
host: `${server2.host} @ axios/1.6.2`,
'user-agent': '^axios/.*$'
},
response: {
Expand Down Expand Up @@ -577,7 +577,7 @@ describe('Testing RequestRecorder', { useTmpDir: true, timestamp: 0 }, () => {
reqheaders: {
accept: 'application/json, text/plain, */*',
'accept-encoding': 'gzip, compress, deflate, br',
'user-agent': 'axios/1.4.0'
'user-agent': 'axios/1.6.2'
},
response: {},
responseIsBinary: false,
Expand Down
Expand Up @@ -11,7 +11,7 @@
"content-type": "application/x-www-form-urlencoded",
"host": "test.com",
"accept-encoding": "gzip, compress, deflate, br",
"user-agent": "axios/1.4.0"
"user-agent": "axios/1.6.2"
},
"response": "ok"
}
Expand Down
2 changes: 1 addition & 1 deletion test/modules/request-recorder.spec.js__fixtures/post.json
Expand Up @@ -11,7 +11,7 @@
"content-type": "application/x-www-form-urlencoded",
"host": "test.com",
"accept-encoding": "gzip, compress, deflate, br",
"user-agent": "axios/1.4.0"
"user-agent": "axios/1.6.2"
},
"response": "ok"
}
Expand Down

0 comments on commit 83c9b47

Please sign in to comment.