@digipair/skill-markitdown 0.89.0 → 0.91.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.swcrc ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "jsc": {
3
+ "target": "es2017",
4
+ "parser": {
5
+ "syntax": "typescript",
6
+ "decorators": true,
7
+ "dynamicImport": true
8
+ },
9
+ "transform": {
10
+ "decoratorMetadata": true,
11
+ "legacyDecorator": true
12
+ },
13
+ "keepClassNames": true,
14
+ "externalHelpers": true,
15
+ "loose": true
16
+ },
17
+ "module": {
18
+ "type": "es6"
19
+ },
20
+ "sourceMaps": true,
21
+ "exclude": [
22
+ "jest.config.ts",
23
+ ".*\\.spec.tsx?$",
24
+ ".*\\.test.tsx?$",
25
+ "./src/jest-setup.ts$",
26
+ "./**/jest-setup.ts$"
27
+ ]
28
+ }
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # mylib
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build mylib` to build the library.
@@ -0,0 +1,22 @@
1
+ import baseConfig from '../../eslint.config.mjs';
2
+
3
+ export default [
4
+ ...baseConfig,
5
+ {
6
+ files: ['**/*.json'],
7
+ rules: {
8
+ '@nx/dependency-checks': [
9
+ 'error',
10
+ {
11
+ ignoredFiles: [
12
+ '{projectRoot}/eslint.config.{js,cjs,mjs}',
13
+ '{projectRoot}/rollup.config.{js,ts,mjs,mts,cjs,cts}',
14
+ ],
15
+ },
16
+ ],
17
+ },
18
+ languageOptions: {
19
+ parser: await import('jsonc-eslint-parser'),
20
+ },
21
+ },
22
+ ];
package/package.json CHANGED
@@ -1,12 +1,28 @@
1
1
  {
2
2
  "name": "@digipair/skill-markitdown",
3
- "version": "0.89.0",
3
+ "version": "0.91.0-0",
4
+ "type": "module",
5
+ "main": "dist/libs/skill-markitdown/index.cjs.js",
6
+ "module": "dist/libs/skill-markitdown/index.esm.js",
7
+ "types": "dist/libs/skill-markitdown/index.esm.d.ts",
8
+ "exports": {
9
+ "./package.json": "./libs/skill-markitdown/package.json",
10
+ ".": {
11
+ "development": "./dist/libs/skill-markitdown/src/index.ts",
12
+ "types": "./dist/libs/skill-markitdown/index.esm.d.ts",
13
+ "import": "./dist/libs/skill-markitdown/index.esm.js",
14
+ "default": "./dist/libs/skill-markitdown/index.cjs.js"
15
+ }
16
+ },
4
17
  "keywords": [
5
18
  "digipair",
6
- "service",
7
- "tool"
19
+ "tool",
20
+ "service"
8
21
  ],
9
- "dependencies": {},
10
- "main": "./index.cjs.js",
11
- "module": "./index.esm.js"
12
- }
22
+ "nx": {
23
+ "name": "skill-markitdown"
24
+ },
25
+ "dependencies": {
26
+ "@digipair/engine": "0.91.0-0"
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ const { withNx } = require('@nx/rollup/with-nx');
2
+
3
+ module.exports = withNx(
4
+ {
5
+ main: 'libs/skill-markitdown/src/index.ts',
6
+ outputPath: 'dist/libs/skill-markitdown',
7
+ tsConfig: 'libs/skill-markitdown/tsconfig.lib.json',
8
+ compiler: 'swc',
9
+ format: ['esm', "cjs"],
10
+ assets: [
11
+ {
12
+ input: 'libs/skill-markitdown/',
13
+ glob: 'package.json',
14
+ output: '.'
15
+ },
16
+ {
17
+ input: 'libs/skill-markitdown/src/',
18
+ glob: '*.json',
19
+ output: '.'
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ // Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
25
+ // e.g.
26
+ // output: { sourcemap: true },
27
+ }
28
+ );
@@ -0,0 +1,7 @@
1
+ import { skillMarkitdown } from './skill-markitdown';
2
+
3
+ describe('skillMarkitdown', () => {
4
+ it('should work', () => {
5
+ expect(skillMarkitdown()).toEqual('skill-markitdown');
6
+ });
7
+ });
@@ -0,0 +1,46 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ import { PinsSettings } from '@digipair/engine';
4
+ import { spawn } from 'child_process';
5
+
6
+ class MaikitdownService {
7
+ async convert(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
8
+ const {
9
+ file,
10
+ path = context.privates?.MARKITDOWN_PATH ?? process.env['MARKITDOWN_PATH'] ?? 'markitdown',
11
+ } = params;
12
+
13
+ return new Promise((resolve, reject) => {
14
+ // Spawn the markitdown process
15
+ const markitdown = spawn(path);
16
+
17
+ let markdown = '';
18
+ let errorOutput = '';
19
+
20
+ // Listen for data from the stdout stream
21
+ markitdown.stdout.on('data', data => {
22
+ markdown += data.toString();
23
+ });
24
+
25
+ // Listen for data from the stderr stream
26
+ markitdown.stderr.on('data', data => {
27
+ errorOutput += data.toString();
28
+ });
29
+
30
+ // Handle the close event
31
+ markitdown.on('close', code => {
32
+ if (code !== 0) {
33
+ return reject(new Error(`markitdown process exited with code ${code}: ${errorOutput}`));
34
+ }
35
+ resolve(markdown);
36
+ });
37
+
38
+ // Write the decoded PDF content to stdin
39
+ markitdown.stdin.write(Buffer.from(file.replace(/^data:.*;base64,/, ''), 'base64'));
40
+ markitdown.stdin.end();
41
+ });
42
+ }
43
+ }
44
+
45
+ export const convert = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
46
+ new MaikitdownService().convert(params, pinsSettingsList, context);
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "files": [],
4
+ "include": [],
5
+ "references": [
6
+ {
7
+ "path": "../engine"
8
+ },
9
+ {
10
+ "path": "./tsconfig.lib.json"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist",
6
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
7
+ "emitDeclarationOnly": true,
8
+ "module": "esnext",
9
+ "moduleResolution": "node",
10
+ "forceConsistentCasingInFileNames": true,
11
+ "types": ["node"]
12
+ },
13
+ "include": ["src/**/*.ts"],
14
+ "references": [
15
+ {
16
+ "path": "../engine/tsconfig.lib.json"
17
+ }
18
+ ]
19
+ }
package/index.cjs.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/index";
package/index.cjs.js DELETED
@@ -1,40 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var child_process = require('child_process');
6
-
7
- let MaikitdownService = class MaikitdownService {
8
- async convert(params, _pinsSettingsList, context) {
9
- var _context_privates;
10
- var _context_privates_MARKITDOWN_PATH, _ref;
11
- const { file, path = (_ref = (_context_privates_MARKITDOWN_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.MARKITDOWN_PATH) != null ? _context_privates_MARKITDOWN_PATH : process.env['MARKITDOWN_PATH']) != null ? _ref : 'markitdown' } = params;
12
- return new Promise((resolve, reject)=>{
13
- // Spawn the markitdown process
14
- const markitdown = child_process.spawn(path);
15
- let markdown = '';
16
- let errorOutput = '';
17
- // Listen for data from the stdout stream
18
- markitdown.stdout.on('data', (data)=>{
19
- markdown += data.toString();
20
- });
21
- // Listen for data from the stderr stream
22
- markitdown.stderr.on('data', (data)=>{
23
- errorOutput += data.toString();
24
- });
25
- // Handle the close event
26
- markitdown.on('close', (code)=>{
27
- if (code !== 0) {
28
- return reject(new Error(`markitdown process exited with code ${code}: ${errorOutput}`));
29
- }
30
- resolve(markdown);
31
- });
32
- // Write the decoded PDF content to stdin
33
- markitdown.stdin.write(Buffer.from(file.replace(/^data:.*;base64,/, ''), 'base64'));
34
- markitdown.stdin.end();
35
- });
36
- }
37
- };
38
- const convert = (params, pinsSettingsList, context)=>new MaikitdownService().convert(params, pinsSettingsList, context);
39
-
40
- exports.convert = convert;
package/index.esm.js DELETED
@@ -1,36 +0,0 @@
1
- import { spawn } from 'child_process';
2
-
3
- let MaikitdownService = class MaikitdownService {
4
- async convert(params, _pinsSettingsList, context) {
5
- var _context_privates;
6
- var _context_privates_MARKITDOWN_PATH, _ref;
7
- const { file, path = (_ref = (_context_privates_MARKITDOWN_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.MARKITDOWN_PATH) != null ? _context_privates_MARKITDOWN_PATH : process.env['MARKITDOWN_PATH']) != null ? _ref : 'markitdown' } = params;
8
- return new Promise((resolve, reject)=>{
9
- // Spawn the markitdown process
10
- const markitdown = spawn(path);
11
- let markdown = '';
12
- let errorOutput = '';
13
- // Listen for data from the stdout stream
14
- markitdown.stdout.on('data', (data)=>{
15
- markdown += data.toString();
16
- });
17
- // Listen for data from the stderr stream
18
- markitdown.stderr.on('data', (data)=>{
19
- errorOutput += data.toString();
20
- });
21
- // Handle the close event
22
- markitdown.on('close', (code)=>{
23
- if (code !== 0) {
24
- return reject(new Error(`markitdown process exited with code ${code}: ${errorOutput}`));
25
- }
26
- resolve(markdown);
27
- });
28
- // Write the decoded PDF content to stdin
29
- markitdown.stdin.write(Buffer.from(file.replace(/^data:.*;base64,/, ''), 'base64'));
30
- markitdown.stdin.end();
31
- });
32
- }
33
- };
34
- const convert = (params, pinsSettingsList, context)=>new MaikitdownService().convert(params, pinsSettingsList, context);
35
-
36
- export { convert };
@@ -1,2 +0,0 @@
1
- import { PinsSettings } from '@digipair/engine';
2
- export declare const convert: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
File without changes
File without changes
File without changes