Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Update all development Yarn dependencies (2023-10-22) #37

Merged
merged 3 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/heavy-nails-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@neuledge/typescript-states': patch
'@neuledge/mongodb-store': patch
'@neuledge/states-parser': patch
'vscode-neuledge-states': patch
'@neuledge/states-cli': patch
'@neuledge/scalars': patch
'@neuledge/engine': patch
'@neuledge/store': patch
'@neuledge/states': patch
---

dependencies update
6 changes: 3 additions & 3 deletions examples/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"mercurius": "^13.1.0"
},
"devDependencies": {
"@graphql-codegen/cli": "^3.3.1",
"@graphql-codegen/typescript-resolvers": "^3.2.1",
"@graphql-tools/schema": "^9.0.19",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/typescript-resolvers": "^4.0.1",
"@graphql-tools/schema": "^10.0.0",
"@neuledge/states-cli": "^0.1.3"
}
}
2 changes: 2 additions & 0 deletions examples/graphql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "@neuledge/tsconfig/base.json",
"compilerOptions": {
"module": "es2022",
"moduleResolution": "Node",
"baseUrl": "src",
"rootDir": "src",
"outDir": "dist"
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
"release": "yarn release:build && yarn release:version && yarn release:publish && yarn release:github-publish && yarn release:push"
},
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@neuledge/eslint-config": "^1.0.1",
"@neuledge/jest-ts-preset": "^1.0.0",
"@neuledge/tsconfig": "^2.0.0",
"@swc/core": "^1.3.56",
"@types/jest": "^29.5.1",
"@types/node": "^18.16.3",
"eslint": "^8.39.0",
"@changesets/cli": "^2.26.2",
"@neuledge/eslint-config": "^1.2.0",
"@neuledge/jest-ts-preset": "^1.0.1",
"@neuledge/tsconfig": "^3.0.0",
"@swc/core": "^1.3.92",
"@types/jest": "^29.5.5",
"@types/node": "^20.6.3",
"eslint": "^8.51.0",
"husky": "^8.0.3",
"jest": "^29.5.0",
"prettier": "^2.8.8",
"rimraf": "^5.0.0",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"tsup": "^6.6.3",
"turbo": "^1.9.3",
"typescript": "^5.0.4"
"tsc-alias": "^1.8.8",
"tsup": "^7.2.0",
"turbo": "^1.10.15",
"typescript": "^5.2.2"
}
}
2 changes: 1 addition & 1 deletion packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"pluralize": "^8.0.0"
},
"devDependencies": {
"@types/pluralize": "^0.0.29",
"@types/pluralize": "^0.0.31",
"@neuledge/states-cli": "^0.1.3",
"@neuledge/store": "^0.2.1"
},
Expand Down
11 changes: 9 additions & 2 deletions packages/engine/src/definitions/state/find/comparable.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
export type ComparableFilters<V> =
export type ComparableFilters<V> = (
| WhereLowerThenFilter<V>
| WhereLowerThenEqualFilter<V>
| WhereGreaterThenFilter<V>
| WhereGreaterThenEqualFilter<V>;
| WhereGreaterThenEqualFilter<V>
) &
Partial<
| WhereLowerThenFilter<V>
| WhereLowerThenEqualFilter<V>
| WhereGreaterThenFilter<V>
| WhereGreaterThenEqualFilter<V>
>;

interface WhereLowerThenFilter<V> {
$lt: V;
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/engine/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ const setEntityValue = (obj: object, path: string, value: unknown): void => {
: (obj[key as never] = {} as never);
}

obj[pathKeys[pathKeys.length - 1] as never] = value as never;
obj[pathKeys.at(-1) as never] = value as never;
};
5 changes: 4 additions & 1 deletion packages/engine/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ export class NeuledgeError extends Error {
return error;
}

