Skip to content

Commit ac59e1c

Browse files
committed
init
0 parents  commit ac59e1c

26 files changed

+3984
-0
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/healthy-dingos-yawn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@jacksonneal/tagup-ts-standard": patch
3+
---
4+
5+
Testing

.github/workflows/main.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: ./.github/workflows/setup
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.12
16+
- run: just install
17+
- uses: pre-commit/action@v3.0.1
18+
19+
docs-publish:
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: ./.github/workflows/setup
24+
- run: just install
25+
- run: just docs-build
26+
- uses: actions/upload-pages-artifact@v3
27+
with:
28+
path: docs
29+
30+
docs-deploy:
31+
runs-on: ubuntu-24.04
32+
needs: docs-publish
33+
permissions:
34+
pages: write
35+
id-token: write
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
steps:
40+
- id: deployment
41+
uses: actions/deploy-pages@v4
42+
43+
ts-standard-test-cov:
44+
runs-on: ubuntu-24.04
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: ./.github/workflows/setup
48+
- run: just ts-standard-install
49+
- run: just ts-standard-type-check
50+
51+
ts-standard-type-check:
52+
runs-on: ubuntu-24.04
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: ./.github/workflows/setup
56+
- run: just ts-standard-install
57+
- run: just ts-standard-test-cov
58+
59+
ts-standard-publish:
60+
runs-on: ubuntu-24.04
61+
needs:
62+
- lint
63+
- ts-standard-type-check
64+
- ts-standard-test-cov
65+
permissions:
66+
contents: write
67+
packages: write
68+
pull-requests: write
69+
steps:
70+
- uses: actions/checkout@v4
71+
- uses: ./.github/workflows/setup
72+
- run: just ts-standard-install
73+
# - run: |
74+
# cat << EOF > "$HOME/.npmrc"
75+
# @jacksonneal:registry=https://npm.pkg.github.com/
76+
# //npm.pkg.github.com/:_authToken=$GITHUB_TOKEN
77+
# EOF
78+
# env:
79+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
- uses: changesets/action@v1
81+
with:
82+
publish: pnpm publish -r --access restricted --no-git-checks --registry https://npm.pkg.github.com/
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/setup/action.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: setup
2+
3+
inputs:
4+
NODE_VERSION:
5+
required: true
6+
default: 22.7.0
7+
PNPM_VERSION:
8+
required: true
9+
default: 9.9.0
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- uses: ConorMacBride/install-package@v1
15+
with:
16+
apt: just
17+
- uses: pnpm/action-setup@v4
18+
with:
19+
version: ${{ inputs.PNPM_VERSION }}
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ inputs.NODE_VERSION }}
23+
cache: pnpm

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage
2+
dist
3+
docs
4+
node_modules

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-json
7+
- id: check-yaml
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- repo: local
11+
hooks:
12+
- id: lint
13+
name: lint
14+
language: system
15+
entry: just lint

eslint.config.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import eslintConfigPrettier from "eslint-config-prettier";
2+
import simpleImportSort from "eslint-plugin-simple-import-sort";
3+
import typescriptEslint from 'typescript-eslint';
4+
5+
export default typescriptEslint.config(
6+
...typescriptEslint.configs.strictTypeChecked,
7+
...typescriptEslint.configs.stylisticTypeChecked,
8+
eslintConfigPrettier,
9+
{
10+
ignores: ['**/*.{js,mjs}', '**/dist/*', '**/coverage/*'],
11+
},
12+
{
13+
languageOptions: {
14+
parserOptions: {
15+
project: ['./libs/**/tsconfig.json'],
16+
// @ts-expect-error
17+
tsconfigRootDir: import.meta.dirname,
18+
},
19+
},
20+
},
21+
{
22+
plugins: {
23+
"simple-import-sort": simpleImportSort,
24+
},
25+
rules: {
26+
"simple-import-sort/imports": "error",
27+
"simple-import-sort/exports": "error",
28+
},
29+
},
30+
);

justfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
set positional-arguments
2+
3+
default:
4+
@just --list
5+
6+
pc:
7+
@pre-commit run --all-files
8+
9+
lint *args='':
10+
@pnpm lint
11+
12+
lint-fix:
13+
@pnpm lint-fix
14+
15+
docs-build:
16+
@pnpm docs-build
17+
18+
install:
19+
@pnpm install
20+
21+
version-rc:
22+
@pnpm version prerelease --preid=rc
23+
24+
workspace *args='':
25+
@pnpm workspace $@
26+
27+
workspace-install:
28+
@pnpm workspace install
29+
30+
ts-standard *args='':
31+
@pnpm ts-standard $@
32+
33+
ts-standard-install:
34+
@just ts-standard install
35+
36+
ts-standard-type-check:
37+
@just ts-standard type-check
38+
39+
ts-standard-test:
40+
@just ts-standard test
41+
42+
ts-standard-test-cov:
43+
@just ts-standard test-cov
44+
45+
ts-standard-build:
46+
@just ts-standard build

libs/tagup-ts-standard/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# @jacksonneal/tagup-ts-standard
2+
3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Testing
8+
9+
## 0.1.0
10+
11+
### Minor Changes
12+
13+
- Added:
14+
15+
- test
16+
- test
17+
18+
## 0.0.1
19+
20+
### Patch Changes
21+
22+
- Testing

libs/tagup-ts-standard/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# tagup-ts-standard
2+
3+
TypeScript utilities
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Example type usage for `@/filter` module
3+
*
4+
* @module
5+
*/
6+
7+
import { isNonNullable } from "@/filter";
8+
9+
import { is } from "./shared.ex";
10+
11+
// isNonNullable
12+
is<string[]>(["hello", "there", null, undefined].filter(isNonNullable));
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Shared utilities for type examples
3+
*
4+
* @module
5+
*/
6+
7+
/**
8+
* Type check value against type parameter.
9+
*
10+
* @typeParam T - type
11+
*
12+
* @param _ - to check
13+
*/
14+
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unnecessary-type-parameters, @typescript-eslint/no-unused-vars
15+
export function is<T>(_: T) { }

libs/tagup-ts-standard/ex/type.ex.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Example type usage for `@/type` module
3+
*
4+
* @module
5+
*/
6+
7+
import { Nullable, Opt } from "@/type";
8+
9+
import { is } from "./shared.ex";
10+
11+
// Opt<T>
12+
is<Opt<string>>("hello");
13+
is<Opt<string>>(null);
14+
15+
// Nullable<T>
16+
is<Nullable<string>>("hello");
17+
is<Nullable<string>>(null);
18+
is<Nullable<string>>(undefined);

libs/tagup-ts-standard/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/package.json",
3+
"name": "@jacksonneal/tagup-ts-standard",
4+
"description": "TypeScript utilities",
5+
"version": "0.1.1",
6+
"type": "module",
7+
"main": "./dist/tagup-ts-standard.js",
8+
"types": "./dist/src/index.d.ts",
9+
"scripts": {
10+
"type-check": "tsc",
11+
"test": "vitest run",
12+
"test-cov": "vitest run --coverage",
13+
"build": "tsc && vite build"
14+
},
15+
"devDependencies": {
16+
"@types/node": "^22.5.4",
17+
"@vitest/coverage-v8": "^2.0.5",
18+
"typescript": "^5.5.3",
19+
"vite": "^5.4.1",
20+
"vite-plugin-dts": "^4.2.1",
21+
"vite-tsconfig-paths": "^5.0.1",
22+
"vitest": "^2.0.5"
23+
},
24+
"dependencies": {
25+
"dist": "link:/Users/jacksonneal/dev/projects/standards/libs/tagup-ts-standard/dist"
26+
}
27+
}

libs/tagup-ts-standard/src/filter.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Utility functions for filtering and type checking
3+
*
4+
* @module
5+
*/
6+
7+
import { Nullable } from "@/type";
8+
9+
/**
10+
* Check if a value is not `null` and not `undefined`.
11+
*
12+
* @typeParam T - type of value to check
13+
*
14+
* @param value - to check
15+
* @returns whether value is not `null` and not `undefined`
16+
*
17+
* @example
18+
* const isString = isNonNullable<string>("hello"); // true
19+
* const isNull = isNonNullable(null); // false
20+
* const isUndefined = isNonNullable(undefined); // false
21+
* const nonNullables: number[] = [1, 2, null, undefined].filter(isNonNullable); // [1, 2]
22+
*/
23+
export function isNonNullable<T>(value: Nullable<T>): value is NonNullable<T> {
24+
return value != null;
25+
}

libs/tagup-ts-standard/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* TypeScript utilities
3+
*
4+
* @module tagup-ts-standard
5+
*/
6+
7+
export { isNonNullable } from '@/filter';
8+
export type { Nullable, Opt } from '@/type';

0 commit comments

Comments
 (0)