@payloadcms/plugin-redirects 1.0.1 → 1.0.2

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,55 @@
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) {
22
- return item && typeof item === 'object' && !Array.isArray(item);
6
+ */ "use strict";
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ function _export(target, all) {
11
+ for(var name in all)Object.defineProperty(target, name, {
12
+ enumerable: true,
13
+ get: all[name]
14
+ });
23
15
  }
24
- exports.isObject = isObject;
25
- /**
16
+ _export(exports, {
17
+ /**
26
18
  * Deep merge two objects.
27
19
  * @param target
28
20
  * @param ...sources
29
- */
21
+ */ default: function() {
22
+ return deepMerge;
23
+ },
24
+ isObject: function() {
25
+ return isObject;
26
+ }
27
+ });
28
+ function isObject(item) {
29
+ return item && typeof item === 'object' && !Array.isArray(item);
30
+ }
30
31
  function deepMerge(target, source) {
31
- var output = __assign({}, target);
32
+ const output = {
33
+ ...target
34
+ };
32
35
  if (isObject(target) && isObject(source)) {
33
- Object.keys(source).forEach(function (key) {
34
- var _a, _b;
36
+ Object.keys(source).forEach((key)=>{
35
37
  if (isObject(source[key])) {
36
38
  if (!(key in target)) {
37
- Object.assign(output, (_a = {}, _a[key] = source[key], _a));
38
- }
39
- else {
39
+ Object.assign(output, {
40
+ [key]: source[key]
41
+ });
42
+ } else {
40
43
  output[key] = deepMerge(target[key], source[key]);
41
44
  }
42
- }
43
- else {
44
- Object.assign(output, (_b = {}, _b[key] = source[key], _b));
45
+ } else {
46
+ Object.assign(output, {
47
+ [key]: source[key]
48
+ });
45
49
  }
46
50
  });
47
51
  }
48
52
  return output;
49
53
  }
50
- exports.default = deepMerge;
51
- //# sourceMappingURL=deepMerge.js.map
54
+
55
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWVwTWVyZ2UudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gQHRzLW5vY2hlY2tcblxuLyoqXG4gKiBTaW1wbGUgb2JqZWN0IGNoZWNrLlxuICogQHBhcmFtIGl0ZW1cbiAqIEByZXR1cm5zIHtib29sZWFufVxuICovXG5leHBvcnQgZnVuY3Rpb24gaXNPYmplY3QoaXRlbTogdW5rbm93bik6IGJvb2xlYW4ge1xuICByZXR1cm4gaXRlbSAmJiB0eXBlb2YgaXRlbSA9PT0gJ29iamVjdCcgJiYgIUFycmF5LmlzQXJyYXkoaXRlbSlcbn1cblxuLyoqXG4gKiBEZWVwIG1lcmdlIHR3byBvYmplY3RzLlxuICogQHBhcmFtIHRhcmdldFxuICogQHBhcmFtIC4uLnNvdXJjZXNcbiAqL1xuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gZGVlcE1lcmdlPFQsIFI+KHRhcmdldDogVCwgc291cmNlOiBSKTogVCB7XG4gIGNvbnN0IG91dHB1dCA9IHsgLi4udGFyZ2V0IH1cbiAgaWYgKGlzT2JqZWN0KHRhcmdldCkgJiYgaXNPYmplY3Qoc291cmNlKSkge1xuICAgIE9iamVjdC5rZXlzKHNvdXJjZSkuZm9yRWFjaCgoa2V5KSA9PiB7XG4gICAgICBpZiAoaXNPYmplY3Qoc291cmNlW2tleV0pKSB7XG4gICAgICAgIGlmICghKGtleSBpbiB0YXJnZXQpKSB7XG4gICAgICAgICAgT2JqZWN0LmFzc2lnbihvdXRwdXQsIHsgW2tleV06IHNvdXJjZVtrZ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FJLEVBQUVMLE1BQU0sQ0FBQ0ssSUFBSTtvQkFBQztnQkFDN0MsT0FBTztvQkFDTEosTUFBTSxDQUFDSSxJQUFJLEdBQUdYLFVBQVVLLE1BQU0sQ0FBQ00sSUFBSSxFQUFFTCxNQUFNLENBQUNLLElBQUk7Z0JBQ2xEO1lBQ0YsT0FBTztnQkFDTEgsT0FBT0ksTUFBTSxDQUFDTCxRQUFRO29CQUFFLENBQUNJLElBQUksRUFBRUwsTUFBTSxDQUFDSyxJQUFJO2dCQUFDO1lBQzdDO1FBQ0Y7SUFDRjtJQUVBLE9BQU9KO0FBQ1QifQ==
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ import type { Config } from 'payload/config';
2
2
  import type { PluginConfig } from './types';
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,SAAS,CAAA;AAI3C,QAAA,MAAM,SAAS,iBACE,YAAY,sBACV,MAAM,KAAG,MAuExB,CAAA;AAEJ,eAAe,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -1,95 +1,92 @@
1
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
- }
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
19
9
  }
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',
10
+ });
11
+ const _deepMerge = /*#__PURE__*/ _interop_require_default(require("./deepMerge"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
17
+ const redirects = (pluginConfig)=>(incomingConfig)=>({
18
+ ...incomingConfig,
19
+ collections: [
20
+ ...incomingConfig?.collections || [],
21
+ (0, _deepMerge.default)({
22
+ access: {
23
+ read: ()=>true
44
24
  },
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',
25
+ admin: {
26
+ defaultColumns: [
27
+ 'from',
28
+ 'to.type',
29
+ 'createdAt'
30
+ ]
31
+ },
32
+ fields: [
33
+ {
34
+ name: 'from',
35
+ index: true,
36
+ label: 'From URL',
37
+ required: true,
38
+ type: 'text'
39
+ },
40
+ {
41
+ name: 'to',
42
+ fields: [
43
+ {
44
+ name: 'type',
45
+ admin: {
46
+ layout: 'horizontal'
62
47
  },
63
- ],
64
- defaultValue: 'reference',
65
- admin: {
66
- layout: 'horizontal',
48
+ defaultValue: 'reference',
49
+ label: 'To URL Type',
50
+ options: [
51
+ {
52
+ label: 'Internal link',
53
+ value: 'reference'
54
+ },
55
+ {
56
+ label: 'Custom URL',
57
+ value: 'custom'
58
+ }
59
+ ],
60
+ type: 'radio'
67
61
  },
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'; },
77
- },
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'; },
62
+ {
63
+ name: 'reference',
64
+ admin: {
65
+ condition: (_, siblingData)=>siblingData?.type === 'reference'
66
+ },
67
+ label: 'Document to redirect to',
68
+ relationTo: pluginConfig?.collections || [],
69
+ required: true,
70
+ type: 'relationship'
86
71
  },
87
- },
88
- ],
89
- },
90
- ],
91
- }, (pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.overrides) || {}),
92
- ], false) })); };
93
- };
94
- exports.default = redirects;
95
- //# sourceMappingURL=index.js.map
72
+ {
73
+ name: 'url',
74
+ admin: {
75
+ condition: (_, siblingData)=>siblingData?.type === 'custom'
76
+ },
77
+ label: 'Custom URL',
78
+ required: true,
79
+ type: 'text'
80
+ }
81
+ ],
82
+ label: false,
83
+ type: 'group'
84
+ }
85
+ ],
86
+ slug: 'redirects'
87
+ }, pluginConfig?.overrides || {})
88
+ ]
89
+ });
90
+ const _default = redirects;
91
+
92
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IENvbmZpZyB9IGZyb20gJ3BheWxvYWQvY29uZmlnJ1xuXG5pbXBvcnQgdHlwZSB7IFBsdWdpbkNvbmZpZyB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCBkZWVwTWVyZ2UgZnJvbSAnLi9kZWVwTWVyZ2UnXG5cbmNvbnN0IHJlZGlyZWN0cyA9XG4gIChwbHVnaW5Db25maWc6IFBsdWdpbkNvbmZpZykgPT5cbiAgKGluY29taW5nQ29uZmlnOiBDb25maWcpOiBDb25maWcgPT4gKHtcbiAgICAuLi5pbmNvbWluZ0NvbmZpZyxcbiAgICBjb2xsZWN0aW9uczogW1xuICAgICAgLi4uKGluY29taW5nQ29uZmlnPy5jb2xsZWN0aW9ucyB8fCBbXSksXG4gICAgICBkZWVwTWVyZ2UoXG4gICAgICAgIHtcbiAgICAgICAgICBhY2Nlc3M6IHtcbiAgICAgICAgICAgIHJlYWQ6ICgpOiBib29sZWFuID0+IHRydWUsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBhZG1pbjoge1xuICAgICAgICAgICAgZGVmYXVsdENvbHVtbnM6IFsnZnJvbScsICd0by50eXBlJywgJ2NyZWF0ZWRBdCddLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgZmllbGRzOiBbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIG5hbWU6ICdmcm9tJyxcbiAgICAgICAgICAgICAgaW5kZXg6IHRydWUsXG4gICAgICAgICAgICAgIGxhYmVsOiAnRnJvbSBVUkwnLFxuICAgICAgICAgICAgICByZXF1aXJlZDogdHJ1ZSxcbiAgICAgICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgbmFtZTogJ3RvJyxcbiAgICAgICAgICAgICAgZmllbGRzOiBbXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgbmFtZTogJ3R5cGUnLFxuICAgICAgICAgICAgICAgICAgYWRtaW46IHtcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0OiAnaG9yaXpvbnRhbCcsXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiAncmVmZXJlbmNlJyxcbiAgICAgICAgICAgICAgICAgIGxhYmVsOiAnVG8gVVJMIFR5cGUnLFxuICAgICAgICAgICAgICAgICAgb3B0aW9uczogW1xuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgbGFiZWw6ICdJbnRlcm5hbCBsaW5rJyxcbiAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogJ3JlZmVyZW5jZScsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogJ0N1c3RvbSBVUkwnLFxuICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiAnY3VzdG9tJyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICB0eXBlOiAncmFkaW8nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgbmFtZTogJ3JlZmVyZW5jZScsXG4gICAgICAgICAgICAgICAgICBhZG1pbjoge1xuICAgICAgICAgICAgICAgICAgICBjb25kaXRpb246IChfLCBzaWJsaW5nRGF0YSkgPT4gc2libGluZ0RhdGE/LnR5cGUgPT09ICdyZWZlcmVuY2UnLFxuICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIGxhYmVsOiAnRG9jdW1lbnQgdG8gcmVkaXJlY3QgdG8nLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25UbzogcGx1Z2luQ29uZmlnPy5jb2xsZWN0aW9ucyB8fCBbXSxcbiAgICAgICAgICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgdHlwZTogJ3JlbGF0aW9uc2hpcCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICBuYW1lOiAndXJsJyxcbiAgICAgICAgICAgICAgICAgIGFkbWluOiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmRpdGlvbjogKF8sIHNpYmxpbmdEYXRhKSA9PiBzaWJsaW5nRGF0YT8udHlwZSA9PT0gJ2N1c3RvbScsXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgbGFiZWw6ICdDdXN0b20gVVJMJyxcbiAgICAgICAgICAgICAgICAgIHJlcXVpcmVkOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgIGxhYmVsOiBmYWxzZSxcbiAgICAgICAgICAgICAgdHlwZTogJ2dyb3VwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgXSxcbiAgICAgICAgICBzbHVnOiAncmVkaXJlY3RzJyxcbiAgICAgICAgfSxcbiAgICAgICAgcGx1Z2luQ29uZmlnPy5vdmVycmlkZXMgfHwge30sXG4gICAgICApLFxuICAgIF0sXG4gIH0pXG5cbmV4cG9ydCBkZWZhdWx0IHJlZGlyZWN0c1xuIl0sIm5hbWVzIjpbInJlZGlyZWN0cyIsInBsdWdpbkNvbmZpZyIsImluY29taW5nQ29uZmlnIiwiY29sbGVjdGlvbnMiLCJkZWVwTWVyZ2UiLCJhY2Nlc3MiLCJyZWFkIiwiYWRtaW4iLCJkZWZhdW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xTQUFTO29DQUN2RDtvQ0FDQUYsT0FBTztvQ0FDUFUsWUFBWXJCLGNBQWNFLGVBQWUsRUFBRTtvQ0FDM0NVLFVBQVU7b0NBQ1ZDLE1BQU07Z0NBQ1I7Z0NBQ0E7b0NBQ0VKLE1BQU07b0NBQ05ILE9BQU87d0NBQ0xZLFdBQVcsQ0FBQ0MsR0FBR0MsY0FBZ0JBLGFBQWFQLFNBQVM7b0NBQ3ZEO29DQUNBRixPQUFPO29DQUNQQyxVQUFVO29DQUNWQyxNQUFNO2dDQUNSOzZCQUNEOzRCQUNERixPQUFPOzRCQUNQRSxNQUFNO3dCQUNSO3FCQUNEO29CQUNEUyxNQUFNO2dCQUNSLEdBQ0F0QixjQUFjdUIsYUFBYSxDQUFDO2FBRS9CO1FBQ0gsQ0FBQTtNQUVGLFdBQWV4QiJ9
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,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
package/package.json CHANGED
@@ -1,19 +1,15 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-redirects",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "homepage:": "https://payloadcms.com",
5
- "repository": "git@github.com:payloadcms/plugin-redirects.git",
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"
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/payloadcms/payload.git",
8
+ "directory": "packages/plugin-redirects"
16
9
  },
