Skip to content

Commit

Permalink
fix: fix wrong generated types
Browse files Browse the repository at this point in the history
  • Loading branch information
ASafaeirad committed Jan 6, 2024
1 parent 7f2dc0e commit 9ff7127
Show file tree
Hide file tree
Showing 10 changed files with 491 additions and 511 deletions.
971 changes: 476 additions & 495 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@
"prepare": ".husky/prepare"
},
"devDependencies": {
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"@commitlint/cli": "18.4.4",
"@commitlint/config-conventional": "18.4.4",
"@frontendmonster/builder": "2.2.0",
"@fullstacksjs/eslint-config": "10.8.0",
"@fullstacksjs/toolbox": "4.7.0",
"@fullstacksjs/tsconfig": "1.1.0",
"@semantic-release/github": "9.2.6",
"@semantic-release/npm": "11.0.2",
"@semantic-release/release-notes-generator": "12.1.0",
"@types/node": "20.10.5",
"@vitest/coverage-v8": "1.1.0",
"@types/node": "20.10.6",
"@vitest/coverage-v8": "1.1.2",
"commitizen": "4.3.0",
"cspell": "8.2.3",
"cspell": "8.3.2",
"cz-conventional-changelog": "3.3.0",
"eslint": "8.56.0",
"husky": "8.0.3",
Expand All @@ -75,7 +75,7 @@
"standard-version": "9.5.0",
"tsup": "8.0.1",
"typescript": "5.3.3",
"vitest": "1.1.0"
"vitest": "1.1.2"
},
"config": {
"commitizen": {
Expand Down
5 changes: 2 additions & 3 deletions postbuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
shopt -s globstar


function create_packages() {
cat >cjs/package.json <<!EOF
{
Expand All @@ -19,9 +18,9 @@ function create_packages() {
function copy_esm_dts() {
mkdir types
pushd cjs || exit 1
find . -type f -name "*.d.ts" -exec cp --parents {} ../types \;
find . -type f -name "*.d.ts" -exec rsync -R {} ../types \;
rm ./**/*.{d.mts,d.ts}
popd || exit1
popd || exit 1
}

function copy_esm() {
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/ArraySchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ArrayGuard implements Guard<any[]> {
}

export class ArraySchema<TInput = any> extends Schema<TInput, TInput, boolean> {
#type = 'array'; // eslint-disable-line no-unused-private-class-members
protected type = 'array';

constructor(schema: Schema<any, any, boolean>) {
super({
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/BooleanSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { SchemaOptions } from './SchemaOptions';
import { TypeGuard } from './TypeGuard';

export class BooleanSchema<TInput = any> extends Schema<TInput, boolean> {
#type = 'boolean'; // eslint-disable-line no-unused-private-class-members
protected type = 'boolean';
#falseRegex = /(false|0)/i;

constructor(options: SchemaOptions<boolean> = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/NumberSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MaxNumberGuard implements Guard<number> {
}

export class NumberSchema<TInput = any> extends Schema<TInput, number> {
#type = 'number'; // eslint-disable-line no-unused-private-class-members
protected type = 'number';

constructor(options: SchemaOptions<number> = {}) {
super({
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/ObjectSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ObjectSchema<TInput = any> extends Schema<
TInput,
boolean
> {
#type = 'object'; // eslint-disable-line no-unused-private-class-members
protected type = 'object';

constructor(schema: Record<string, Schema<any, any, boolean>>) {
super({
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Schema<
public value: TValue | undefined;
public key!: string;
// @ts-expect-error Metadata for type-safety
#isRequired: TRequired; // eslint-disable-line no-unused-private-class-members
protected isRequired: TRequired; // eslint-disable-line no-unused-private-class-members

constructor(public options: SchemaOptions<TInput, TValue>) {
this.guards = options.initialGuards;
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/StringSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MaxLengthGuard implements Guard<string> {
}

export class StringSchema<TInput = any> extends Schema<TInput, string> {
#type = 'string'; // eslint-disable-line no-unused-private-class-members
protected type = 'string';

constructor(options: SchemaOptions<string> = {}) {
super({
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
},
"files": ["./mod.ts"],
"include": ["src/"],
"exclude": []
"exclude": ["node_modules", "lib"]
}

0 comments on commit 9ff7127

Please sign in to comment.