Skip to content

Commit b6a7280

Browse files
authored
Update tooling config (#95)
- Removes tsdx - Updated formatting & linting rules - Use Vitest for testing
1 parent bf4c6fc commit b6a7280

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+17151
-38573
lines changed

.changeset/config.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json",
3-
"access": "public",
4-
"baseBranch": "main",
5-
"changelog": [
6-
"@changesets/changelog-github",
7-
{ "repo": "stormwarning/tailwindcss-opentype" }
8-
],
9-
"commit": false,
10-
"ignore": [],
11-
"linked": [],
12-
"updateInternalDependencies": "patch"
2+
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
3+
"access": "public",
4+
"baseBranch": "main",
5+
"changelog": [
6+
"@zazen/changesets-changelog",
7+
{ "repo": "stormwarning/tailwindcss-opentype" }
8+
],
9+
"commit": false,
10+
"ignore": [],
11+
"linked": [],
12+
"updateInternalDependencies": "patch"
1313
}

.editorconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ root = true
44
[*]
55
charset = utf-8
66
end_of_line = lf
7-
indent_size = 4
8-
indent_style = space
7+
indent_style = tab
98
insert_final_newline = true
109
trim_trailing_whitespace = true
1110

1211
[*.md]
1312
trim_trailing_whitespace = false
14-
15-
[*.{json,yml}]
16-
indent_size = 2

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
const config = {
3+
extends: [
4+
'@zazen',
5+
'@zazen/eslint-config/node',
6+
'@zazen/eslint-config/typescript',
7+
],
8+
env: {
9+
node: true,
10+
},
11+
ignorePatterns: ['dist', 'docs' /* , '!.eleventy.js' */],
12+
rules: {
13+
'@typescript-eslint/ban-types': 'off',
14+
'@typescript-eslint/lines-between-class-members': 'off',
15+
'@typescript-eslint/padding-line-between-statements': 'off',
16+
17+
'n/file-extension-in-import': ['error', 'always'],
18+
},
19+
overrides: [
20+
{
21+
// Jest config
22+
files: ['**/__tests__/**/*.{js,ts,tsx}', '**/*.@(spec|test).{js,ts,tsx}'],
23+
env: {
24+
jest: true,
25+
},
26+
rules: {
27+
'import/no-extraneous-dependencies': 'off',
28+
},
29+
},
30+
{
31+
files: ['**/*.d.ts'],
32+
rules: {
33+
// Prevent conflicts with `import/no-mutable-exports`.
34+
'prefer-let/prefer-let': 'off',
35+
},
36+
},
37+
],
38+
}
39+
40+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
41+
module.exports = config

.eslintrc.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/renovate.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>tidaltheory/renovate-config"]
4+
}

.github/workflows/main.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,23 @@ on: [push]
44

55
jobs:
66
build:
7-
name: Build, lint, and test
8-
97
runs-on: ubuntu-latest
108

119
steps:
1210
- name: Checkout repo
1311
uses: actions/checkout@v3
1412

15-
- name: Setup Node 12.x
16-
uses: actions/setup-node@v3
13+
- name: Setup Node.js 18.x
14+
uses: actions/setup-node@v3.1.1
1715
with:
18-
node-version: 12.x
16+
node-version: 18.x
17+
cache: npm
1918

2019
- name: Install dependencies
21-
uses: bahmutov/npm-install@v1
20+
run: npm ci
2221

2322
- name: Build
24-
run: npm build
25-
26-
- name: Lint
27-
run: npm run lint
23+
run: npm run build
2824

2925
- name: Test
30-
run: npm test --ci --coverage --maxWorkers=2
26+
run: npm test

.github/workflows/release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ jobs:
1010
name: Release
1111
runs-on: ubuntu-latest
1212
steps:
13+
# https://github.com/actions/checkout
1314
- name: Checkout repo
1415
uses: actions/checkout@v3
1516
with:
16-
# This makes Actions fetch all Git history so that Changesets can
17-
# generate changelogs with the correct commits.
1817
fetch-depth: 0
1918

20-
- name: Setup Node.js 12.x
21-
uses: actions/setup-node@v3
19+
- name: Setup Node.js 18.x
20+
uses: actions/setup-node@v3.1.1
2221
with:
23-
node-version: 12.x
22+
node-version: 18.x
23+
cache: npm
2424

2525
- name: Install dependencies
26-
uses: bahmutov/npm-install@v1
26+
run: npm ci
2727

28+
# https://github.com/changesets/action
2829
- name: Create release PR or publish to npm
2930
id: changesets
30-
# https://github.com/changesets/action
31-
uses: changesets/action@master
31+
uses: changesets/action@v1
3232
with:
33-
title: 'Chore: Publish release'
3433
# This expects you to have a script called release which does a build
3534
# for your packages and calls changeset publish
3635
publish: npm run release
36+
title: 'Publish release'
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

__tests__/helpers.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import postcss from 'postcss'
2+
import tailwindcss, { type Config } from 'tailwindcss'
3+
4+
const css = String.raw
5+
6+
export async function generateCss(testConfig: Omit<Config, 'content'>) {
7+
let config: Config = {
8+
...testConfig,
9+
content: ['./**/*.test.ts'],
10+
corePlugins: { preflight: false },
11+
}
12+
let input = css`
13+
@tailwind utilities;
14+
`
15+
16+
return postcss(tailwindcss(config)).process(input, { from: undefined })
17+
}

0 commit comments

Comments
 (0)