Skip to content

Commit

Permalink
chore: remove CJS Support and bump AJV dependency
Browse files Browse the repository at this point in the history
BREAKING CHANGE: CJS isn't supported anymore. You have to migrate your project on ESM syntax.
  • Loading branch information
Romakita committed Sep 17, 2024
1 parent ebe57c5 commit 5a0a15e
Show file tree
Hide file tree
Showing 350 changed files with 450 additions and 2,528 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Configuration} from "@tsed/di";
import "./mappers/MomentMapper"; // just import mapper to be available
import "./mappers/MomentMapper.js"; // just import mapper to be available

@Configuration({})
export class Server {}
2 changes: 1 addition & 1 deletion docs/tutorials/snippets/graphql/server-configuration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Configuration} from "@tsed/di";
import "@tsed/platform-express";
import "@tsed/typegraphql";
import "./resolvers/index"; // barrel file with all resolvers
import "./resolvers/index.js"; // barrel file with all resolvers

@Configuration({
typegraphql: {
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/snippets/passport/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import session from "express-session";
import methodOverride from "method-override";

// import your protocol. Ts.ED will discover it automatically
import "./protocols/LoginLocalProtocol";
import "./protocols/LoginLocalProtocol.js";

@Configuration({
passport: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
],
"dependencies": {
"@tsed/logger": ">=6.7.5",
"ajv": "8.12.0",
"ajv": "8.17.1",
"axios": "1.7.4",
"change-case": "4.1.2",
"globby": "11.1.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@tsed/core",
"description": "Core module for Ts.ED Framework",
"type": "commonjs",
"type": "module",
"version": "8.0.0-alpha.5",
"source": "./src/index.ts",
"main": "./lib/cjs/index.js",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",
"typings": "./lib/types/index.d.ts",
"browser": "./lib/browser/core.umd.min.js",
Expand All @@ -13,7 +13,6 @@
"types": "./lib/types/index.d.ts",
"browser": "./lib/browser/core.umd.min.js",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/cjs/index.js"
}
},
Expand Down
28 changes: 0 additions & 28 deletions packages/core/tsconfig.cjs.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"moduleResolution": "nodenext",
"rootDir": "src",
"outDir": "./lib/esm",
"declarationDir": "./lib/types-esm",
"declarationDir": "./lib/types",
"declaration": true,
"composite": true,
"noEmit": false
Expand Down
3 changes: 0 additions & 3 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
},
"include": [],
"references": [
{
"path": "./tsconfig.cjs.json"
},
{
"path": "./tsconfig.esm.json"
},
Expand Down
7 changes: 3 additions & 4 deletions packages/di/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{
"name": "@tsed/di",
"description": "DI module for Ts.ED Framework",
"type": "commonjs",
"type": "module",
"version": "8.0.0-alpha.5",
"source": "./src/index.ts",
"main": "lib/esm/index.js",
"module": "lib/esm/index.js",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",
"typings": "./lib/types/index.d.ts",
"browser": "./lib/browser/di.umd.min.js",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"browser": "./lib/browser/di.umd.min.js",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/cjs/index.js"
}
},
Expand Down
28 changes: 0 additions & 28 deletions packages/di/tsconfig.cjs.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/di/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"moduleResolution": "nodenext",
"rootDir": "src",
"outDir": "./lib/esm",
"declarationDir": "./lib/types-esm",
"declarationDir": "./lib/types",
"declaration": true,
"composite": true,
"noEmit": false
Expand Down
3 changes: 0 additions & 3 deletions packages/di/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
{
"path": "../specs/schema/tsconfig.json"
},
{
"path": "./tsconfig.cjs.json"
},
{
"path": "./tsconfig.esm.json"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/engines/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "@tsed/engines",
"description": "Template engines library. Provide an API to adding custom engines from decorators.",
"type": "commonjs",
"type": "module",
"version": "8.0.0-alpha.5",
"source": "./src/index.ts",
"main": "./lib/cjs/index.js",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",
"typings": "./lib/types/index.d.ts",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/cjs/index.js"
}
},
Expand Down
28 changes: 0 additions & 28 deletions packages/engines/tsconfig.cjs.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/engines/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"moduleResolution": "nodenext",
"rootDir": "src",
"outDir": "./lib/esm",
"declarationDir": "./lib/types-esm",
"declarationDir": "./lib/types",
"declaration": true,
"composite": true,
"noEmit": false
Expand Down
3 changes: 0 additions & 3 deletions packages/engines/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
},
"include": [],
"references": [
{
"path": "./tsconfig.cjs.json"
},
{
"path": "./tsconfig.esm.json"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/graphql/apollo/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "@tsed/apollo",
"description": "Apollo package for Ts.ED framework",
"type": "commonjs",
"type": "module",
"version": "8.0.0-alpha.5",
"source": "./src/index.ts",
"main": "./lib/cjs/index.js",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",
"typings": "./lib/types/index.d.ts",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/cjs/index.js"
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from "@tsed/core";
import {Inject, InjectContext} from "@tsed/di";
import {APOLLO_CONTEXT} from "../constants/constants";
import {APOLLO_CONTEXT} from "../constants/constants.js";

/**
* Inject the Apollo context in the decorated property.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {PlatformContext} from "@tsed/common";
import type {ApolloContext} from "./ApolloContext";
import type {ApolloContext} from "./ApolloContext.js";

export interface AlterApolloContext<Context extends ApolloContext = ApolloContext> {
$alterApolloContext(context: Context, $ctx: PlatformContext): Context | Promise<Context>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {ApolloServerPlugin} from "@apollo/server";
import type {ApolloSettings} from "./ApolloSettings";
import type {ApolloSettings} from "./ApolloSettings.js";

export interface AlterApolloServerPlugins {
$alterApolloServerPlugins(
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/apollo/src/interfaces/ApolloSettings.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {ApolloServer, ApolloServerOptions, ApolloServerOptionsWithSchema} from "@apollo/server";
import type {GatewayInterface} from "@apollo/server-gateway-interface";
import type {IExecutableSchemaDefinition} from "@graphql-tools/schema";
import type {GraphQLSchema} from "graphql/index";
import {ApolloContext} from "./ApolloContext";
import type {GraphQLSchema} from "graphql/index.js";
import type {ApolloContext} from "./ApolloContext.js";

export type ApolloMiddlewareOptions = Record<string, any>;
export type ApolloCustomServerCB<TContext extends ApolloContext> = (config: ApolloServerOptions<TContext>) => ApolloServer<TContext>;
Expand Down
28 changes: 0 additions & 28 deletions packages/graphql/apollo/tsconfig.cjs.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/graphql/apollo/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"moduleResolution": "nodenext",
"rootDir": "src",
"outDir": "./lib/esm",
"declarationDir": "./lib/types-esm",
"declarationDir": "./lib/types",
"declaration": true,
"composite": true,
"noEmit": false
Expand Down
3 changes: 0 additions & 3 deletions packages/graphql/apollo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
{
"path": "../../di/tsconfig.json"
},
{
"path": "./tsconfig.cjs.json"
},
{
"path": "./tsconfig.esm.json"
},
Expand Down
7 changes: 3 additions & 4 deletions packages/graphql/graphql-ws/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "@tsed/graphql-ws",
"version": "8.0.0-alpha.5",
"description": "An extension to allow GraphQL over WebSockets using graphql-ws protocol",
"type": "commonjs",
"type": "module",
"version": "8.0.0-alpha.5",
"source": "./src/index.ts",
"main": "./lib/cjs/index.js",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",
"typings": "./lib/types/index.d.ts",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/cjs/index.js"
}
},
Expand Down
28 changes: 0 additions & 28 deletions packages/graphql/graphql-ws/tsconfig.cjs.json

This file was deleted.

Loading

0 comments on commit 5a0a15e

Please sign in to comment.