Compare commits
10 Commits
f31a9b1175
...
cac1349c95
| Author | SHA1 | Date | |
|---|---|---|---|
| cac1349c95 | |||
|
|
15c8ef7616 | ||
|
|
0c08a2d395 | ||
|
|
1dc94c0dd1 | ||
|
|
25353662ec | ||
|
|
f6bbcd8b2e | ||
|
|
45c0bb6423 | ||
|
|
142989aa2b | ||
|
|
4f65d22efe | ||
|
|
02a33c7b44 |
+21
-21
@@ -1,21 +1,21 @@
|
||||
// .eslintrc.cjs
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: '@typescript-eslint/parser',
|
||||
parser: "@typescript-eslint/parser",
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
'import',
|
||||
'unused-imports',
|
||||
'simple-import-sort',
|
||||
"@typescript-eslint",
|
||||
"import",
|
||||
"unused-imports",
|
||||
"simple-import-sort",
|
||||
],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/strict-type-checked',
|
||||
'plugin:@typescript-eslint/stylistic-type-checked',
|
||||
'plugin:import/recommended',
|
||||
'plugin:import/typescript',
|
||||
'plugin:prettier/recommended',
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/strict-type-checked",
|
||||
"plugin:@typescript-eslint/stylistic-type-checked",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript",
|
||||
"plugin:prettier/recommended",
|
||||
],
|
||||
env: {
|
||||
es2022: true,
|
||||
@@ -23,15 +23,15 @@ module.exports = {
|
||||
browser: true,
|
||||
},
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
'import/order': 'off',
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/exports': 'error',
|
||||
'unused-imports/no-unused-imports': 'error',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
||||
"prettier/prettier": "error",
|
||||
"import/order": "off",
|
||||
"simple-import-sort/imports": "error",
|
||||
"simple-import-sort/exports": "error",
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||||
],
|
||||
},
|
||||
ignorePatterns: ['dist', 'node_modules', 'public'],
|
||||
ignorePatterns: ["dist", "node_modules", "public"],
|
||||
};
|
||||
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm run check
|
||||
- run: npm run test:ci
|
||||
- run: npm run check:outdated
|
||||
- run: npm run check:cspell
|
||||
- run: npm run check:tsc
|
||||
- run: npm run check:eslint
|
||||
- run: npm run check:prettier
|
||||
- run: npm run check:package
|
||||
- name: Upload coverage
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage
|
||||
|
||||
publish:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
registry-url: "https://registry.npmjs.org/"
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
Vendored
+2
@@ -15,6 +15,8 @@ dist-ssr
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
dist/
|
||||
node_modules/
|
||||
coverage/
|
||||
public/
|
||||
*.log
|
||||
*.tsbuildinfo
|
||||
src/
|
||||
.vscode/
|
||||
.editorconfig
|
||||
.eslintrc.cjs
|
||||
cspell.json
|
||||
lefthook.yml
|
||||
.sortpackagerc.json
|
||||
LICENSE
|
||||
commit-message-template
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 80,
|
||||
"tabWidth": 4,
|
||||
"endOfLine": "lf",
|
||||
"arrowParens": "always"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/sort-package-json.json"
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"vitest.explorer",
|
||||
"ms-vscode.vscode-typescript-next"
|
||||
]
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[mdx]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 tmu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1 +1,26 @@
|
||||
# tiny-pattern-ts
|
||||
|
||||
Pattern matching for TypeScript/ESM environments (F#-style, not regex).
|
||||
|
||||
## Development
|
||||
|
||||
- **Build:** `npm run build`
|
||||
- **Test:** `npm run test`, `npm run test:ci`
|
||||
- **Checks:** `npm run check`, `npm run fix`
|
||||
|
||||
## VSCode integration
|
||||
|
||||
- Debugging
|
||||
- Running tests
|
||||
|
||||
## Workflows
|
||||
|
||||
- Version updates
|
||||
- Changelog automation
|
||||
- Publishing
|
||||
|
||||
## Contribution guidelines
|
||||
|
||||
- Commit signing (GPG)
|
||||
- How to set up commit message template
|
||||
- Reference to commit-message-template
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# If applied, this commit will... (Max 50 char)
|
||||
|
||||
# Explain why this change is being made (Max 72 Char) [WHAT and WHY vs HOW]
|
||||
|
||||
# Provide links or keys to any relevant tickets, articles or other resources
|
||||
|
||||
Resolves #...
|
||||
|
||||
# --- COMMIT END ---
|
||||
|
||||
# Remember to
|
||||
|
||||
# Use the imperative mood in the subject line
|
||||
|
||||
# Capitalize the subject line
|
||||
|
||||
# Do not end the subject line with a period
|
||||
|
||||
# Separate subject from body with a blank line
|
||||
|
||||
# Use the body to explain what and why vs. how
|
||||
|
||||
# Can use multiple lines with "-" for bullet points in body
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
#
|
||||
# - script: "hello.go"
|
||||
# runner: go run
|
||||
commands:
|
||||
commands:
|
||||
typecheck:
|
||||
run: npm run check:tsc
|
||||
spell:
|
||||
|
||||
Generated
+7355
File diff suppressed because it is too large
Load Diff
+58
-3
@@ -2,14 +2,69 @@
|
||||
"name": "tiny-pattern-ts",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"description": "Pattern matching for TypeScript/ESM environments (F#-style, not regex)",
|
||||
"keywords": [
|
||||
"pattern-matching",
|
||||
"pattern",
|
||||
"match",
|
||||
"algebraic-data-types",
|
||||
"adt",
|
||||
"typescript"
|
||||
],
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tmueller/tiny-pattern-ts.git"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
"build": "vite build && tsc --emitDeclarationOnly",
|
||||
"clean": "rimraf dist",
|
||||
"clean:build": "rimraf dist",
|
||||
"test": "npm run check:tsc && npm run test:unit",
|
||||
"test:unit": "vitest run",
|
||||
"test:ci": "vitest run --coverage --reporter=dot --reporter=lcov --run",
|
||||
"check": "npm run check:eslint && npm run check:prettier && npm run check:cspell && npm run check:tsc && npm run check:package && npm run check:outdated",
|
||||
"check:eslint": "eslint . --ext .ts,.tsx,.js,.jsx",
|
||||
"check:prettier": "prettier --check .",
|
||||
"check:cspell": "cspell .",
|
||||
"check:tsc": "tsc --noEmit",
|
||||
"check:package": "sort-package-json --check",
|
||||
"check:outdated": "check-outdated",
|
||||
"fix": "npm run fix:eslint && npm run fix:prettier && npm run fix:package",
|
||||
"fix:eslint": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
|
||||
"fix:prettier": "prettier --write .",
|
||||
"fix:package": "sort-package-json --write",
|
||||
"use:git-commit-message": "cp commit-message-template .git/COMMIT_EDITMSG || true"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
||||
"@typescript-eslint/parser": "^8.31.1",
|
||||
"changesets": "^1.0.2",
|
||||
"check-outdated": "^2.13.0",
|
||||
"cspell": "^8.19.3",
|
||||
"eslint": "^9.25.1",
|
||||
"eslint-config-prettier": "^10.1.2",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-unused-imports": "^4.1.4",
|
||||
"lefthook": "^1.11.12",
|
||||
"prettier": "^3.5.3",
|
||||
"sort-package-json": "^3.1.0",
|
||||
"tslib": "^2.8.1",
|
||||
"type-fest": "^4.40.1",
|
||||
"typescript": "~5.7.2",
|
||||
"vite": "^6.3.1"
|
||||
"vite": "^6.3.1",
|
||||
"vitest": "^2.1.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+31
-9
@@ -1,24 +1,46 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"DOM"
|
||||
],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"moduleResolution": "Node",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
"noEmit": false,
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"alwaysStrict": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
"noUncheckedSideEffectImports": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"outDir": "dist",
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"composite": false,
|
||||
"types": [
|
||||
"vitest"
|
||||
]
|
||||
},
|
||||
"include": ["src"]
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
coverage: {
|
||||
reporter: ["text", "html", "lcov"],
|
||||
include: ["src/**/*.ts"],
|
||||
exclude: ["src/**/*.test.ts", "test/**"],
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user