@payloadcms/plugin-redirects 1.0.1 → 3.0.0-alpha.42

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/README.md CHANGED
@@ -1,92 +1,7 @@
1
1
  # Payload Redirects Plugin
2
2
 
3
- [![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-redirects)](https://www.npmjs.com/package/@payloadcms/plugin-redirects)
3
+ A plugin for [Payload](https://github.com/payloadcms/payload) to easily manage your redirects from within your admin panel.
4
4
 
5
- A plugin for [Payload](https://github.com/payloadcms/payload) to easily manage your redirects.
6
-
7
- Core features:
8
-
9
- - Adds a `redirects` collection to your config that:
10
- - includes a `from` and `to` fields
11
- - allows `to` to be a document reference
12
-
13
- ## Installation
14
-
15
- ```bash
16
- yarn add @payloadcms/plugin-redirects
17
- # OR
18
- npm i @payloadcms/plugin-redirects
19
- ```
20
-
21
- ## Basic Usage
22
-
23
- In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
24
-
25
- ```js
26
- import { buildConfig } from "payload/config";
27
- import redirects from "@payloadcms/plugin-redirects";
28
-
29
- const config = buildConfig({
30
- collections: [
31
- {
32
- slug: "pages",
33
- fields: [],
34
- },
35
- ],
36
- plugins: [
37
- redirects({
38
- collections: ["pages"],
39
- }),
40
- ],
41
- });
42
-
43
- export default config;
44
- ```
45
-
46
- ### Options
47
-
48
- - `collections` : string[] | optional
49
-
50
- An array of collections slugs to populate in the `to` field of each redirect.
51
-
52
- - `overrides` : object | optional
53
-
54
- A partial collection config that allows you to override anything on the `redirects` collection.
55
-
56
- ## TypeScript
57
-
58
- All types can be directly imported:
59
-
60
- ```js
61
- import { PluginConfig } from "@payloadcms/plugin-redirects/types";
62
- ```
63
-
64
- ## Development
65
-
66
- To actively develop or debug this plugin you can either work directly within the demo directory of this repo, or link your own project.
67
-
68
- 1. #### Internal Demo
69
-
70
- This repo includes a fully working, self-seeding instance of Payload that installs the plugin directly from the source code. This is the easiest way to get started. To spin up this demo, follow these steps:
71
-
72
- 1. First clone the repo
73
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn && cd demo && yarn && yarn dev`
74
- 1. Now open `http://localhost:3000/admin` in your browser
75
- 1. Enter username `dev@payloadcms.com` and password `test`
76
-
77
- That's it! Changes made in `./src` will be reflected in your demo. Keep in mind that the demo database is automatically seeded on every startup, any changes you make to the data get destroyed each time you reboot the app.
78
-
79
- 1. #### Linked Project
80
-
81
- You can alternatively link your own project to the source code:
82
-
83
- 1. First clone the repo
84
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn && cd demo && cp env.example .env && yarn && yarn dev`
85
- 1. Now `cd` back into your own project and run, `yarn link @payloadcms/plugin-redirects`
86
- 1. If this plugin using React in any way, continue to the next step. Otherwise skip to step 7.
87
- 1. From your own project, `cd node_modules/react && yarn link && cd ../react-dom && yarn link && cd ../../`
88
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn link react react-dom`
89
-
90
- All set! You can now boot up your own project as normal, and your local copy of the plugin source code will be used. Keep in mind that changes to the source code require a rebuild, `yarn build`.
91
-
92
- ## Screenshots
5
+ - [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-redirects)
6
+ - [Documentation](https://payloadcms.com/docs/plugins/redirects)
7
+ - [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/redirects.mdx)
@@ -10,3 +10,4 @@ export declare function isObject(item: unknown): boolean;
10
10
  * @param ...sources
11
11
  */
12
12
  export default function deepMerge<T, R>(target: T, source: R): T;
13
+ //# sourceMappingURL=deepMerge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../src/deepMerge.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAE/C;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAiB/D"}
package/dist/deepMerge.js CHANGED
@@ -1,51 +1,37 @@
1
- "use strict";
2
1
  // @ts-nocheck
3
- var __assign = (this && this.__assign) || function () {
4
- __assign = Object.assign || function(t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
- t[p] = s[p];
9
- }
10
- return t;
11
- };
12
- return __assign.apply(this, arguments);
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.isObject = void 0;
16
2
  /**
17
3
  * Simple object check.
18
4
  * @param item
19
5
  * @returns {boolean}
20
- */
21
- function isObject(item) {
6
+ */ export function isObject(item) {
22
7
  return item && typeof item === 'object' && !Array.isArray(item);
23
8
  }
24
- exports.isObject = isObject;
25
9
  /**
26
10
  * Deep merge two objects.
27
11
  * @param target
28
12
  * @param ...sources
29
- */
30
- function deepMerge(target, source) {
31
- var output = __assign({}, target);
13
+ */ export default function deepMerge(target, source) {
14
+ const output = {
15
+ ...target
16
+ };
32
17
  if (isObject(target) && isObject(source)) {
33
- Object.keys(source).forEach(function (key) {
34
- var _a, _b;
18
+ Object.keys(source).forEach((key)=>{
35
19
  if (isObject(source[key])) {
36
20
  if (!(key in target)) {
37
- Object.assign(output, (_a = {}, _a[key] = source[key], _a));
38
- }
39
- else {
21
+ Object.assign(output, {
22
+ [key]: source[key]
23
+ });
24
+ } else {
40
25
  output[key] = deepMerge(target[key], source[key]);
41
26
  }
42
- }
43
- else {
44
- Object.assign(output, (_b = {}, _b[key] = source[key], _b));
27
+ } else {
28
+ Object.assign(output, {
29
+ [key]: source[key]
30
+ });
45
31
  }
46
32
  });
47
33
  }
48
34
  return output;
49
35
  }
50
- exports.default = deepMerge;
36
+
51
37
  //# sourceMappingURL=deepMerge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../src/deepMerge.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;AAEd;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,IAAa;IACpC,OAAO,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACjE,CAAC;AAFD,4BAEC;AAED;;;;GAIG;AACH,SAAwB,SAAS,CAAO,MAAS,EAAE,MAAS;IAC1D,IAAM,MAAM,gBAAQ,MAAM,CAAE,CAAA;IAC5B,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;QACxC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;;YAC7B,IAAI,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE;gBACzB,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE;oBACpB,MAAM,CAAC,MAAM,CAAC,MAAM,YAAI,GAAC,GAAG,IAAG,MAAM,CAAC,GAAG,CAAC,MAAG,CAAA;iBAC9C;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;iBAClD;aACF;iBAAM;gBACL,MAAM,CAAC,MAAM,CAAC,MAAM,YAAI,GAAC,GAAG,IAAG,MAAM,CAAC,GAAG,CAAC,MAAG,CAAA;aAC9C;QACH,CAAC,CAAC,CAAA;KACH;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAjBD,4BAiBC"}
1
+ {"version":3,"sources":["../src/deepMerge.ts"],"sourcesContent":["// @ts-nocheck\n\n/**\n * Simple object check.\n * @param item\n * @returns {boolean}\n */\nexport function isObject(item: unknown): boolean {\n return item && typeof item === 'object' && !Array.isArray(item)\n}\n\n/**\n * Deep merge two objects.\n * @param target\n * @param ...sources\n */\nexport default function deepMerge<T, R>(target: T, source: R): T {\n const output = { ...target }\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach((key) => {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, { [key]: source[key] })\n } else {\n output[key] = deepMerge(target[key], source[key])\n }\n } else {\n Object.assign(output, { [key]: source[key] })\n }\n })\n }\n\n return output\n}\n"],"names":["isObject","item","Array","isArray","deepMerge","target","source","output","Object","keys","forEach","key","assign"],"mappings":"AAAA,cAAc;AAEd;;;;CAIC,GACD,OAAO,SAASA,SAASC,IAAa;IACpC,OAAOA,QAAQ,OAAOA,SAAS,YAAY,CAACC,MAAMC,OAAO,CAACF;AAC5D;AAEA;;;;CAIC,GACD,eAAe,SAASG,UAAgBC,MAAS,EAAEC,MAAS;IAC1D,MAAMC,SAAS;QAAE,GAAGF,MAAM;IAAC;IAC3B,IAAIL,SAASK,WAAWL,SAASM,SAAS;QACxCE,OAAOC,IAAI,CAACH,QAAQI,OAAO,CAAC,CAACC;YAC3B,IAAIX,SAASM,MAAM,CAACK,IAAI,GAAG;gBACzB,IAAI,CAAEA,CAAAA,OAAON,MAAK,GAAI;oBACpBG,OAAOI,MAAM,CAACL,QAAQ;wBAAE,CAACI,IAAI,EAAEL,MAAM,CAACK,IAAI;oBAAC;gBAC7C,OAAO;oBACLJ,MAAM,CAACI,IAAI,GAAGP,UAAUC,MAAM,CAACM,IAAI,EAAEL,MAAM,CAACK,IAAI;gBAClD;YACF,OAAO;gBACLH,OAAOI,MAAM,CAACL,QAAQ;oBAAE,CAACI,IAAI,EAAEL,MAAM,CAACK,IAAI;gBAAC;YAC7C;QACF;IACF;IAEA,OAAOJ;AACT"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Config } from 'payload/config';
2
- import type { PluginConfig } from './types';
2
+ import type { PluginConfig } from './types.js';
3
3
  declare const redirects: (pluginConfig: PluginConfig) => (incomingConfig: Config) => Config;
4
4
  export default redirects;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAI9C,QAAA,MAAM,SAAS,iBACE,YAAY,sBACV,MAAM,KAAG,MAuExB,CAAA;AAEJ,eAAe,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -1,95 +1,77 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
- if (ar || !(i in from)) {
16
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
- ar[i] = from[i];
18
- }
19
- }
20
- return to.concat(ar || Array.prototype.slice.call(from));
21
- };
22
- var __importDefault = (this && this.__importDefault) || function (mod) {
23
- return (mod && mod.__esModule) ? mod : { "default": mod };
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- var deepMerge_1 = __importDefault(require("./deepMerge"));
27
- var redirects = function (pluginConfig) {
28
- return function (incomingConfig) { return (__assign(__assign({}, incomingConfig), { collections: __spreadArray(__spreadArray([], ((incomingConfig === null || incomingConfig === void 0 ? void 0 : incomingConfig.collections) || []), true), [
29
- (0, deepMerge_1.default)({
30
- slug: 'redirects',
31
- admin: {
32
- defaultColumns: ['from', 'to.type', 'createdAt'],
33
- },
34
- access: {
35
- read: function () { return true; },
36
- },
37
- fields: [
38
- {
39
- name: 'from',
40
- label: 'From URL',
41
- index: true,
42
- required: true,
43
- type: 'text',
1
+ import deepMerge from './deepMerge.js';
2
+ const redirects = (pluginConfig)=>(incomingConfig)=>({
3
+ ...incomingConfig,
4
+ collections: [
5
+ ...incomingConfig?.collections || [],
6
+ deepMerge({
7
+ slug: 'redirects',
8
+ access: {
9
+ read: ()=>true
44
10
  },
45
- {
46
- name: 'to',
47
- label: false,
48
- type: 'group',
49
- fields: [
50
- {
51
- name: 'type',
52
- label: 'To URL Type',
53
- type: 'radio',
54
- options: [
55
- {
56
- label: 'Internal link',
57
- value: 'reference',
58
- },
59
- {
60
- label: 'Custom URL',
61
- value: 'custom',
11
+ admin: {
12
+ defaultColumns: [
13
+ 'from',
14
+ 'to.type',
15
+ 'createdAt'
16
+ ]
17
+ },
18
+ fields: [
19
+ {
20
+ name: 'from',
21
+ type: 'text',
22
+ index: true,
23
+ label: 'From URL',
24
+ required: true
25
+ },
26
+ {
27
+ name: 'to',
28
+ type: 'group',
29
+ fields: [
30
+ {
31
+ name: 'type',
32
+ type: 'radio',
33
+ admin: {
34
+ layout: 'horizontal'
62
35
  },
63
- ],
64
- defaultValue: 'reference',
65
- admin: {
66
- layout: 'horizontal',
67
- },
68
- },
69
- {
70
- name: 'reference',
71
- label: 'Document to redirect to',
72
- type: 'relationship',
73
- relationTo: (pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.collections) || [],
74
- required: true,
75
- admin: {
76
- condition: function (_, siblingData) { return (siblingData === null || siblingData === void 0 ? void 0 : siblingData.type) === 'reference'; },
36
+ defaultValue: 'reference',
37
+ label: 'To URL Type',
38
+ options: [
39
+ {
40
+ label: 'Internal link',
41
+ value: 'reference'
42
+ },
43
+ {
44
+ label: 'Custom URL',
45
+ value: 'custom'
46
+ }
47
+ ]
77
48
  },
78
- },
79
- {
80
- name: 'url',
81
- label: 'Custom URL',
82
- type: 'text',
83
- required: true,
84
- admin: {
85
- condition: function (_, siblingData) { return (siblingData === null || siblingData === void 0 ? void 0 : siblingData.type) === 'custom'; },
49
+ {
50
+ name: 'reference',
51
+ type: 'relationship',
52
+ admin: {
53
+ condition: (_, siblingData)=>siblingData?.type === 'reference'
54
+ },
55
+ label: 'Document to redirect to',
56
+ relationTo: pluginConfig?.collections || [],
57
+ required: true
86
58
  },
87
- },
88
- ],
89
- },
90
- ],
91
- }, (pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.overrides) || {}),
92
- ], false) })); };
93
- };
94
- exports.default = redirects;
59
+ {
60
+ name: 'url',
61
+ type: 'text',
62
+ admin: {
63
+ condition: (_, siblingData)=>siblingData?.type === 'custom'
64
+ },
65
+ label: 'Custom URL',
66
+ required: true
67
+ }
68
+ ],
69
+ label: false
70
+ }
71
+ ]
72
+ }, pluginConfig?.overrides || {})
73
+ ]
74
+ });
75
+ export default redirects;
76
+
95
77
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,0DAAmC;AAGnC,IAAM,SAAS,GACb,UAAC,YAA0B;IAC3B,OAAA,UAAC,cAAsB,IAAa,OAAA,uBAC/B,cAAc,KACjB,WAAW,kCACN,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,WAAW,KAAI,EAAE,CAAC;YACtC,IAAA,mBAAS,EACP;gBACE,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE;oBACL,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,CAAC;iBACjD;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,cAAe,OAAA,IAAI,EAAJ,CAAI;iBAC1B;gBACD,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,UAAU;wBACjB,KAAK,EAAE,IAAI;wBACX,QAAQ,EAAE,IAAI;wBACd,IAAI,EAAE,MAAM;qBACb;oBACD;wBACE,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,KAAK;wBACZ,IAAI,EAAE,OAAO;wBACb,MAAM,EAAE;4BACN;gCACE,IAAI,EAAE,MAAM;gCACZ,KAAK,EAAE,aAAa;gCACpB,IAAI,EAAE,OAAO;gCACb,OAAO,EAAE;oCACP;wCACE,KAAK,EAAE,eAAe;wCACtB,KAAK,EAAE,WAAW;qCACnB;oCACD;wCACE,KAAK,EAAE,YAAY;wCACnB,KAAK,EAAE,QAAQ;qCAChB;iCACF;gCACD,YAAY,EAAE,WAAW;gCACzB,KAAK,EAAE;oCACL,MAAM,EAAE,YAAY;iCACrB;6BACF;4BACD;gCACE,IAAI,EAAE,WAAW;gCACjB,KAAK,EAAE,yBAAyB;gCAChC,IAAI,EAAE,cAAc;gCACpB,UAAU,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,KAAI,EAAE;gCAC3C,QAAQ,EAAE,IAAI;gCACd,KAAK,EAAE;oCACL,SAAS,EAAE,UAAC,CAAC,EAAE,WAAW,IAAK,OAAA,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,WAAW,EAAjC,CAAiC;iCACjE;6BACF;4BACD;gCACE,IAAI,EAAE,KAAK;gCACX,KAAK,EAAE,YAAY;gCACnB,IAAI,EAAE,MAAM;gCACZ,QAAQ,EAAE,IAAI;gCACd,KAAK,EAAE;oCACL,SAAS,EAAE,UAAC,CAAC,EAAE,WAAW,IAAK,OAAA,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,QAAQ,EAA9B,CAA8B;iCAC9D;6BACF;yBACF;qBACF;iBACF;aACF,EACD,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,KAAI,EAAE,CAC9B;qBAEH,EAvEkC,CAuElC;AAvEF,CAuEE,CAAA;AAEJ,kBAAe,SAAS,CAAA"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload/config'\n\nimport type { PluginConfig } from './types.js'\n\nimport deepMerge from './deepMerge.js'\n\nconst redirects =\n (pluginConfig: PluginConfig) =>\n (incomingConfig: Config): Config => ({\n ...incomingConfig,\n collections: [\n ...(incomingConfig?.collections || []),\n deepMerge(\n {\n slug: 'redirects',\n access: {\n read: (): boolean => true,\n },\n admin: {\n defaultColumns: ['from', 'to.type', 'createdAt'],\n },\n fields: [\n {\n name: 'from',\n type: 'text',\n index: true,\n label: 'From URL',\n required: true,\n },\n {\n name: 'to',\n type: 'group',\n fields: [\n {\n name: 'type',\n type: 'radio',\n admin: {\n layout: 'horizontal',\n },\n defaultValue: 'reference',\n label: 'To URL Type',\n options: [\n {\n label: 'Internal link',\n value: 'reference',\n },\n {\n label: 'Custom URL',\n value: 'custom',\n },\n ],\n },\n {\n name: 'reference',\n type: 'relationship',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'reference',\n },\n label: 'Document to redirect to',\n relationTo: pluginConfig?.collections || [],\n required: true,\n },\n {\n name: 'url',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'custom',\n },\n label: 'Custom URL',\n required: true,\n },\n ],\n label: false,\n },\n ],\n },\n pluginConfig?.overrides || {},\n ),\n ],\n })\n\nexport default redirects\n"],"names":["deepMerge","redirects","pluginConfig","incomingConfig","collections","slug","access","read","admin","defaultColumns","fields","name","type","index","label","required","layout","defaultValue","options","value","condition","_","siblingData","relationTo","overrides"],"mappings":"AAIA,OAAOA,eAAe,iBAAgB;AAEtC,MAAMC,YACJ,CAACC,eACD,CAACC,iBAAoC,CAAA;YACnC,GAAGA,cAAc;YACjBC,aAAa;mBACPD,gBAAgBC,eAAe,EAAE;gBACrCJ,UACE;oBACEK,MAAM;oBACNC,QAAQ;wBACNC,MAAM,IAAe;oBACvB;oBACAC,OAAO;wBACLC,gBAAgB;4BAAC;4BAAQ;4BAAW;yBAAY;oBAClD;oBACAC,QAAQ;wBACN;4BACEC,MAAM;4BACNC,MAAM;4BACNC,OAAO;4BACPC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNC,MAAM;4BACNF,QAAQ;gCACN;oCACEC,MAAM;oCACNC,MAAM;oCACNJ,OAAO;wCACLQ,QAAQ;oCACV;oCACAC,cAAc;oCACdH,OAAO;oCACPI,SAAS;wCACP;4CACEJ,OAAO;4CACPK,OAAO;wCACT;wCACA;4CACEL,OAAO;4CACPK,OAAO;wCACT;qCACD;gCACH;gCACA;oCACER,MAAM;oCACNC,MAAM;oCACNJ,OAAO;wCACLY,WAAW,CAACC,GAAGC,cAAgBA,aAAaV,SAAS;oCACvD;oCACAE,OAAO;oCACPS,YAAYrB,cAAcE,eAAe,EAAE;oCAC3CW,UAAU;gCACZ;gCACA;oCACEJ,MAAM;oCACNC,MAAM;oCACNJ,OAAO;wCACLY,WAAW,CAACC,GAAGC,cAAgBA,aAAaV,SAAS;oCACvD;oCACAE,OAAO;oCACPC,UAAU;gCACZ;6BACD;4BACDD,OAAO;wBACT;qBACD;gBACH,GACAZ,cAAcsB,aAAa,CAAC;aAE/B;QACH,CAAA;AAEF,eAAevB,UAAS"}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { CollectionConfig } from 'payload/types';
2
2
  export interface PluginConfig {
3
- overrides?: Partial<CollectionConfig>;
4
3
  collections?: string[];
4
+ overrides?: Partial<CollectionConfig>;
5
5
  }
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;CACtC"}
package/dist/types.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export { };
2
+
3
3
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload/types'\n\nexport interface PluginConfig {\n collections?: string[]\n overrides?: Partial<CollectionConfig>\n}\n"],"names":[],"mappings":"AAEA,WAGC"}
package/package.json CHANGED
@@ -1,19 +1,12 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-redirects",
3
- "version": "1.0.1",
3
+ "version": "3.0.0-alpha.42",
4
4
  "homepage:": "https://payloadcms.com",
5
5
  "repository": "git@github.com:payloadcms/plugin-redirects.git",
6
6
  "description": "Redirects plugin for Payload",
7
- "main": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "scripts": {
10
- "build": "tsc",
11
- "test": "echo \"Error: no test specified\" && exit 1",
12
- "lint": "eslint src",
13
- "lint:fix": "eslint --fix --ext .ts,.tsx src",
14
- "clean": "rimraf dist",
15
- "prepublishOnly": "yarn clean && yarn build"
16
- },
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "type": "module",
17
10
  "keywords": [
18
11
  "payload",
19
12
  "cms",
@@ -26,36 +19,29 @@
26
19
  "author": "dev@payloadcms.com",
27
20
  "license": "MIT",
28
21
  "peerDependencies": {
29
- "payload": "^0.18.5 || ^1.0.0 || ^2.0.0"
22
+ "payload": "3.0.0-alpha.42"
30
23
  },
31
24
  "devDependencies": {
32
- "@payloadcms/eslint-config": "^0.0.1",
33
- "@types/escape-html": "^1.0.1",
34
25
  "@types/express": "^4.17.9",
35
- "@types/node": "18.11.3",
36
26
  "@types/react": "18.0.21",
37
- "@typescript-eslint/eslint-plugin": "^5.51.0",
38
- "@typescript-eslint/parser": "^5.51.0",
39
- "copyfiles": "^2.4.1",
40
- "cross-env": "^7.0.3",
41
- "eslint": "^8.19.0",
42
- "eslint-config-prettier": "^8.5.0",
43
- "eslint-plugin-filenames": "^1.3.2",
44
- "eslint-plugin-import": "2.25.4",
45
- "eslint-plugin-prettier": "^4.0.0",
46
- "eslint-plugin-react-hooks": "^4.6.0",
47
- "eslint-plugin-simple-import-sort": "^10.0.0",
48
- "nodemon": "^2.0.6",
49
- "payload": "^1.8.2",
50
- "prettier": "^2.7.1",
51
27
  "react": "^18.0.0",
52
- "rimraf": "^5.0.5",
53
- "ts-node": "^9.1.1",
54
- "typescript": "^4.8.4"
28
+ "@payloadcms/eslint-config": "1.1.1",
29
+ "payload": "3.0.0-alpha.42"
30
+ },
31
+ "exports": null,
32
+ "publishConfig": {
33
+ "registry": "https://registry.npmjs.org/"
55
34
  },
56
35
  "files": [
57
36
  "dist",
58
37
  "types.js",
59
38
  "types.d.ts"
60
- ]
61
- }
39
+ ],
40
+ "scripts": {
41
+ "build": "pnpm copyfiles && pnpm build:swc && pnpm build:types",
42
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc",
43
+ "build:types": "tsc --emitDeclarationOnly --outDir dist",
44
+ "clean": "rimraf {dist,*.tsbuildinfo}",
45
+ "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/"
46
+ }
47
+ }
package/types.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/types';
1
+ export * from './dist/types'
package/types.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/types');
1
+ module.exports = require('./dist/types')