Skip to content

Commit 8c935c5

Browse files
committed
chore: initialize repo
0 parents  commit 8c935c5

File tree

12 files changed

+2500
-0
lines changed

12 files changed

+2500
-0
lines changed

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
if: "!contains(github.event.head_commit.message, 'skip-ci')"
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest]
16+
node-version: [14.x]
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- uses: actions/checkout@v3
24+
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
29+
- name: Cache ~/.pnpm-store
30+
uses: actions/cache@v2
31+
env:
32+
cache-name: cache-pnpm-store
33+
with:
34+
path: ~/.pnpm-store
35+
key:
36+
${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name
37+
}}-${{ hashFiles('**/pnpm-lock.yaml') }}
38+
restore-keys: |
39+
${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-
40+
${{ runner.os }}-${{ matrix.node-version }}-test-
41+
${{ runner.os }}-
42+
43+
- name: Install pnpm
44+
run: npm i -g pnpm
45+
46+
- name: Install deps
47+
run: pnpm i
48+
49+
# Runs a set of commands using the runners shell
50+
- name: Build and Test
51+
run: pnpm test
52+
53+
release:
54+
runs-on: ubuntu-latest
55+
needs: ['test']
56+
if:
57+
"!contains(github.event.head_commit.message, 'skip-release') &&
58+
!contains(github.event.head_commit.message, 'skip-ci') &&
59+
github.event_name != 'pull_request'"
60+
steps:
61+
- uses: actions/checkout@v3
62+
- uses: actions/setup-node@v3
63+
with:
64+
node-version: 18.x
65+
- name: Cache ~/.pnpm-store
66+
uses: actions/cache@v2
67+
env:
68+
cache-name: cache-pnpm-store
69+
with:
70+
path: ~/.pnpm-store
71+
key:
72+
${{ runner.os }}-${{ matrix.node-version }}-release-${{
73+
env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
74+
restore-keys: |
75+
${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-
76+
${{ runner.os }}-${{ matrix.node-version }}-release-
77+
${{ runner.os }}-
78+
- run: npm i -g pnpm
79+
- run: pnpm i
80+
- run: pnpm dlx semantic-release@20 --branches main
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
*.log

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm test

.husky/prepare-commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
exec < /dev/tty && node_modules/.bin/cz --hook || true

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"arrowParens": "always",
3+
"singleQuote": true,
4+
"useTabs": true,
5+
"trailingComma": "all",
6+
"printWidth": 80,
7+
"proseWrap": "always",
8+
"endOfLine": "lf",
9+
"semi": false
10+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Jonathan Skeate
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# kuvio
2+
3+
`kuvio` is a tool to construct composable string patterns, from which you can
4+
derive things like regular expressions or [fast-check][] `Arbitrary`s.
5+
6+
`kuvio` is specifically for string-like patterns. If you want to extend this
7+
concept to more complicated data types, check out [schemata-ts][]! `kuvio` was
8+
originally developed as part of `schemata-ts` but was extracted as it seems
9+
useful independently.
10+
11+
[fast-check]: https://github.com/dubzzz/fast-check
12+
[schemata-ts]: https://github.com/jacob-alford/schemata-ts

package.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "kuvio",
3+
"version": "0.0.1",
4+
"description": "Create string patterns and derive things from them, such as regexes",
5+
"files": [
6+
"dist"
7+
],
8+
"main": "./dist/index.js",
9+
"module": "./dist/index.mjs",
10+
"exports": {
11+
"require": "./dist/index.js",
12+
"import": "./dist/index.mjs"
13+
},
14+
"types": "./dist/index.d.ts",
15+
"scripts": {
16+
"build-fast": "tsup src/index.ts --format cjs,esm",
17+
"build": "pnpm run build-fast -- --dts-resolve",
18+
"test": "vitest run",
19+
"prepublishOnly": "pnpm run build",
20+
"prepare": "husky install"
21+
},
22+
"keywords": [
23+
"pattern",
24+
"regular expression",
25+
"regex",
26+
"string",
27+
"string pattern",
28+
"string patterns",
29+
"fast-check",
30+
"fastcheck"
31+
],
32+
"author": "Jonathan Skeate",
33+
"license": "MIT",
34+
"dependencies": {
35+
"@simspace/matchers": "^0.0.2",
36+
"fp-ts": "^2.13.1"
37+
},
38+
"devDependencies": {
39+
"commitizen": "^4.3.0",
40+
"cz-conventional-changelog": "^3.3.0",
41+
"husky": "^8.0.0",
42+
"prettier": "2.8.7",
43+
"tsup": "6.7.0",
44+
"typescript": "5.0.4",
45+
"vitest": "0.30.1"
46+
},
47+
"config": {
48+
"commitizen": {
49+
"path": "./node_modules/cz-conventional-changelog"
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)