-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e71073c
Showing
14 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- alpha | ||
- beta | ||
- next | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- run: npm install | ||
|
||
- run: npm run lint | ||
|
||
- run: npx semantic-release | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
- alpha | ||
- beta | ||
- next | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- run: npm install | ||
|
||
- run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package-lock=false | ||
save-exact=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Contributing | ||
|
||
Thank you for showing an interest in contributing to Eik 🧡 | ||
|
||
This module is a [shared config for TypeScript](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#tsconfig-bases). We accept changes that should apply to all repositories in the [eik-lib origanisation](https://github.com/eik-lib). | ||
|
||
Exports from this module are handled via the `"files"` property. Configurations should be at the root level so user's `"extends"` field is `@eik/typescript-config/module.json` and so on. | ||
|
||
Commits should follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format. | ||
|
||
A change in configuration is considered a `patch` in [semantic versioning](https://semver.org/). A new export would be a `minor`. Depending on a newer major version of TypeScript would be a `major`. | ||
|
||
This repo uses [semantic release](https://github.com/semantic-release/semantic-release) to automate releases whenever changes are merged to the default branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# @eik/typescript-config | ||
|
||
Shared config for TypeScript, used in Eik projects to generate type definitions from JSDoc and test them. | ||
|
||
## Install | ||
|
||
``` | ||
npm install --save-dev typescript @eik/typescript-config | ||
``` | ||
|
||
## Usage | ||
|
||
Create two files in your root directory. | ||
|
||
`tsconfig.json` (assuming source in `lib/`): | ||
|
||
```json | ||
{ | ||
"extends": "@eik/typescript-config/module.json", | ||
"include": ["./lib/**/*.js"], | ||
"compilerOptions": { | ||
"outDir": "types" | ||
} | ||
} | ||
``` | ||
|
||
`tsconfig.test.json` (assuming tests in `tests/`): | ||
|
||
```json | ||
{ | ||
"extends": "@eik/typescript-config/module.json", | ||
"include": ["./tests/**/*.js"] | ||
} | ||
``` | ||
|
||
You should have a similar setup in your `package.json`: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"types": "run-s types:module types:test", | ||
"types:module": "tsc", | ||
"types:test": "tsc --project tsconfig.test.json" | ||
}, | ||
"dependencies": { | ||
"npm-run-all": "4.1.5" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import config from "@eik/eslint-config"; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["es2020", "DOM"], | ||
"module": "nodenext", | ||
"moduleResolution": "nodenext", | ||
"target": "es2020", | ||
"resolveJsonModule": true, | ||
"checkJs": true, | ||
"allowJs": true, | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"skipLibCheck": true, | ||
"allowSyntheticDefaultImports": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "@eik/typescript-config", | ||
"version": "1.0.0", | ||
"description": "Shared typescript config for Eik modules", | ||
"files": [ | ||
"module.json", | ||
"test.json" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://[email protected]/eik-lib/typescript-config.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/eik-lib/typescript-config/issues" | ||
}, | ||
"homepage": "https://github.com/eik-lib/typescript-config#readme", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"lint:fix": "npm run lint -- --fix", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"typescript": ">= 5" | ||
}, | ||
"devDependencies": { | ||
"@eik/eslint-config": "1.0.0", | ||
"@eik/prettier-config": "1.0.1", | ||
"@eik/semantic-release-config": "1.0.0", | ||
"eslint": "9.8.0", | ||
"prettier": "3.3.3", | ||
"semantic-release": "24.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import config from "@eik/prettier-config"; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
extends: "@eik/semantic-release-config", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:recommended" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./module.json", | ||
"compilerOptions": { | ||
"module": "nodenext", | ||
"moduleResolution": "nodenext", | ||
"emitDeclarationOnly": false, | ||
"noEmit": true | ||
} | ||
} |