Fixed TS Build, still need it to package .wasm file

This commit is contained in:
Felix Kaspar 2023-12-29 00:10:25 +01:00
parent b2fdb7ec15
commit 0411a36b56
6 changed files with 325 additions and 8648 deletions

8929
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,8 +16,8 @@
"devDependencies": {
"concurrently": "^8.2.2"
},
"engines" : {
"npm" : ">=7.24.2"
"engines": {
"npm": ">=7.24.2"
},
"engineStrict" : true
"engineStrict": true
}

View File

@ -2,17 +2,29 @@
"name": "@stirling-pdf/server-node",
"version": "0.0.0",
"description": "",
"main": "index.js",
"//": "start pkgroll config",
"type": "module",
"exports": "./dist/index.js",
"imports": {
"#pdfcpu": "../../shared-operations/src/wasm/pdfcpu/pdfcpu-wrapper.server.js"
},
"files": [
"/shared-operations/src/wasm/pdfcpu/pdfcpu.wasm"
],
"//": "end pkgroll config",
"scripts": {
"build": "npx tsc",
"start": "node dist/index.js",
"build": "pkgroll",
"start": "node ./dist/index.js",
"dev": "npx tsx watch src/index.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@stirling-pdf/shared-operations": "*",
"@esbuild/win32-x64": "^0.19.10",
"@types/archiver": "^6.0.1",
"@types/express": "^4.17.21",
"@types/multer": "^1.4.10",
"@wasmer/wasmfs": "^0.12.0",
"archiver": "^6.0.1",
"express": "^4.18.2",
@ -24,12 +36,8 @@
"tsconfig-paths": "^4.2.0"
},
"devDependencies": {
"@types/archiver": "^6.0.1",
"@types/express": "^4.17.21",
"@types/multer": "^1.4.10",
"pkgroll": "^2.0.1",
"ts-node-dev": "^2.0.0",
"typescript": "^5.2.2"
},
"exports": "./dist/index.js",
"type": "module"
}
}

View File

@ -6,7 +6,7 @@ import { getOperatorByName } from '@stirling-pdf/shared-operations/src/workflow/
import { Operator } from '@stirling-pdf/shared-operations/src/functions';
import { PdfFile } from '@stirling-pdf/shared-operations/src/wrappers/PdfFile';
import { respondWithPdfFiles } from 'utils/endpoint-utils';
import { respondWithPdfFiles } from '../../utils/endpoint-utils';
import { Action } from '@stirling-pdf/shared-operations/declarations/Action';
import { JoiPDFFileSchema } from '@stirling-pdf/shared-operations/src/wrappers/PdfFileJoi';

View File

@ -6,11 +6,14 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"imports": {
"#pdfcpu": "./src/wasm/pdfcpu/pdfcpu-wrapper.server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"image-js": "^0.35.5",
"pdf-lib": "^1.17.1",
"pdfjs-dist": "^4.0.189"
"pdfjs-dist": "^4.0.269"
}
}

View File

@ -2,7 +2,6 @@
import { PdfFile, RepresentationType } from "../wrappers/PdfFile";
import { Operator, Progress, oneToOne } from ".";
// @ts-expect-error
import * as pdfcpuWrapper from "#pdfcpu"; // This is updated by tsconfig.json/paths for the context (browser, node, etc.) this module is used in.
import Joi from "joi";