@nexo-labs/payload-taxonomies 0.8.5 → 0.8.7

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.
@@ -0,0 +1,3 @@
1
+ import "@nexo-labs/hegel";
2
+ import { Field } from "payload";
3
+ export declare const taxonomyRelationship: Field;
@@ -0,0 +1,11 @@
1
+ import "@nexo-labs/hegel";
2
+ import { COLLECTION_SLUG_TAXONOMY } from "./taxonomy";
3
+ export const taxonomyRelationship = {
4
+ name: "categories",
5
+ label: "Categorías",
6
+ type: "relationship",
7
+ relationTo: COLLECTION_SLUG_TAXONOMY,
8
+ defaultValue: [],
9
+ hasMany: true,
10
+ required: false,
11
+ };
@@ -0,0 +1,3 @@
1
+ import type { CollectionConfig } from "payload";
2
+ export declare const COLLECTION_SLUG_TAXONOMY: "taxonomy";
3
+ export declare const taxonomiesCollection: (config: Partial<CollectionConfig>) => CollectionConfig;
@@ -0,0 +1,36 @@
1
+ export const COLLECTION_SLUG_TAXONOMY = 'taxonomy';
2
+ export const taxonomiesCollection = (config) => ({
3
+ ...config,
4
+ slug: COLLECTION_SLUG_TAXONOMY,
5
+ labels: {
6
+ singular: 'Taxonomia',
7
+ plural: 'Taxonomias',
8
+ },
9
+ admin: {
10
+ useAsTitle: 'singular_name',
11
+ group: 'Contenido',
12
+ },
13
+ fields: [
14
+ {
15
+ name: 'singular_name',
16
+ label: 'Nombre singular',
17
+ type: 'text',
18
+ localized: true,
19
+ required: true,
20
+ },
21
+ {
22
+ name: 'plural_name',
23
+ label: 'Nombre plural',
24
+ type: 'text',
25
+ localized: true,
26
+ required: false,
27
+ },
28
+ {
29
+ name: 'payload',
30
+ label: 'Payload Adicional',
31
+ type: 'json',
32
+ required: false,
33
+ },
34
+ ...(config.fields ?? []),
35
+ ],
36
+ });
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@nexo-labs/payload-taxonomies",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "Taxonomies for Payload CMS",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
- "main": "./dist/index.cjs",
9
+ "main": "./dist/index.js",
10
10
  "module": "./dist/index.js",
11
11
  "types": "./dist/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
14
  "types": "./dist/index.d.ts",
15
- "import": "./dist/index.js",
16
- "require": "./dist/index.cjs"
15
+ "import": "./dist/index.js"
17
16
  }
18
17
  },
19
18
  "keywords": [
@@ -33,7 +32,6 @@
33
32
  "eslint": "^9.0.0",
34
33
  "payload": "3.35.1",
35
34
  "rimraf": "^5.0.10",
36
- "tsup": "^8.4.0",
37
35
  "typescript": "^5.0.0",
38
36
  "@nexo-labs/hegel": "0.0.0"
39
37
  },
@@ -43,7 +41,7 @@
43
41
  ],
44
42
  "scripts": {
45
43
  "clean": "rimraf dist",
46
- "build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
44
+ "build": "tsc -p tsconfig.build.json",
47
45
  "taxonomize": "node src/processor/runners/run-taxonomizer.mjs",
48
46
  "process": "node src/processor/runners/run-processor.mjs",
49
47
  "diagram": "node src/processor/runners/run-diagram-generator.mjs",