mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 23:45:02 +00:00
packaging working, need to fix json import assertion
This commit is contained in:
parent
9c1588d150
commit
c07e247a2a
2894
package-lock.json
generated
2894
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,45 +1,49 @@
|
|||||||
{
|
{
|
||||||
"name": "@stirling-pdf/server-node",
|
"name": "@stirling-pdf/server-node",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"//": "end pkgroll config",
|
"type": "module",
|
||||||
"type": "module",
|
"exports": "./dist/index.js",
|
||||||
"exports": "./dist/index.js",
|
"imports": {
|
||||||
"imports": {
|
"#pdfcpu": "../../shared-operations/src/wasm/pdfcpu/pdfcpu-wrapper.server.js"
|
||||||
"#pdfcpu": "../../shared-operations/src/wasm/pdfcpu/pdfcpu-wrapper.server.js"
|
},
|
||||||
},
|
"optionalDependencies": {
|
||||||
"optionalDependencies": {
|
"canvas": "^2.11.2"
|
||||||
"canvas": "^2.11.2"
|
},
|
||||||
},
|
"scripts": {
|
||||||
"files": [
|
"dev": "npx tsx watch src/index.ts",
|
||||||
"/shared-operations/src/wasm/pdfcpu/pdfcpu.wasm"
|
"build": "npm run prebuild && pkgroll && npm run postbuild",
|
||||||
],
|
"start": "node ./dist/index.js",
|
||||||
"scripts": {
|
|
||||||
"build": "pkgroll",
|
"prebuild": "rimraf ./dist",
|
||||||
"start": "node ./dist/index.js",
|
"postbuild": "npm run copy-locales && npm run copy-pdfcpu",
|
||||||
"dev": "npx tsx watch src/index.ts"
|
"copy-locales": "copyfiles -u 3 ../shared-operations/src/locales/**/*.json dist",
|
||||||
},
|
"copy-pdfcpu": "copyfiles -u 5 ../shared-operations/src/wasm/pdfcpu/pdfcpu.wasm dist"
|
||||||
"keywords": [],
|
},
|
||||||
"author": "",
|
"keywords": [],
|
||||||
"license": "ISC",
|
"author": "",
|
||||||
"dependencies": {
|
"license": "ISC",
|
||||||
"@esbuild/win32-x64": "^0.19.10",
|
"dependencies": {
|
||||||
"@types/archiver": "^6.0.1",
|
"@esbuild/win32-x64": "^0.19.10",
|
||||||
"@types/express": "^4.17.21",
|
"@types/archiver": "^6.0.1",
|
||||||
"@types/multer": "^1.4.10",
|
"@types/express": "^4.17.21",
|
||||||
"@wasmer/wasmfs": "^0.12.0",
|
"@types/multer": "^1.4.10",
|
||||||
"archiver": "^6.0.1",
|
"@wasmer/wasmfs": "^0.12.0",
|
||||||
"express": "^4.18.2",
|
"archiver": "^6.0.1",
|
||||||
"express-fileupload": "^1.4.2",
|
"express": "^4.18.2",
|
||||||
"joi": "^17.11.0",
|
"express-fileupload": "^1.4.2",
|
||||||
"jsqr": "^1.4.0",
|
"joi": "^17.11.0",
|
||||||
"multer": "^1.4.5-lts.1",
|
"jsqr": "^1.4.0",
|
||||||
"pdf-lib": "^1.17.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
"tsconfig-paths": "^4.2.0"
|
"pdf-lib": "^1.17.1",
|
||||||
},
|
"tsconfig-paths": "^4.2.0"
|
||||||
"devDependencies": {
|
},
|
||||||
"pkgroll": "^2.0.1",
|
"devDependencies": {
|
||||||
"ts-node-dev": "^2.0.0",
|
"copyfiles": "^2.4.1",
|
||||||
"typescript": "^5.2.2"
|
"pkgroll": "^2.0.1",
|
||||||
|
"rimraf": "^5.0.5",
|
||||||
|
"ts-node-dev": "^2.0.0",
|
||||||
|
"typescript": "^5.2.2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
import "@stirling-pdf/shared-operations/src/locales/i18next.config";
|
import "@stirling-pdf/shared-operations/src/i18next.config";
|
||||||
|
|
||||||
import express from "express";
|
import express from "express";
|
||||||
const app = express();
|
const app = express();
|
||||||
|
@ -2,10 +2,10 @@ import i18next from "i18next";
|
|||||||
import resourcesToBackend from "i18next-resources-to-backend";
|
import resourcesToBackend from "i18next-resources-to-backend";
|
||||||
|
|
||||||
i18next
|
i18next
|
||||||
.use(resourcesToBackend((language, namespace) => import(`./${namespace}/${language}.json`)))
|
.use(resourcesToBackend((language, namespace) => import(`./locales/${namespace}/${language}.json`)))
|
||||||
.init({
|
.init({
|
||||||
// debug: true,
|
// debug: true,
|
||||||
ns: ["common"], // Preload this namespace, no need to add the others
|
ns: ["common"], // Preload this namespace, no need to add the others, they will load once their module is loaded
|
||||||
defaultNS: "common",
|
defaultNS: "common",
|
||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
interpolation: {
|
interpolation: {
|
@ -1,7 +1,8 @@
|
|||||||
import { WasmFs } from '@wasmer/wasmfs';
|
import { WasmFs } from '@wasmer/wasmfs';
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
let nodeWasmLocation = "../shared-operations/src/wasm/pdfcpu/"; // TODO: Replace with __dirname
|
let nodeWasmLocation = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
let fs;
|
let fs;
|
||||||
const wasmfs = new WasmFs();
|
const wasmfs = new WasmFs();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user