Johannes Zillmann 2020-12-19 13:49:14 +01:00
parent ea67f4b244
commit f988bd565e
9 changed files with 6061 additions and 0 deletions

1
core/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
lib

5
core/.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"printWidth": 120,
"trailingComma": "all",
"singleQuote": true
}

20
core/jest.config.js Normal file
View File

@ -0,0 +1,20 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['./'],
transform: { '\\.ts$': ['ts-jest'] },
testRegex: '(/test/.*|(\\.|/)(test|spec))\\.(ts)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'src/(.*)': '<rootDir>/src/$1',
'test/(.*)': '<rootDir>/test/$1',
},
globals: {
'ts-jest': {
tsconfig: {
// allow js in typescript
allowJs: true,
},
},
},
};

5979
core/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

31
core/package.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "pdf-to-markdown-core",
"version": "1.0.0",
"description": "Core logic for parsing a PDF and transforming it to Markdown",
"main": "index.js",
"files": [
"lib/src/**/*"
],
"scripts": {
"test": "jest",
"build": "tsc",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
"lint": "tslint -p tsconfig.json"
},
"keywords": [
"PDF",
"Markdown",
"Converter"
],
"author": "Johannes Zillmann",
"license": "AGPL-3.0",
"devDependencies": {
"@types/jest": "^26.0.19",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.1.3"
}
}

1
core/src/index.ts Normal file
View File

@ -0,0 +1 @@
export const Greeter = (name: string) => `Hello ${name}`;

5
core/test/index.test.ts Normal file
View File

@ -0,0 +1,5 @@
import { Greeter } from 'src/index';
test('My Greeter', () => {
expect(Greeter('Carl')).toBe('Hello Carl');
});

16
core/tsconfig.json Normal file
View File

@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"declaration": true,
"outDir": "./lib",
"strict": true,
"baseUrl": "./",
"paths": {
"src/*": ["src/*"],
"test/*": ["test/*"]
}
},
"include": ["src", "test"],
"exclude": ["node_modules"]
}

3
core/tslint.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": ["tslint:recommended", "tslint-config-prettier"]
}