constructor(public readonly code: NeuledgeError.Code, message: string) {
constructor(
public readonly code: NeuledgeError.Code,
message: string,
) {
super(message);
this.name = 'NeuledgeError';
}
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/metadata/names/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ const suggestStatesCollectionNames = (
* For example: ['user', 'profile'] -> 'user_profiles'
*/
const formatCollectionName = (words: string[]): string =>
[...words.slice(0, -1), pluralize.plural(words[words.length - 1])].join('_');
[...words.slice(0, -1), pluralize.plural(words.at(-1) as string)].join('_');
2 changes: 1 addition & 1 deletion packages/engine/src/metadata/names/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ const generateFieldMap = <
};

export const toSnakeCase = (str: string): string =>
str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
str.replaceAll(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
4 changes: 3 additions & 1 deletion packages/engine/src/mutations/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { Query, QueryMode, QueryOptions, QueryType } from '@/queries';
import { Mutation, MutationType } from './mutation';

export interface MutationGeneratorMethod {
(...args: Record<string, never>[]): Query<
(
...args: Record<string, never>[]
): Query<
QueryMode,
StateDefinition,
StateDefinition,
Expand Down
9 changes: 5 additions & 4 deletions packages/engine/src/queries/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ import { QueryOptions, QueryType } from './query';
import { NeuledgeError } from '@/error';

export class QueryClass<
T extends QueryType,
I extends StateDefinition,
O extends StateDefinition,
> implements
T extends QueryType,
I extends StateDefinition,
O extends StateDefinition,
>
implements
ReturnQuery<any, I, O>, // eslint-disable-line @typescript-eslint/no-explicit-any
SelectQuery<any, I, O, any>, // eslint-disable-line @typescript-eslint/no-explicit-any
ExpandQuery<any, I, O, any, any>, // eslint-disable-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-store/src/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ const filterTerm = (
};

const escapeRegExp = (string: string): string =>
string.replace(/[$()*+.?[\\\]^{|}]/g, '\\$&'); // $& means the whole matched string
string.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&'); // $& means the whole matched string
2 changes: 1 addition & 1 deletion packages/scalars/src/commons/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const URLScalar = createCallableScalar(

if (domain != null) {
const regex = new RegExp(
`://([a-z0-9]+(-[a-z0-9]+)*\\.)*${domain.replace(/\./g, '\\.')}/`,
`://([a-z0-9]+(-[a-z0-9]+)*\\.)*${domain.replaceAll('.', '\\.')}/`,
'i',
);

Expand Down
2 changes: 2 additions & 0 deletions packages/states-cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "@neuledge/tsconfig/base.json",
"compilerOptions": {
"module": "es2022",
"moduleResolution": "Node",
"baseUrl": "src",
"rootDir": "src",
"outDir": "dist"
Expand Down
6 changes: 3 additions & 3 deletions packages/states-parser/src/tokens/tokenize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const tokenize = (content: string, path?: string): Token[] => {
column = 1;
}

column += lines[lines.length - 1].length;
column += lines.at(-1)?.length ?? 0;
position += value.length;

if (isComment && value.includes('\n')) {
Expand Down Expand Up @@ -130,12 +130,12 @@ const parseStringToken = (
value: raw
.slice(3, -3)
.trim()
.replace(/[\t ]*\r?\n[\t ]*/g, '\n'),
.replaceAll(/[\t ]*\r?\n[\t ]*/g, '\n'),
};
}

return {
kind: kind as '"' | "'",
value: raw.slice(1, -1).replace(/\\(.)/g, '$1'),
value: raw.slice(1, -1).replaceAll(/\\(.)/g, '$1'),
};
};
5 changes: 4 additions & 1 deletion packages/store/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export namespace StoreError {
export class StoreError extends Error {
static Code = StoreErrorCode;

constructor(public readonly code: StoreErrorCode, message: string) {
constructor(
public readonly code: StoreErrorCode,
message: string,
) {
super(message);
this.name = 'StoreError';
}
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-states/src/generate/arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export const generateArguments = (
};

const generateArgumentName = (name: string): string =>
/^\w+$/.test(name) ? name : `'${name.replace(/(['\\])/g, '\\$1')}'`;
/^\w+$/.test(name) ? name : `'${name.replaceAll(/(['\\])/g, '\\$1')}'`;
10 changes: 5 additions & 5 deletions packages/typescript-states/src/generate/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ export const generateDescriptionComment = (
const deprecationReason = deprecated === true ? '' : deprecated || null;

return description
? `/**\n${indent} * ${description.replace(/\n/g, `\n${indent} * `)}${
? `/**\n${indent} * ${description.replaceAll('\n', `\n${indent} * `)}${
deprecationReason
? `\n${indent} *\n${indent} * @deprecated ${deprecationReason.replace(
/\n/g,
? `\n${indent} *\n${indent} * @deprecated ${deprecationReason.replaceAll(
'\n',
`\n${indent} * `,
)}`
: ''
}\n${indent} */\n${indent}`
: deprecationReason
? `/**\n${indent} * @deprecated ${deprecationReason.replace(
/\n/g,
? `/**\n${indent} * @deprecated ${deprecationReason.replaceAll(
'\n',
`\n${indent} * `,
)}\n${indent} */\n${indent}`
: '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export const generateMemberExpression = (
const generatePropertyExpression = (expression: PropertyExpression): string =>
/^\w+$/.test(expression.name)
? `.${expression.name}`
: `['${expression.name.replace(/(['\\])/g, '\\$1')}']`;
: `['${expression.name.replaceAll(/(['\\])/g, '\\$1')}']`;
5 changes: 4 additions & 1 deletion packages/typescript-states/src/generate/state/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export const generateStateOptionalRelations = (
item.as.entity,
)}${item.as.list ? ', list: true' : ''}${
item.type === 'RelationField' && item.referenceField
? `, reference: '${item.referenceField.replace(/('|\\)/g, '\\$1')}'`
? `, reference: '${item.referenceField.replaceAll(
/('|\\)/g,
'\\$1',
)}'`
: ''
} } as const,`,
)
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-states/src/generate/state/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const generateStateOptionalIndexes = (
`\n${indent} ${
/^\w+$/.test(index.name)
? index.name
: `'${index.name.replace(/['\\]/g, '\\$1')}'`
: `'${index.name.replaceAll(/['\\]/g, '\\$1')}'`
}: { fields: [${Object.entries(index.fields)
.map(([field, sort]) => `'${sort === 'asc' ? `+` : '-'}${field}'`)
.join(', ')}]${index.unique ? ', unique: true' : ''} } as const,`,
Expand Down
2 changes: 1 addition & 1 deletion plugins/vscode-states/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
]
},
"devDependencies": {
"@vscode/vsce": "^2.19.0"
"@vscode/vsce": "^2.21.1"
}
}
Loading