Skip to content

Commit

Permalink
Merge pull request #1823 from blackflux/dev
Browse files Browse the repository at this point in the history
[Gally]: master <- dev
  • Loading branch information
simlu authored Mar 11, 2024
2 parents 16b0ac6 + 219c996 commit cab9995
Show file tree
Hide file tree
Showing 19 changed files with 1,274 additions and 1,062 deletions.
2 changes: 2 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"exclude": [
"gardener.js",
"eslint.config.js",
"node_modules/*",
"coverage/*",
"lib/*",
"test/hot.js",
"test/reg.js",
"src/plugin/tasks/**",
"test/projects/**"
],
Expand Down
27 changes: 13 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
workflows:
version: 2
node-multi-build:
jobs:
- gally-create-pr
- test-node-v18:
requires:
- gally-create-pr
- test-node-v16:
- test-node-v21:
requires:
- gally-create-pr
- test-node-v20:
Expand All @@ -16,7 +15,7 @@ workflows:
requires:
- gally-create-pr
- test-node-v18
- test-node-v16
- test-node-v21
- test-node-v20
filters:
branches:
Expand All @@ -25,23 +24,23 @@ workflows:
requires:
- gally-create-pr
- test-node-v18
- test-node-v16
- test-node-v21
- test-node-v20
filters:
branches:
only: master
version: 2
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 @@ -71,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 @@ -88,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 @@ -120,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 @@ -152,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 .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": [
"airbnb-base",
"plugin:mocha/recommended",
"plugin:markdown/recommended"
"plugin:markdown/recommended-legacy"
],
"rules": {
"@blackflux/rules/c8-prevent-ignore": 1,
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
4 changes: 3 additions & 1 deletion .roboconfig.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
".releaserc.json",
"LICENSE",
"README.md",
"eslint.config.js",
"gardener.js",
"package.json",
"src/index.js",
"test/hot.js",
"test/index.spec.js"
"test/index.spec.js",
"test/reg.js"
]
}
90 changes: 85 additions & 5 deletions CONFDOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ 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>
- <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 +73,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 All @@ -85,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 @@ -140,6 +144,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 All @@ -148,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 @@ -213,14 +219,16 @@ 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/>
<code>├─&nbsp;src</code><br/>
<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 @@ -240,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 @@ -414,6 +451,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 @@ -1618,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 Expand Up @@ -1668,6 +1740,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
Original file line number Diff line number Diff line change
@@ -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
}
}
];
2 changes: 1 addition & 1 deletion gardener.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import fs from 'smart-fs';

if (process.argv[1] === fs.filename(import.meta.url)) {
gardener({
skip: []
skip: ['robo']
}).catch(() => process.exit(1));
}
Loading

0 comments on commit cab9995

Please sign in to comment.