10
+ "description": "Redirects plugin for Payload",
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
17
13
  "keywords": [
18
14
  "payload",
19
15
  "cms",
@@ -26,36 +22,29 @@
26
22
  "author": "dev@payloadcms.com",
27
23
  "license": "MIT",
28
24
  "peerDependencies": {
29
- "payload": "^0.18.5 || ^1.0.0 || ^2.0.0"
25
+ "payload": "^0.18.5 || ^1.0.0 || ^2.0.0",
26
+ "react": "^18.0.0"
30
27
  },
31
28
  "devDependencies": {
32
- "@payloadcms/eslint-config": "^0.0.1",
33
- "@types/escape-html": "^1.0.1",
34
29
  "@types/express": "^4.17.9",
35
- "@types/node": "18.11.3",
36
30
  "@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
- "react": "^18.0.0",
52
- "rimraf": "^5.0.5",
53
- "ts-node": "^9.1.1",
54
- "typescript": "^4.8.4"
31
+ "@payloadcms/eslint-config": "1.1.1",
32
+ "payload": "2.14.2"
33
+ },
34
+ "exports": null,
35
+ "publishConfig": {
36
+ "registry": "https://registry.npmjs.org/"
55
37
  },
56
38
  "files": [
57
39
  "dist",
58
40
  "types.js",
59
41
  "types.d.ts"
60
- ]
61
- }
42
+ ],
43
+ "scripts": {
44
+ "build": "pnpm copyfiles && pnpm build:swc && pnpm build:types",
45
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc",
46
+ "build:types": "tsc --emitDeclarationOnly --outDir dist",
47
+ "clean": "rimraf {dist,*.tsbuildinfo}",
48
+ "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/"
49
+ }
50
+ }
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')
@@ -1 +0,0 @@
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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C,CAuElC;AAvEF,CAuEE,CAAA;AAEJ,kBAAe,SAAS,CAAA"}
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}