Skip to content

Commit

Permalink
chore: typescript-library-startup
Browse files Browse the repository at this point in the history
  • Loading branch information
retro committed Mar 18, 2024
0 parents commit 00345c8
Show file tree
Hide file tree
Showing 27 changed files with 10,876 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2",
"language": "en",
"words": [
"degit",
"esbuild",
"semantic-layer",
"octocat",
"outdir",
"rmrf",
"ryansonshine",
"socio",
"tsdoc"
],
"flagWords": [],
"ignorePaths": [
"package.json",
"package-lock.json",
"yarn.lock",
"tsconfig.json",
"node_modules/**"
]
}
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1.
2.
3.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: [e.g. Ubuntu 22.04, macOS 11.4]
- Node version [e.g 16.4.2]
- Code Version [e.g. 1.1.0]

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: GitHub Discussions
url: https://github.com/retro/semantic-layer/discussions
about: Please discuss non bug-related topics there
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fixes #

## Description of the changes

-
-
-
120 changes: 120 additions & 0 deletions .github/workflows/semantic-layer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: semantic-layer

on: [push]

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
dependencies:
name: 📦 Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- run: npm ci

lint:
name: 🔬 Lint & Format
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- run: npm ci
- name: 🔬 Lint & Format
run: npm run lint:check

audit:
name: 🛡️ Audit
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- name: 🛡️ Audit
run: npm audit --audit-level=high

spell:
name: 🈸 Spellcheck
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- run: npm ci
- name: 🈸 Spellcheck
run: npm run spell:check

type:
name: ʦ Typecheck
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- run: npm ci
- name: ʦ Typecheck
run: npm run type:check

test:
name: ⚡ Tests
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- run: npm ci
- name: ⚡ Tests
run: npm run test:coverage

test-setup:
name: ⚡ Setup tests
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- run: npm ci
- name: ⚡ Tests
run: npm run test:setup

build-and-release:
name: 🚀 Build & release
needs: [lint, audit, spell, type, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: "npm"
- run: npm ci
- name: 🔨 Build
run: npm run build
- name: 🚀 Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
node_modules/
coverage/
.DS_Store
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
coverage/
31 changes: 31 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"master",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"repositoryUrl": "https://github.com/retro/semantic-layer.git",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/github",
{
"successComment": false,
"failTitle": false
}
]
]
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"biomejs.biome",
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker"
]
}
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Current Test File",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${relativeFile}",
"runtimeArgs": [
"--import=@nitrogql/esbuild-register",
"--inspect",
"--test"
],
"smartStep": true,
"console": "integratedTerminal"
}
]
}
32 changes: 32 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"cSpell.userWords": [],
"cSpell.enabled": true,
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"files.associations": { "*.json": "jsonc" },
"editor.indentSize": 2,
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonl]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
24 changes: 24 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Current Test File",
"type": "shell",
"command": "node",
"args": [
"--import=@nitrogql/esbuild-register",
"--test",
"${relativeFile}"
],
"presentation": {
"clear": true,
"showReuseMessage": false,
"echo": false
},
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
Loading

0 comments on commit 00345c8

Please sign in to comment.