diff --git a/libs/tagup-ts-standard/CHANGELOG.md b/libs/tagup-ts-standard/CHANGELOG.md deleted file mode 100644 index e7180e7..0000000 --- a/libs/tagup-ts-standard/CHANGELOG.md +++ /dev/null @@ -1,22 +0,0 @@ -# @jacksonneal/tagup-ts-standard - -## 0.1.1 - -### Patch Changes - -- Testing - -## 0.1.0 - -### Minor Changes - -- Added: - - - test - - test - -## 0.0.1 - -### Patch Changes - -- Testing diff --git a/libs/tagup-ts-standard/README.md b/libs/tagup-ts-standard/README.md deleted file mode 100644 index fe8ed2f..0000000 --- a/libs/tagup-ts-standard/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# tagup-ts-standard - -TypeScript utilities diff --git a/libs/tagup-ts-standard/ex/filter.ex.ts b/libs/tagup-ts-standard/ex/filter.ex.ts deleted file mode 100644 index b530035..0000000 --- a/libs/tagup-ts-standard/ex/filter.ex.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Example type usage for `@/filter` module - * - * @module - */ - -import { isNonNullable } from "@/filter"; - -import { is } from "./shared.ex"; - -// isNonNullable -is(["hello", "there", null, undefined].filter(isNonNullable)); diff --git a/libs/tagup-ts-standard/ex/shared.ex.ts b/libs/tagup-ts-standard/ex/shared.ex.ts deleted file mode 100644 index 34a25be..0000000 --- a/libs/tagup-ts-standard/ex/shared.ex.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Shared utilities for type examples - * - * @module - */ - -/** - * Type check value against type parameter. - * - * @typeParam T - type - * - * @param _ - to check - */ -// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unnecessary-type-parameters, @typescript-eslint/no-unused-vars -export function is(_: T) { } diff --git a/libs/tagup-ts-standard/ex/type.ex.ts b/libs/tagup-ts-standard/ex/type.ex.ts deleted file mode 100644 index 51874dc..0000000 --- a/libs/tagup-ts-standard/ex/type.ex.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Example type usage for `@/type` module - * - * @module - */ - -import { Nullable, Opt } from "@/type"; - -import { is } from "./shared.ex"; - -// Opt -is>("hello"); -is>(null); - -// Nullable -is>("hello"); -is>(null); -is>(undefined); diff --git a/libs/tagup-ts-standard/package.json b/libs/tagup-ts-standard/package.json deleted file mode 100644 index c4d3e28..0000000 --- a/libs/tagup-ts-standard/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/package.json", - "name": "@jacksonneal/tagup-ts-standard", - "description": "TypeScript utilities", - "version": "0.1.1", - "type": "module", - "main": "./dist/tagup-ts-standard.js", - "types": "./dist/src/index.d.ts", - "scripts": { - "type-check": "tsc", - "test": "vitest run", - "test-cov": "vitest run --coverage", - "build": "tsc && vite build" - }, - "devDependencies": { - "@types/node": "^22.5.4", - "@vitest/coverage-v8": "^2.0.5", - "typescript": "^5.5.3", - "vite": "^5.4.1", - "vite-plugin-dts": "^4.2.1", - "vite-tsconfig-paths": "^5.0.1", - "vitest": "^2.0.5" - }, - "dependencies": { - "dist": "link:/Users/jacksonneal/dev/projects/standards/libs/tagup-ts-standard/dist" - } -} diff --git a/libs/tagup-ts-standard/src/filter.ts b/libs/tagup-ts-standard/src/filter.ts deleted file mode 100644 index 1c80ec2..0000000 --- a/libs/tagup-ts-standard/src/filter.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Utility functions for filtering and type checking - * - * @module - */ - -import { Nullable } from "@/type"; - -/** - * Check if a value is not `null` and not `undefined`. - * - * @typeParam T - type of value to check - * - * @param value - to check - * @returns whether value is not `null` and not `undefined` - * - * @example - * const isString = isNonNullable("hello"); // true - * const isNull = isNonNullable(null); // false - * const isUndefined = isNonNullable(undefined); // false - * const nonNullables: number[] = [1, 2, null, undefined].filter(isNonNullable); // [1, 2] - */ -export function isNonNullable(value: Nullable): value is NonNullable { - return value != null; -} diff --git a/libs/tagup-ts-standard/src/index.ts b/libs/tagup-ts-standard/src/index.ts deleted file mode 100644 index c2b7e7f..0000000 --- a/libs/tagup-ts-standard/src/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * TypeScript utilities - * - * @module tagup-ts-standard - */ - -export { isNonNullable } from '@/filter'; -export type { Nullable, Opt } from '@/type'; diff --git a/libs/tagup-ts-standard/src/type.ts b/libs/tagup-ts-standard/src/type.ts deleted file mode 100644 index ad1b7ce..0000000 --- a/libs/tagup-ts-standard/src/type.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Utility types - * - * @module - */ - -/** - * Optional type that may be `T` or `null` - * - * @typeParam T - non-null type - * - * @example - * const optString: Opt = "hello"; - * const optNull: Opt = null; - */ -export type Opt = T | null; - -/** - * Nullable type that may be `Opt` or `undefined`, - * opposite of the typescript builtin `NonNullable` - * - * @typeParam T - non-null type - * - * @example - * const nullableString: Nullable = "hello"; - * const nullableNull: Nullable = null; - * const nullableUndefined: Nullable = undefined; - */ -export type Nullable = Opt | undefined; diff --git a/libs/tagup-ts-standard/test/filter.test.ts b/libs/tagup-ts-standard/test/filter.test.ts deleted file mode 100644 index 18c83be..0000000 --- a/libs/tagup-ts-standard/test/filter.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Unit tests for `@/filter` module - * - * @module - */ - -import { describe } from 'node:test'; - -import { expect, test } from 'vitest' - -import { isNonNullable } from '@'; - -void describe('isNonNullable', () => { - test.each([ - ["hello", true], - [null, false], - [undefined, false], - ])('isNonNullable(%o) -> %o', (value, expected) => { - expect(isNonNullable(value)).toBe(expected); - }); - - test.each([ - [[], []], - [["hello", null, "there", undefined], ["hello", "there"]], - ])('%o.filter(isNonNullable) -> %o', (value, expected) => { - expect(value.filter(isNonNullable)).toStrictEqual(expected); - }) -}) diff --git a/libs/tagup-ts-standard/tsconfig.json b/libs/tagup-ts-standard/tsconfig.json deleted file mode 100644 index 93bd147..0000000 --- a/libs/tagup-ts-standard/tsconfig.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig.json", - "compilerOptions": { - "target": "ESNext", - "module": "ESNext", - "lib": [ - "ESNext", - "DOM" - ], - "paths": { - "@": [ - "./src" - ], - "@/*": [ - "./src/*" - ] - }, - "moduleResolution": "bundler", - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "allowJs": false, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": [ - "**/*.ts" - ] -} diff --git a/libs/tagup-ts-standard/tsconfig.vite.json b/libs/tagup-ts-standard/tsconfig.vite.json deleted file mode 100644 index 2510bea..0000000 --- a/libs/tagup-ts-standard/tsconfig.vite.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": [ - "src/**/*.ts" - ] -} diff --git a/libs/tagup-ts-standard/vite.config.ts b/libs/tagup-ts-standard/vite.config.ts deleted file mode 100644 index ef25faf..0000000 --- a/libs/tagup-ts-standard/vite.config.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { resolve } from 'path' -import { defineConfig } from 'vite' -import dts from 'vite-plugin-dts' - -export default defineConfig({ - build: { - lib: { entry: resolve(__dirname, 'src/index.ts'), formats: ['es'] }, - }, - resolve: { - alias: { - '@': resolve(__dirname, 'src') - } - }, - plugins: [dts({ - tsconfigPath: 'tsconfig.vite.json', - })], - test: { - coverage: { - exclude: [ - 'ex', - 'dist', - 'vite.config.ts' - ], - thresholds: { - lines: 100, - functions: 100, - branches: 100, - statements: 100 - } - } - }, -}) diff --git a/package.json b/package.json index 34c38c9..9bad959 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint-fix": "eslint --fix .", "docs-build": "typedoc", "workspace": "pnpm -w", - "ts-standard": "pnpm --filter tagup-ts-standard" + "ts-standard": "pnpm --filter ts-standard" }, "engines": { "node": ">=22.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7d92e4..60da70b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,11 +24,7 @@ importers: specifier: ^8.5.0 version: 8.5.0(eslint@9.10.0)(typescript@5.6.2) - libs/tagup-ts-standard: - dependencies: - dist: - specifier: link:/Users/jacksonneal/dev/projects/standards/libs/tagup-ts-standard/dist - version: link:dist + libs/ts-standard: devDependencies: '@types/node': specifier: ^22.5.4