Skip to content

Commit 3bdce7b

Browse files
committed
chore: deps + esm + boilerplate upgrade + renames + etc
1 parent 78d71e2 commit 3bdce7b

File tree

15 files changed

+2491
-1826
lines changed

15 files changed

+2491
-1826
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
end_of_line = lf
6+
charset = utf-8
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 2
10+
11+
[Makefile]
12+
indent_style = tab
13+
indent_size = 4
14+
insert_final_newline = false

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
dist
2+
node_modules
3+
build
4+
tmp

.eslintrc.cjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
2-
extends: '@block65/eslint-config',
2+
root: true,
3+
extends: '@block65',
34
parserOptions: {
4-
project: ['./tsconfig.json', './__tests__/tsconfig.json'],
5+
tsconfigRootDir: __dirname,
6+
project: './tsconfig.json',
57
},
68
};

.github/workflows/deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v1
1414
with:
15-
node-version: 16
15+
node-version: 18
1616
registry-url: https://registry.npmjs.org/
17-
- run: yarn install --production=false --non-interactive --frozen-lockfile
18-
- run: yarn build
17+
- run: make
1918
- run: npm publish --access=public
2019
env:
2120
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Unit Tests (PR)
2+
3+
on:
4+
pull_request:
5+
branches: ['master']
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 18
15+
registry-url: https://registry.npmjs.org/
16+
- run: make test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
dist
3+
coverage

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
18

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
SRCS = $(wildcard lib/**)
3+
4+
all: dist
5+
6+
.PHONY: deps
7+
deps: node_modules
8+
9+
.PHONY: clean
10+
clean:
11+
yarn tsc -b --clean
12+
13+
.PHONY: test
14+
test:
15+
NODE_OPTIONS=--experimental-vm-modules yarn jest
16+
17+
node_modules: package.json
18+
yarn install
19+
20+
dist: node_modules tsconfig.json $(SRCS)
21+
yarn tsc
22+
23+
.PHONY: dev
24+
dev:
25+
yarn tsc -w

babel.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
presets: [
3+
['@babel/preset-env', { targets: { node: 'current' }, modules: false }],
4+
['@babel/preset-typescript'],
5+
/* [
6+
'@babel/preset-react',
7+
{
8+
runtime: 'automatic',
9+
},
10+
], */
11+
],
12+
};

lib/cli.ts renamed to bin/cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env node
2-
import { Command } from 'commander';
3-
import dotenv from 'dotenv';
4-
import inquirer from 'inquirer';
5-
import keytar from 'keytar';
62
import { spawn } from 'node:child_process';
73
import { userInfo } from 'node:os';
84
import { ReadStream } from 'node:tty';
95
import { fileURLToPath } from 'node:url';
6+
import { Command } from 'commander';
7+
import dotenv from 'dotenv';
8+
import inquirer from 'inquirer';
9+
import keytar from 'keytar';
1010
import { readPackageUp } from 'read-pkg-up';
1111

1212
interface TtyError extends Error {

0 commit comments

Comments
 (0)