From 82b8d4c2f83230ac172f90a52152162f02b6bd74 Mon Sep 17 00:00:00 2001 From: Munkhjin Nyamdorj Date: Wed, 27 Mar 2024 10:54:11 +0800 Subject: [PATCH] refactor: regenerate piece to name pdf --- .eslintrc.base.json | 35 +++++++++++++++++++ .../{pdf-to-text => PDF}/.eslintrc.json | 0 packages/pieces/community/PDF/README.md | 7 ++++ packages/pieces/community/PDF/package.json | 4 +++ packages/pieces/community/PDF/project.json | 24 +++++++++++++ packages/pieces/community/PDF/src/index.ts | 13 +++++++ .../{pdf-to-text => PDF}/tsconfig.json | 0 .../{pdf-to-text => PDF}/tsconfig.lib.json | 0 .../pieces/community/pdf-to-text/README.md | 7 ---- .../pieces/community/pdf-to-text/package.json | 9 ----- .../pieces/community/pdf-to-text/project.json | 24 ------------- .../pieces/community/pdf-to-text/src/index.ts | 12 ------- .../src/lib/actions/pdf-to-text.ts | 24 ------------- 13 files changed, 83 insertions(+), 76 deletions(-) create mode 100644 .eslintrc.base.json rename packages/pieces/community/{pdf-to-text => PDF}/.eslintrc.json (100%) create mode 100644 packages/pieces/community/PDF/README.md create mode 100644 packages/pieces/community/PDF/package.json create mode 100644 packages/pieces/community/PDF/project.json create mode 100644 packages/pieces/community/PDF/src/index.ts rename packages/pieces/community/{pdf-to-text => PDF}/tsconfig.json (100%) rename packages/pieces/community/{pdf-to-text => PDF}/tsconfig.lib.json (100%) delete mode 100644 packages/pieces/community/pdf-to-text/README.md delete mode 100644 packages/pieces/community/pdf-to-text/package.json delete mode 100644 packages/pieces/community/pdf-to-text/project.json delete mode 100644 packages/pieces/community/pdf-to-text/src/index.ts delete mode 100644 packages/pieces/community/pdf-to-text/src/lib/actions/pdf-to-text.ts diff --git a/.eslintrc.base.json b/.eslintrc.base.json new file mode 100644 index 0000000000..9ca2e830cb --- /dev/null +++ b/.eslintrc.base.json @@ -0,0 +1,35 @@ +{ + "root": true, + "ignorePatterns": ["**/*"], + "plugins": ["@nx"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "@nx/enforce-module-boundaries": [ + "error", + { + "enforceBuildableLibDependency": true, + "allow": [], + "depConstraints": [ + { + "sourceTag": "*", + "onlyDependOnLibsWithTags": ["*"] + } + ] + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@nx/typescript"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "extends": ["plugin:@nx/javascript"], + "rules": {} + } + ] +} diff --git a/packages/pieces/community/pdf-to-text/.eslintrc.json b/packages/pieces/community/PDF/.eslintrc.json similarity index 100% rename from packages/pieces/community/pdf-to-text/.eslintrc.json rename to packages/pieces/community/PDF/.eslintrc.json diff --git a/packages/pieces/community/PDF/README.md b/packages/pieces/community/PDF/README.md new file mode 100644 index 0000000000..049a73701b --- /dev/null +++ b/packages/pieces/community/PDF/README.md @@ -0,0 +1,7 @@ +# pieces-PDF + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build pieces-PDF` to build the library. diff --git a/packages/pieces/community/PDF/package.json b/packages/pieces/community/PDF/package.json new file mode 100644 index 0000000000..79d2865328 --- /dev/null +++ b/packages/pieces/community/PDF/package.json @@ -0,0 +1,4 @@ +{ + "name": "@activepieces/piece-PDF", + "version": "0.0.1" +} diff --git a/packages/pieces/community/PDF/project.json b/packages/pieces/community/PDF/project.json new file mode 100644 index 0000000000..f3a74e8662 --- /dev/null +++ b/packages/pieces/community/PDF/project.json @@ -0,0 +1,24 @@ +{ + "name": "pieces-PDF", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/pieces/community/PDF/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/pieces/community/PDF", + "tsConfig": "packages/pieces/community/PDF/tsconfig.lib.json", + "packageJson": "packages/pieces/community/PDF/package.json", + "main": "packages/pieces/community/PDF/src/index.ts", + "assets": ["packages/pieces/community/PDF/*.md"] + } + }, + "publish": { + "command": "node tools/scripts/publish.mjs pieces-PDF {args.ver} {args.tag}", + "dependsOn": ["build"] + } + }, + "tags": [] +} diff --git a/packages/pieces/community/PDF/src/index.ts b/packages/pieces/community/PDF/src/index.ts new file mode 100644 index 0000000000..9e3217f9c5 --- /dev/null +++ b/packages/pieces/community/PDF/src/index.ts @@ -0,0 +1,13 @@ + + import { createPiece, PieceAuth } from "@activepieces/pieces-framework"; + + export const PDF = createPiece({ + displayName: "Pdf", + auth: PieceAuth.None(), + minimumSupportedRelease: '0.20.0', + logoUrl: "https://cdn.activepieces.com/pieces/PDF.png", + authors: [], + actions: [], + triggers: [], + }); + \ No newline at end of file diff --git a/packages/pieces/community/pdf-to-text/tsconfig.json b/packages/pieces/community/PDF/tsconfig.json similarity index 100% rename from packages/pieces/community/pdf-to-text/tsconfig.json rename to packages/pieces/community/PDF/tsconfig.json diff --git a/packages/pieces/community/pdf-to-text/tsconfig.lib.json b/packages/pieces/community/PDF/tsconfig.lib.json similarity index 100% rename from packages/pieces/community/pdf-to-text/tsconfig.lib.json rename to packages/pieces/community/PDF/tsconfig.lib.json diff --git a/packages/pieces/community/pdf-to-text/README.md b/packages/pieces/community/pdf-to-text/README.md deleted file mode 100644 index 57bba194ea..0000000000 --- a/packages/pieces/community/pdf-to-text/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# pieces-pdf-to-text - -This library was generated with [Nx](https://nx.dev). - -## Building - -Run `nx build pieces-pdf-to-text` to build the library. diff --git a/packages/pieces/community/pdf-to-text/package.json b/packages/pieces/community/pdf-to-text/package.json deleted file mode 100644 index 9cbc36377d..0000000000 --- a/packages/pieces/community/pdf-to-text/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@activepieces/piece-pdf-to-text", - "version": "0.0.1", - "dependencies": { - "@activepieces/pieces-framework": "*", - "tslib": "2.6.2", - "@activepieces/shared": "*" - } -} diff --git a/packages/pieces/community/pdf-to-text/project.json b/packages/pieces/community/pdf-to-text/project.json deleted file mode 100644 index 3ff295ca33..0000000000 --- a/packages/pieces/community/pdf-to-text/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "pieces-pdf-to-text", - "$schema": "../../../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "packages/pieces/community/pdf-to-text/src", - "projectType": "library", - "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/pieces/community/pdf-to-text", - "tsConfig": "packages/pieces/community/pdf-to-text/tsconfig.lib.json", - "packageJson": "packages/pieces/community/pdf-to-text/package.json", - "main": "packages/pieces/community/pdf-to-text/src/index.ts", - "assets": ["packages/pieces/community/pdf-to-text/*.md"] - } - }, - "publish": { - "command": "node tools/scripts/publish.mjs pieces-pdf-to-text {args.ver} {args.tag}", - "dependsOn": ["build"] - } - }, - "tags": [] -} diff --git a/packages/pieces/community/pdf-to-text/src/index.ts b/packages/pieces/community/pdf-to-text/src/index.ts deleted file mode 100644 index 3d89159fb3..0000000000 --- a/packages/pieces/community/pdf-to-text/src/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { createPiece, PieceAuth } from '@activepieces/pieces-framework'; -import { parseTextFromPdfFile } from './lib/actions/pdf-to-text'; - -export const pdfToText = createPiece({ - displayName: 'Pdf-to-text', - auth: PieceAuth.None(), - minimumSupportedRelease: '0.20.0', - logoUrl: 'https://cdn.activepieces.com/pieces/pdf-to-text.png', - authors: [], - actions: [parseTextFromPdfFile], - triggers: [], -}); diff --git a/packages/pieces/community/pdf-to-text/src/lib/actions/pdf-to-text.ts b/packages/pieces/community/pdf-to-text/src/lib/actions/pdf-to-text.ts deleted file mode 100644 index 83860ba1f1..0000000000 --- a/packages/pieces/community/pdf-to-text/src/lib/actions/pdf-to-text.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { createAction, Property } from '@activepieces/pieces-framework'; -import { readPdfText } from 'pdf-text-reader'; - -export const parseTextFromPdfFile = createAction({ - // auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication, - name: 'parseTextFromPdfFile', - displayName: 'Parse text from PDF file', - description: 'Parses texts from PDF file', - props: { - file: Property.LongText({ - displayName: 'PDF File URL', - required: true, - }), - }, - async run(context) { - // Action logic here - console.dir(context, { depth: null }); - - const file = context.propsValue.file; - const pdfText = await readPdfText({ url: file }); - - return pdfText; - }, -});