@payloadcms/plugin-redirects 1.0.0 → 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 +4 -89
- package/dist/deepMerge.d.ts +1 -0
- package/dist/deepMerge.d.ts.map +1 -0
- package/dist/deepMerge.js +16 -30
- package/dist/deepMerge.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +69 -89
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +5 -4
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/package.json +24 -13
- package/types.d.ts +1 -1
- package/types.js +1 -1
package/README.md
CHANGED
|
@@ -1,92 +1,7 @@
|
|
|
1
1
|
# Payload Redirects Plugin
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
A plugin for [Payload](https://github.com/payloadcms/payload) to easily manage your redirects from within your admin panel.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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)
|
package/dist/deepMerge.d.ts
CHANGED
|
@@ -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
|
-
|
|
22
|
-
return (item && typeof item === 'object' && !Array.isArray(item));
|
|
6
|
+
*/ export function isObject(item) {
|
|
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
|
-
|
|
31
|
-
|
|
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(
|
|
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,
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
Object.assign(output, {
|
|
22
|
+
[key]: source[key]
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
40
25
|
output[key] = deepMerge(target[key], source[key]);
|
|
41
26
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
} else {
|
|
28
|
+
Object.assign(output, {
|
|
29
|
+
[key]: source[key]
|
|
30
|
+
});
|
|
45
31
|
}
|
|
46
32
|
});
|
|
47
33
|
}
|
|
48
34
|
return output;
|
|
49
35
|
}
|
|
50
|
-
|
|
36
|
+
|
|
51
37
|
//# sourceMappingURL=deepMerge.js.map
|
package/dist/deepMerge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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
|
-
import { Config } from 'payload/config';
|
|
2
|
-
import { PluginConfig } from './types';
|
|
1
|
+
import type { Config } from 'payload/config';
|
|
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,97 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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) { return function (incomingConfig) { return (__assign(__assign({}, incomingConfig), { collections: __spreadArray(__spreadArray([], (incomingConfig === null || incomingConfig === void 0 ? void 0 : incomingConfig.collections) || [], true), [
|
|
28
|
-
(0, deepMerge_1.default)({
|
|
29
|
-
slug: 'redirects',
|
|
30
|
-
admin: {
|
|
31
|
-
defaultColumns: [
|
|
32
|
-
'from',
|
|
33
|
-
'to.type',
|
|
34
|
-
'createdAt',
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
access: {
|
|
38
|
-
read: function () { return true; },
|
|
39
|
-
},
|
|
40
|
-
fields: [
|
|
41
|
-
{
|
|
42
|
-
name: 'from',
|
|
43
|
-
label: 'From URL',
|
|
44
|
-
index: true,
|
|
45
|
-
required: true,
|
|
46
|
-
type: 'text',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'to',
|
|
50
|
-
label: false,
|
|
51
|
-
type: 'group',
|
|
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
|
|
10
|
+
},
|
|
11
|
+
admin: {
|
|
12
|
+
defaultColumns: [
|
|
13
|
+
'from',
|
|
14
|
+
'to.type',
|
|
15
|
+
'createdAt'
|
|
16
|
+
]
|
|
17
|
+
},
|
|
52
18
|
fields: [
|
|
53
19
|
{
|
|
54
|
-
name: '
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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: [
|
|
58
30
|
{
|
|
59
|
-
|
|
60
|
-
|
|
31
|
+
name: 'type',
|
|
32
|
+
type: 'radio',
|
|
33
|
+
admin: {
|
|
34
|
+
layout: 'horizontal'
|
|
35
|
+
},
|
|
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
|
+
]
|
|
61
48
|
},
|
|
62
49
|
{
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
65
58
|
},
|
|
59
|
+
{
|
|
60
|
+
name: 'url',
|
|
61
|
+
type: 'text',
|
|
62
|
+
admin: {
|
|
63
|
+
condition: (_, siblingData)=>siblingData?.type === 'custom'
|
|
64
|
+
},
|
|
65
|
+
label: 'Custom URL',
|
|
66
|
+
required: true
|
|
67
|
+
}
|
|
66
68
|
],
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
type: 'relationship',
|
|
76
|
-
relationTo: (pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.collections) || [],
|
|
77
|
-
required: true,
|
|
78
|
-
admin: {
|
|
79
|
-
condition: function (_, siblingData) { return (siblingData === null || siblingData === void 0 ? void 0 : siblingData.type) === 'reference'; },
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'url',
|
|
84
|
-
label: 'Custom URL',
|
|
85
|
-
type: 'text',
|
|
86
|
-
required: true,
|
|
87
|
-
admin: {
|
|
88
|
-
condition: function (_, siblingData) { return (siblingData === null || siblingData === void 0 ? void 0 : siblingData.type) === 'custom'; },
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
}, (pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.overrides) || {}),
|
|
95
|
-
], false) })); }; };
|
|
96
|
-
exports.default = redirects;
|
|
69
|
+
label: false
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}, pluginConfig?.overrides || {})
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
export default redirects;
|
|
76
|
+
|
|
97
77
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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
|
-
import { CollectionConfig } from
|
|
2
|
-
export
|
|
3
|
-
overrides?: Partial<CollectionConfig>;
|
|
1
|
+
import type { CollectionConfig } from 'payload/types';
|
|
2
|
+
export interface PluginConfig {
|
|
4
3
|
collections?: string[];
|
|
5
|
-
|
|
4
|
+
overrides?: Partial<CollectionConfig>;
|
|
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
|
-
|
|
2
|
-
|
|
1
|
+
export { };
|
|
2
|
+
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-redirects",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.42",
|
|
4
4
|
"homepage:": "https://payloadcms.com",
|
|
5
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
|
-
"
|
|
10
|
-
"build": "tsc",
|
|
11
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
-
},
|
|
6
|
+
"description": "Redirects plugin for Payload",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
13
10
|
"keywords": [
|
|
14
11
|
"payload",
|
|
15
12
|
"cms",
|
|
@@ -22,15 +19,29 @@
|
|
|
22
19
|
"author": "dev@payloadcms.com",
|
|
23
20
|
"license": "MIT",
|
|
24
21
|
"peerDependencies": {
|
|
25
|
-
"payload": "
|
|
22
|
+
"payload": "3.0.0-alpha.42"
|
|
26
23
|
},
|
|
27
24
|
"devDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
25
|
+
"@types/express": "^4.17.9",
|
|
26
|
+
"@types/react": "18.0.21",
|
|
27
|
+
"react": "^18.0.0",
|
|
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/"
|
|
30
34
|
},
|
|
31
35
|
"files": [
|
|
32
36
|
"dist",
|
|
33
37
|
"types.js",
|
|
34
38
|
"types.d.ts"
|
|
35
|
-
]
|
|
36
|
-
|
|
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')
|