Skip to content

Commit 2b4bcf7

Browse files
committed
feat: initial release
0 parents  commit 2b4bcf7

File tree

12 files changed

+193
-0
lines changed

12 files changed

+193
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
permissions:
4+
contents: write # to be able to publish a GitHub release
5+
issues: write # to be able to comment on released issues
6+
pull-requests: write # to be able to comment on released pull requests
7+
id-token: write # to enable use of OIDC for npm provenance
8+
9+
on:
10+
push:
11+
branches:
12+
- main
13+
- next
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
25+
- run: npm install
26+
27+
- run: npx semantic-release
28+
env:
29+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package-lock=false
2+
save-exact=true

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributing
2+
3+
Thank you for showing an interest in contributing to Podium 🧡
4+
5+
You can find [the general contribution docs here](https://github.com/podium-lib/.github/blob/main/CONTRIBUTING.md).
6+
7+
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 [podium-lib origanisation](https://github.com/podium-lib).
8+
9+
Exports from this module are handled via the `"files"` property. Configurations should be at the root level so user's `"extends"` field is `@podium/typescript-config/module.json` and so on.
10+
11+
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`.

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# @podium/typescript-config
2+
3+
Shared config for TypeScript, used in Podium projects to generate type definitions from JSDoc and test them.
4+
5+
## Install
6+
7+
```
8+
npm install --save-dev typescript @podium/typescript-config
9+
```
10+
11+
## Usage
12+
13+
Create two files in your root directory.
14+
15+
`tsconfig.json` (assuming source in `lib/`):
16+
17+
```json
18+
{
19+
"extends": "@podium/typescript-config/module.json",
20+
"include": ["./lib/**/*.js"],
21+
"compilerOptions": {
22+
"outDir": "types"
23+
}
24+
}
25+
```
26+
27+
`tsconfig.test.json` (assuming tests in `tests/`):
28+
29+
```json
30+
{
31+
"extends": "@podium/typescript-config/test.json",
32+
"include": ["./tests/**/*.js"]
33+
}
34+
```
35+
36+
You should have a similar setup in your `package.json`:
37+
38+
```json
39+
{
40+
"scripts": {
41+
"types": "run-s types:module types:test",
42+
"types:module": "tsc",
43+
"types:test": "tsc --project tsconfig.test.json"
44+
},
45+
"dependencies": {
46+
"npm-run-all2": "6.2.3"
47+
}
48+
}
49+
```

module.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"lib": ["es2020", "DOM"],
4+
"module": "nodenext",
5+
"moduleResolution": "nodenext",
6+
"target": "es2020",
7+
"resolveJsonModule": true,
8+
"checkJs": true,
9+
"allowJs": true,
10+
"declaration": true,
11+
"emitDeclarationOnly": true,
12+
"skipLibCheck": true,
13+
"allowSyntheticDefaultImports": true
14+
}
15+
}

package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@podium/typescript-config",
3+
"version": "1.0.0",
4+
"description": "Shared typescript config for Podium modules",
5+
"type": "module",
6+
"files": [
7+
"module.json",
8+
"test.json"
9+
],
10+
"repository": {
11+
"type": "git",
12+
"url": "git+ssh://[email protected]/podium-lib/typescript-config.git"
13+
},
14+
"publishConfig": {
15+
"access": "public"
16+
},
17+
"bugs": {
18+
"url": "https://github.com/podium-lib/typescript-config/issues"
19+
},
20+
"homepage": "https://github.com/podium-lib/typescript-config#readme",
21+
"scripts": {
22+
"clean": "rimraf node_modules"
23+
},
24+
"keywords": [],
25+
"author": "",
26+
"license": "MIT",
27+
"peerDependencies": {
28+
"typescript": ">= 5"
29+
},
30+
"devDependencies": {
31+
"prettier": "3.3.3",
32+
"rimraf": "6.0.1",
33+
"semantic-release": "24.0.0"
34+
}
35+
}

prettier.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default {
2+
singleQuote: true,
3+
trailingComma: 'all',
4+
tabWidth: 4,
5+
overrides: [
6+
{
7+
files: ['*.json', '*.yml'],
8+
options: {
9+
tabWidth: 2,
10+
},
11+
},
12+
],
13+
};

release.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export default {
2+
plugins: [
3+
'@semantic-release/commit-analyzer',
4+
'@semantic-release/release-notes-generator',
5+
'@semantic-release/changelog',
6+
[
7+
'@semantic-release/npm',
8+
{
9+
tarballDir: 'release',
10+
},
11+
],
12+
[
13+
'@semantic-release/github',
14+
{
15+
assets: 'release/*.tgz',
16+
},
17+
],
18+
'@semantic-release/git',
19+
],
20+
preset: 'angular',
21+
branches: [{ name: 'main' }, { name: 'next', prerelease: true }],
22+
};

0 commit comments

Comments
 (0)