chore: update

This commit is contained in:
BluJ
2023-03-27 15:38:25 -06:00
parent 42951b4fa2
commit 2607f05e63
5 changed files with 759 additions and 10 deletions

View File

@@ -1,17 +1,17 @@
TS_FILES := $(shell find ./**/*.ts ) TS_FILES := $(shell find ./**/*.ts )
version = $(shell git tag --sort=committerdate | tail -1) version = $(shell git tag --sort=committerdate | tail -1)
test: $(TS_FILES) test: $(TS_FILES) lib/test/output.ts
npm test npm test
make clean: make clean:
rm -rf dist rm -rf dist
lib/util/artifacts/output.ts: lib/util/artifacts/makeOutput.ts lib/scripts/oldSpecToBuilder.ts lib/test/output.ts: lib/test/makeOutput.ts scripts/oldSpecToBuilder.ts
npm run buildOutput npm run buildOutput
bundle: fmt $(TS_FILES) .FORCE node_modules bundle: fmt $(TS_FILES) .FORCE node_modules
npx tsc-multi npm run tsc-multi
npx tsc --emitDeclarationOnly npm run tsc --emitDeclarationOnly
check: check:
npm run check npm run check

18
lib/test/output.test.ts Normal file
View File

@@ -0,0 +1,18 @@
import { InputSpec, matchInputSpec } from "./output";
type TEqual<A, B> = A extends B ? (B extends A ? null : never) : never;
function testOutput<A, B>(): (c: TEqual<A, B>) => null {
return () => null;
}
const testValue = null as unknown;
// @ts-expect-error Because enable should be a boolean
testOutput<InputSpec["rpc"]["enable"], string>()(null);
testOutput<InputSpec["rpc"]["enable"], boolean>()(null);
testOutput<InputSpec["rpc"]["username"], string>()(null);
// testOutput<InputSpec["rpc"]["advanced"]["auth"], string[]>()(null);
describe("Inputs", () => {
test("test", () => {
expect(true).toEqual(true);
});
});

View File

@@ -166,13 +166,13 @@ export function matchNumberWithRange(range: string) {
leftValue === "*" leftValue === "*"
? (_) => true ? (_) => true
: left === "[" : left === "["
? (x) => x >= Number(leftValue) ? (x) => x >= Number(leftValue)
: (x) => x > Number(leftValue), : (x) => x > Number(leftValue),
leftValue === "*" leftValue === "*"
? "any" ? "any"
: left === "[" : left === "["
? `greaterThanOrEqualTo${leftValue}` ? `greaterThanOrEqualTo${leftValue}`
: `greaterThan${leftValue}` : `greaterThan${leftValue}`
) )
.validate( .validate(
// prettier-ignore // prettier-ignore

729
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "start-sdk", "name": "start-sdk",
"version": "0.4.0-lib0.alpha9", "version": "0.4.0-alpha10",
"description": "For making the patterns that are wanted in making services for the startOS.", "description": "For making the patterns that are wanted in making services for the startOS.",
"main": "./index.cjs", "main": "./index.cjs",
"types": "./index.d.ts", "types": "./index.d.ts",
@@ -32,6 +32,8 @@
"jest": "^29.4.3", "jest": "^29.4.3",
"ts-jest": "^29.0.5", "ts-jest": "^29.0.5",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"tsc": "^2.0.4",
"tsc-multi": "^0.6.1",
"tsconfig-paths": "^3.14.2", "tsconfig-paths": "^3.14.2",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"vitest": "^0.29.2" "vitest": "^0.29.2"