@sondos_rajeh/piece-relative-time-formatter 0.0.2 → 0.0.4

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/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "name": "@sondos_rajeh/piece-relative-time-formatter",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "commonjs",
5
- "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
7
  "dependencies": {
8
8
  "tslib": "^2.3.0"
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
+ "files": [
14
+ "dist"
15
+ ],
13
16
  "description": "time formater package",
14
17
  "scripts": {
15
18
  "test": "npm test"
package/.eslintrc.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "extends": [
3
- "../../../../.eslintrc.base.json"
4
- ],
5
- "ignorePatterns": [
6
- "!**/*"
7
- ],
8
- "overrides": [
9
- {
10
- "files": [
11
- "*.ts",
12
- "*.tsx",
13
- "*.js",
14
- "*.jsx"
15
- ],
16
- "rules": {}
17
- },
18
- {
19
- "files": [
20
- "*.ts",
21
- "*.tsx"
22
- ],
23
- "rules": {}
24
- },
25
- {
26
- "files": [
27
- "*.js",
28
- "*.jsx"
29
- ],
30
- "rules": {}
31
- }
32
- ]
33
- }
package/project.json DELETED
@@ -1,51 +0,0 @@
1
- {
2
- "name": "@sondos_rajeh/piece-relative-time-formatter",
3
- "$schema": "../../../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/pieces/community/relative-time-formatter/src",
5
- "projectType": "library",
6
- "release": {
7
- "version": {
8
- "manifestRootsToUpdate": [
9
- "dist/{projectRoot}"
10
- ],
11
- "currentVersionResolver": "git-tag",
12
- "fallbackCurrentVersionResolver": "disk"
13
- }
14
- },
15
- "tags": [],
16
- "targets": {
17
- "build": {
18
- "executor": "@nx/js:tsc",
19
- "outputs": [
20
- "{options.outputPath}"
21
- ],
22
- "options": {
23
- "outputPath": "dist/packages/pieces/community/relative-time-formatter",
24
- "tsConfig": "packages/pieces/community/relative-time-formatter/tsconfig.lib.json",
25
- "packageJson": "packages/pieces/community/relative-time-formatter/package.json",
26
- "main": "packages/pieces/community/relative-time-formatter/src/index.ts",
27
- "assets": [
28
- "packages/pieces/community/relative-time-formatter/*.md",
29
- {
30
- "input": "packages/pieces/community/relative-time-formatter/src/i18n",
31
- "output": "./src/i18n",
32
- "glob": "**/!(i18n.json)"
33
- }
34
- ],
35
- "buildableProjectDepsInPackageJsonType": "dependencies",
36
- "updateBuildableProjectDepsInPackageJson": true
37
- }
38
- },
39
- "nx-release-publish": {
40
- "options": {
41
- "packageRoot": "dist/{projectRoot}"
42
- }
43
- },
44
- "lint": {
45
- "executor": "@nx/eslint:lint",
46
- "outputs": [
47
- "{options.outputFile}"
48
- ]
49
- }
50
- }
51
- }
package/src/index.ts DELETED
@@ -1,14 +0,0 @@
1
-
2
- import { createPiece, PieceAuth } from "@activepieces/pieces-framework";
3
- import { formatRelativeTimeAction } from "./lib/actions/format-relative-time-action";
4
-
5
- export const relativeTimeFormatter = createPiece({
6
- displayName: "Relative-time-formatter",
7
- auth: PieceAuth.None(),
8
- minimumSupportedRelease: '0.36.1',
9
- logoUrl: "https://cdn.activepieces.com/pieces/relative-time-formatter.png",
10
- authors: [],
11
- actions: [formatRelativeTimeAction],
12
- triggers: [],
13
- });
14
-
@@ -1,34 +0,0 @@
1
- // --- ACTIVEPIECES ACTION DEFINITION ---
2
-
3
- export const formatRelativeTimeAction = createAction({
4
- // ... (Your props definition) ...
5
- props: {
6
- // ... all properties defined here ...
7
- },
8
-
9
- // FINAL CORRECT STRUCTURE: Cast context to 'any' and use context.props for robust access.
10
- async run(context: any) {
11
- // Destructure from context.props to satisfy your environment's TypeScript configuration
12
- const { dateToFormat, referenceDate, locale, numericStyle, unitStyle } = context.props;
13
-
14
- // ... (The rest of your execution logic) ...
15
-
16
- // The rest of the execution logic uses the destructured variables:
17
- const targetDateString = dateToFormat as string;
18
- const referenceDateString = referenceDate as string | undefined;
19
-
20
- // Convert string inputs to Date objects
21
- const targetDate = new Date(targetDateString);
22
- const refDate = referenceDateString ? new Date(referenceDateString) : new Date();
23
-
24
- // 1. Calculate the signed value and unit
25
- // NOTE: The helper function calculateTimeDifference must exist above this line
26
- // const { value, unit } = calculateTimeDifference(targetDate, refDate);
27
-
28
- // ... (rest of the formatting and return) ...
29
-
30
- return {
31
- // ... final return object ...
32
- };
33
- },
34
- });
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "module": "commonjs",
5
- "forceConsistentCasingInFileNames": true,
6
- "strict": true,
7
- "importHelpers": true,
8
- "noImplicitOverride": true,
9
- "noImplicitReturns": true,
10
- "noFallthroughCasesInSwitch": true,
11
- "noPropertyAccessFromIndexSignature": true
12
- },
13
- "files": [],
14
- "include": [],
15
- "references": [
16
- {
17
- "path": "./tsconfig.lib.json"
18
- }
19
- ]
20
- }
package/tsconfig.lib.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../../../dist/out-tsc",
5
- "declaration": true,
6
- "types": ["node"]
7
- },
8
- "include": ["src/**/*.ts"]
9
- }