Skip to content

Commit

Permalink
Merge pull request #9520 from weseek/imprv/156177-159580-change-pdf-c…
Browse files Browse the repository at this point in the history
…onverter-type-to-module

Imprv/156177 159580 change pdf converter type to module
  • Loading branch information
yuki-takei authored Dec 25, 2024
2 parents 2c8412f + 4bd0bff commit edea8be
Show file tree
Hide file tree
Showing 12 changed files with 1,499 additions and 686 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions apps/pdf-converter/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extensions": ["ts"],
"watch": ["src/**/*.ts"],
"ignore": ["node_modules/**/*"],
"delay": 100,
"execMap": {
"ts": "node --import @swc-node/register/esm-register"
}
}
38 changes: 21 additions & 17 deletions apps/pdf-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,32 @@
"types": "dist/index.d.ts",
"license": "MIT",
"private": true,
"type": "module",
"scripts": {
"dev:pdf-converter:ci": "ts-node -r \"dotenv-flow/config\" src/index.ts --ci",
"dev:pdf-converter": "nodemon --watch \"src/**/*.ts\" --ignore \"node_modules/**/*\" --exec ts-node -r \"dotenv-flow/config\" src/index.ts",
"dev:pdf-converter:ci": "node --import @swc-node/register/esm-register -r \"dotenv-flow/config\" src/index.ts --ci",
"dev:pdf-converter": "nodemon -r \"dotenv-flow/config\" src/index.ts",
"start:prod:ci": "pnpm start:prod --ci",
"start:prod": "node dist/index.js",
"lint": "pnpm eslint **/*.{js,ts}",
"gen:swagger-spec": "SWAGGER_GENERATION=true tsed run generate-swagger --output ./specs",
"gen:swagger-spec": "SWAGGER_GENERATION=true node --import @swc-node/register/esm-register src/bin/index.ts generate-swagger --output ./specs",
"build": "pnpm tsc -p tsconfig.build.json"
},
"dependencies": {
"@godaddy/terminus": "^4.12.1",
"@tsed/cli": "=5.4.3",
"@tsed/cli-core": "=5.4.3",
"@tsed/cli-generate-swagger": "=5.4.3",
"@tsed/common": "=7.84.1",
"@tsed/components-scan": "=7.84.1",
"@tsed/core": "=7.84.1",
"@tsed/di": "=7.84.1",
"@tsed/exceptions": "=7.84.1",
"@tsed/json-mapper": "=7.84.1",
"@tsed/platform-express": "=7.84.1",
"@tsed/schema": "=7.84.1",
"@tsed/swagger": "=7.84.1",
"@tsed/terminus": "=7.84.1",
"@tsed/cli-core": "=6.1.4",
"@tsed/cli-generate-swagger": "=6.1.4",
"@tsed/common": "=8.3.5",
"@tsed/components-scan": "=8.3.5",
"@tsed/core": "=8.3.5",
"@tsed/engines": "=8.3.5",
"@tsed/di": "=8.3.5",
"@tsed/exceptions": "=8.3.5",
"@tsed/json-mapper": "=8.3.5",
"@tsed/platform-express": "=8.3.5",
"@tsed/schema": "=8.3.5",
"@tsed/swagger": "=8.3.5",
"@tsed/terminus": "=8.3.5",
"@tsed/platform-http": "=8.3.5",
"axios": "^0.24.0",
"express": "^4.19.2",
"puppeteer": "^23.1.1",
Expand All @@ -39,6 +41,8 @@
"@types/connect": "^3.4.38",
"@types/express": "^4.17.21",
"@types/multer": "^1.4.12",
"@types/node": "^22.5.4"
"@types/node": "^22.5.4",
"@swc-node/register": "^1.10.9",
"@swc/core": "^1.9.2"
}
}
2 changes: 1 addition & 1 deletion apps/pdf-converter/src/bin/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CliCore } from '@tsed/cli-core';
import { GenerateSwaggerCmd } from '@tsed/cli-generate-swagger';

import Server from '../server';
import Server from '../server.js';

CliCore.bootstrap({
server: Server,
Expand Down
4 changes: 2 additions & 2 deletions apps/pdf-converter/src/controllers/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as PdfCtrl } from './pdf';
export { default as TerminusCtrl } from './terminus';
export { default as PdfCtrl } from './pdf.js';
export { default as TerminusCtrl } from './terminus.js';
2 changes: 1 addition & 1 deletion apps/pdf-converter/src/controllers/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Post, Returns, Enum, Description,
} from '@tsed/schema';

import PdfConvertService, { JobStatusSharedWithGrowi, JobStatus } from '../service/pdf-convert';
import PdfConvertService, { JobStatusSharedWithGrowi, JobStatus } from '../service/pdf-convert.js';

@Controller('/pdf')
class PdfCtrl {
Expand Down
2 changes: 1 addition & 1 deletion apps/pdf-converter/src/controllers/terminus.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Logger } from '@tsed/common';
import { Inject, Injectable } from '@tsed/di';

import PdfConvertService from '../service/pdf-convert';
import PdfConvertService from '../service/pdf-convert.js';

@Injectable()
class TerminusCtrl {
Expand Down
2 changes: 1 addition & 1 deletion apps/pdf-converter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { $log } from '@tsed/common';
import { PlatformExpress } from '@tsed/platform-express';

import Server from './server';
import Server from './server.js';

function hasProcessFlag(flag: string): boolean {
return process.argv.join('').indexOf(flag) > -1;
Expand Down
2 changes: 1 addition & 1 deletion apps/pdf-converter/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import express from 'express';
import '@tsed/swagger';
import '@tsed/terminus';

import * as Controllers from './controllers';
import * as Controllers from './controllers/index.js';

import '@tsed/platform-express';

Expand Down
4 changes: 0 additions & 4 deletions apps/pdf-converter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"baseUrl": ".",
"outDir": "dist",
"declaration": true,
"target": "ES2020",
"lib": ["ES2020", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"rootDir": "src",
"esModuleInterop": true,
"experimentalDecorators": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@changesets/cli": "^2.27.3",
"@faker-js/faker": "^9.0.1",
"@playwright/test": "^1.46.0",
"@swc-node/register": "^1.9.1",
"@swc-node/register": "^1.10.9",
"@swc/core": "^1.5.25",
"@swc/helpers": "^0.5.11",
"@types/css-modules": "^1.0.2",
Expand Down
Loading

0 comments on commit edea8be

Please sign in to comment.