Skip to content

Commit 05ccd2e

Browse files
committed
refactor: move temp dirs out of dist/ and src/
1 parent 2486e13 commit 05ccd2e

File tree

10 files changed

+11
-9
lines changed

10 files changed

+11
-9
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ out
119119
# Test files
120120
*.wmf
121121
*.emf
122+
temp*
122123
test_resources/
123-
dist/temp*/
124124
**/*.test.*
125125

126126
# Development files

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ yarn.lock
143143
# Test files
144144
*.wmf
145145
*.emf
146+
temp*
146147
test_resources/test-log*
147148
test_resources/.audit.json
148-
src/temp*/
149149

150150
# Tesseract trained data
151151
ocr_lang_data/*.gz

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ yarn.lock
148148
# Test files
149149
*.wmf
150150
*.emf
151+
temp*
151152
test_resources/test-log*
152153
test_resources/.audit.json
153-
src/temp*/
154154

155155
# Tesseract trained data
156156
ocr_lang_data/*.gz

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN npm ci --ignore-scripts --omit=dev && \
2525
COPY . .
2626

2727
# Create temp folder for files to be stored whilst being converted
28-
RUN mkdir -p ./dist/temp/
28+
RUN mkdir -p ./temp/
2929

3030
# ------------------
3131
# Final image

src/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ async function main() {
1818

1919
const config = await getConfig();
2020

21+
console.log(config.tempDir);
22+
2123
const server = Fastify(config.fastifyInit);
2224
await server.register(startServer, config).listen(config.fastify);
2325

src/config/config.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { joinSafe } = require("upath");
88
const getConfig = require(".");
99

1010
const originalEnv = { ...process.env, NODE_ENV: "development" };
11-
const tempDir = joinSafe(__dirname, "../temp");
11+
const tempDir = joinSafe(__dirname, "../../temp");
1212

1313
describe("Configuration", () => {
1414
afterEach(() => {

src/config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function parseCorsParameter(param) {
4242
*/
4343
async function getConfig() {
4444
// Directory for temporarily storing files during conversion
45-
const tempDir = joinSafe(__dirname, "../temp");
45+
const tempDir = joinSafe(__dirname, "../../temp");
4646

4747
// Validate env variables
4848
const env = envSchema({

src/plugins/pdf-to-html/plugin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("PDF-to-HTML conversion plugin", () => {
2525

2626
beforeAll(async () => {
2727
config = await getConfig();
28-
config.poppler.tempDir = "./src/temp-test-pdf-to-html/";
28+
config.poppler.tempDir = "./temp-test-pdf-to-html/";
2929

3030
server = Fastify();
3131

src/plugins/pdf-to-txt/plugin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("PDF-to-TXT conversion plugin", () => {
1919

2020
beforeAll(async () => {
2121
config = await getConfig();
22-
config.poppler.tempDir = "./src/temp-test-pdf-to-txt/";
22+
config.poppler.tempDir = "./temp-test-pdf-to-txt/";
2323

2424
server = Fastify({ pluginTimeout: 30000 });
2525

src/plugins/rtf-to-html/plugin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("RTF-to-HTML conversion plugin", () => {
2525

2626
beforeAll(async () => {
2727
config = await getConfig();
28-
config.unrtf.tempDir = "./src/temp-test-rtf-to-html/";
28+
config.unrtf.tempDir = "./temp-test-rtf-to-html/";
2929

3030
server = Fastify({ bodyLimit: 10485760 });
3131

0 commit comments

Comments
 (0)