Skip to content

Commit

Permalink
chore: add shared devtool configs (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud authored Aug 8, 2024
1 parent a8ec0fa commit fa309aa
Show file tree
Hide file tree
Showing 30 changed files with 3,502 additions and 1,925 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

20 changes: 8 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,21 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install
- run: npm install

- name: Lint files
run: npm run lint
- run: npm run lint

- name: Run tests
run: npm run test
- run: npm run types

- name: Run semantic release
run: npx semantic-release
- run: npm run test

- run: npx semantic-release
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- run: npm install

- run: npm run lint

- run: npm run types

- run: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ coverage
.vscode
.nyc_output/
.tap/
types/
6 changes: 3 additions & 3 deletions bin/eik-server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

import Fastify from 'fastify'
/* eslint-disable no-unused-vars */
import Fastify from 'fastify';
import Eik from '../lib/main.js';

const eik = new Eik();
Expand All @@ -22,5 +22,5 @@ try {

await app.listen({
port: eik.config.get('http.port'),
host: eik.config.get('http.address')
host: eik.config.get('http.address'),
});
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@eik/eslint-config';

export default config;
12 changes: 8 additions & 4 deletions lib/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import convict from 'convict';
import yaml from 'js-yaml';
import pino from 'pino';
Expand All @@ -9,7 +10,7 @@ const CWD = process.cwd();

let pack = {};
try {
pack = JSON.parse(fs.readFileSync(join(CWD, 'package.json')));
pack = JSON.parse(fs.readFileSync(join(CWD, 'package.json'), 'utf-8'));
} catch (error) {
/* empty */
}
Expand All @@ -29,11 +30,13 @@ convict.addFormat({
const file = fs.readFileSync(value);
return file.toString();
} catch (error) {
throw new Error(`Config could not load secret from path: ${value}`);
throw new Error(
`Config could not load secret from path: ${value}`,
);
}
}
return value;
}
},
});

const conf = convict({
Expand Down Expand Up @@ -148,11 +151,12 @@ const conf = convict({
default: path.join(os.tmpdir(), '/eik'),
env: 'SINK_PATH',
},
}
},
});

const env = conf.get('env');

// @ts-expect-error This is in fact callable
const logger = pino({
level: conf.get('log.level'),
name: conf.get('name'),
Expand Down
Loading

0 comments on commit fa309aa

Please sign in to comment.