create-payload-app 0.5.1 → 1.0.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +10 -53
- package/dist/lib/configure-payload-config.js +97 -142
- package/dist/lib/create-project.js +101 -174
- package/dist/lib/create-project.spec.js +148 -168
- package/dist/lib/generate-secret.js +12 -44
- package/dist/lib/packages.js +52 -32
- package/dist/lib/parse-project-name.js +29 -67
- package/dist/lib/parse-template.js +42 -80
- package/dist/lib/select-db.js +62 -105
- package/dist/lib/templates.js +63 -97
- package/dist/lib/write-env-file.js +51 -106
- package/dist/main.js +118 -198
- package/dist/types.js +5 -1
- package/dist/utils/log.js +40 -19
- package/dist/utils/messages.js +71 -73
- package/package.json +8 -39
- package/.vscode/launch.json +0 -13
@@ -1,188 +1,168 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
20
|
-
switch (op[0]) {
|
21
|
-
case 0: case 1: t = op; break;
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25
|
-
default:
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
30
|
-
if (t[2]) _.ops.pop();
|
31
|
-
_.trys.pop(); continue;
|
32
|
-
}
|
33
|
-
op = body.call(thisArg, _);
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
36
|
-
}
|
37
|
-
};
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
40
|
-
};
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
42
|
-
var fs_extra_1 = __importDefault(require("fs-extra"));
|
43
|
-
var path_1 = __importDefault(require("path"));
|
44
|
-
var create_project_1 = require("./create-project");
|
45
|
-
var packages_1 = require("./packages");
|
46
|
-
var projectDir = path_1.default.resolve(__dirname, './tmp');
|
47
|
-
describe('createProject', function () {
|
48
|
-
beforeAll(function () {
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
6
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
7
|
+
const _createproject = require("./create-project");
|
8
|
+
const _packages = require("./packages");
|
9
|
+
const _templates = require("./templates");
|
10
|
+
function _interop_require_default(obj) {
|
11
|
+
return obj && obj.__esModule ? obj : {
|
12
|
+
default: obj
|
13
|
+
};
|
14
|
+
}
|
15
|
+
const projectDir = _path.default.resolve(__dirname, './tmp');
|
16
|
+
describe('createProject', ()=>{
|
17
|
+
beforeAll(()=>{
|
49
18
|
console.log = jest.fn();
|
50
19
|
});
|
51
|
-
beforeEach(
|
52
|
-
if (
|
53
|
-
|
20
|
+
beforeEach(()=>{
|
21
|
+
if (_fsextra.default.existsSync(projectDir)) {
|
22
|
+
_fsextra.default.rmdirSync(projectDir, {
|
23
|
+
recursive: true
|
24
|
+
});
|
54
25
|
}
|
55
26
|
});
|
56
|
-
afterEach(
|
57
|
-
if (
|
58
|
-
|
27
|
+
afterEach(()=>{
|
28
|
+
if (_fsextra.default.existsSync(projectDir)) {
|
29
|
+
_fsextra.default.rmSync(projectDir, {
|
30
|
+
recursive: true
|
31
|
+
});
|
59
32
|
}
|
60
33
|
});
|
61
|
-
describe('#createProject',
|
34
|
+
describe('#createProject', ()=>{
|
62
35
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
63
|
-
|
64
|
-
_: [
|
36
|
+
const args = {
|
37
|
+
_: [
|
38
|
+
'project-name'
|
39
|
+
],
|
65
40
|
'--db': 'mongodb',
|
66
|
-
'--no-deps': true
|
41
|
+
'--no-deps': true
|
67
42
|
};
|
68
|
-
|
69
|
-
it('creates starter project',
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
projectName: projectName,
|
84
|
-
projectDir: projectDir,
|
85
|
-
template: template,
|
86
|
-
packageManager: packageManager,
|
87
|
-
})];
|
88
|
-
case 1:
|
89
|
-
_a.sent();
|
90
|
-
packageJsonPath = path_1.default.resolve(projectDir, 'package.json');
|
91
|
-
packageJson = fs_extra_1.default.readJsonSync(packageJsonPath);
|
92
|
-
// Check package name and description
|
93
|
-
expect(packageJson.name).toEqual(projectName);
|
94
|
-
return [2 /*return*/];
|
95
|
-
}
|
43
|
+
const packageManager = 'yarn';
|
44
|
+
it('creates starter project', async ()=>{
|
45
|
+
const projectName = 'starter-project';
|
46
|
+
const template = {
|
47
|
+
name: 'blank',
|
48
|
+
type: 'starter',
|
49
|
+
url: 'https://github.com/payloadcms/payload/templates/blank',
|
50
|
+
description: 'Blank Template'
|
51
|
+
};
|
52
|
+
await (0, _createproject.createProject)({
|
53
|
+
cliArgs: args,
|
54
|
+
projectName,
|
55
|
+
projectDir,
|
56
|
+
template,
|
57
|
+
packageManager
|
96
58
|
});
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
})];
|
117
|
-
case 1:
|
118
|
-
_a.sent();
|
119
|
-
packageJsonPath = path_1.default.resolve(projectDir, 'package.json');
|
120
|
-
packageJson = fs_extra_1.default.readJsonSync(packageJsonPath);
|
121
|
-
// Check package name and description
|
122
|
-
expect(packageJson.name).toEqual(projectName);
|
123
|
-
return [2 /*return*/];
|
124
|
-
}
|
59
|
+
const packageJsonPath = _path.default.resolve(projectDir, 'package.json');
|
60
|
+
const packageJson = _fsextra.default.readJsonSync(packageJsonPath);
|
61
|
+
// Check package name and description
|
62
|
+
expect(packageJson.name).toEqual(projectName);
|
63
|
+
});
|
64
|
+
it('creates plugin template', async ()=>{
|
65
|
+
const projectName = 'plugin';
|
66
|
+
const template = {
|
67
|
+
name: 'plugin',
|
68
|
+
type: 'plugin',
|
69
|
+
url: 'https://github.com/payloadcms/payload-plugin-template',
|
70
|
+
description: 'Template for creating a Payload plugin'
|
71
|
+
};
|
72
|
+
await (0, _createproject.createProject)({
|
73
|
+
cliArgs: args,
|
74
|
+
projectName,
|
75
|
+
projectDir,
|
76
|
+
template,
|
77
|
+
packageManager
|
125
78
|
});
|
126
|
-
|
127
|
-
|
79
|
+
const packageJsonPath = _path.default.resolve(projectDir, 'package.json');
|
80
|
+
const packageJson = _fsextra.default.readJsonSync(packageJsonPath);
|
81
|
+
// Check package name and description
|
82
|
+
expect(packageJson.name).toEqual(projectName);
|
83
|
+
});
|
84
|
+
describe('db adapters and bundlers', ()=>{
|
85
|
+
const templates = (0, _templates.getValidTemplates)();
|
128
86
|
it.each([
|
129
|
-
[
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
expect(content).not.toContain('// database-adapter-config-start');
|
172
|
-
expect(content).not.toContain('// database-adapter-config-end');
|
173
|
-
expect(content).toContain(dbReplacement.configReplacement.join('\n'));
|
174
|
-
expect(content).not.toContain('// bundler-config-import');
|
175
|
-
expect(content).toContain(bundlerReplacement.importReplacement);
|
176
|
-
expect(content).not.toContain('// bundler-config');
|
177
|
-
expect(content).toContain(bundlerReplacement.configReplacement);
|
178
|
-
return [2 /*return*/];
|
87
|
+
[
|
88
|
+
'blank',
|
89
|
+
'mongodb',
|
90
|
+
'webpack'
|
91
|
+
],
|
92
|
+
[
|
93
|
+
'blank',
|
94
|
+
'postgres',
|
95
|
+
'webpack'
|
96
|
+
],
|
97
|
+
[
|
98
|
+
'website',
|
99
|
+
'mongodb',
|
100
|
+
'webpack'
|
101
|
+
],
|
102
|
+
[
|
103
|
+
'website',
|
104
|
+
'postgres',
|
105
|
+
'webpack'
|
106
|
+
],
|
107
|
+
[
|
108
|
+
'ecommerce',
|
109
|
+
'mongodb',
|
110
|
+
'webpack'
|
111
|
+
],
|
112
|
+
[
|
113
|
+
'ecommerce',
|
114
|
+
'postgres',
|
115
|
+
'webpack'
|
116
|
+
]
|
117
|
+
])('update config and deps: %s, %s, %s', async (templateName, db, bundler)=>{
|
118
|
+
const projectName = 'starter-project';
|
119
|
+
const template = templates.find((t)=>t.name === templateName);
|
120
|
+
await (0, _createproject.createProject)({
|
121
|
+
cliArgs: args,
|
122
|
+
projectName,
|
123
|
+
projectDir,
|
124
|
+
template,
|
125
|
+
packageManager,
|
126
|
+
dbDetails: {
|
127
|
+
dbUri: `${db}://localhost:27017/create-project-test`,
|
128
|
+
type: db
|
179
129
|
}
|
180
130
|
});
|
181
|
-
|
131
|
+
const dbReplacement = _packages.dbPackages[db];
|
132
|
+
const bundlerReplacement = _packages.bundlerPackages[bundler];
|
133
|
+
const editorReplacement = _packages.editorPackages['slate'];
|
134
|
+
const packageJsonPath = _path.default.resolve(projectDir, 'package.json');
|
135
|
+
const packageJson = _fsextra.default.readJsonSync(packageJsonPath);
|
136
|
+
// Check deps
|
137
|
+
expect(packageJson.dependencies['payload']).toEqual('^2.0.0');
|
138
|
+
expect(packageJson.dependencies[dbReplacement.packageName]).toEqual(dbReplacement.version);
|
139
|
+
// Should only have one db adapter
|
140
|
+
expect(Object.keys(packageJson.dependencies).filter((n)=>n.startsWith('@payloadcms/db-'))).toHaveLength(1);
|
141
|
+
expect(packageJson.dependencies[bundlerReplacement.packageName]).toEqual(bundlerReplacement.version);
|
142
|
+
expect(packageJson.dependencies[editorReplacement.packageName]).toEqual(editorReplacement.version);
|
143
|
+
let payloadConfigPath = _path.default.resolve(projectDir, 'src/payload.config.ts');
|
144
|
+
// Website and ecommerce templates have payload.config.ts in src/payload
|
145
|
+
if (!_fsextra.default.existsSync(payloadConfigPath)) {
|
146
|
+
payloadConfigPath = _path.default.resolve(projectDir, 'src/payload/payload.config.ts');
|
147
|
+
}
|
148
|
+
const content = _fsextra.default.readFileSync(payloadConfigPath, 'utf-8');
|
149
|
+
// Check payload.config.ts
|
150
|
+
expect(content).not.toContain('// database-adapter-import');
|
151
|
+
expect(content).toContain(dbReplacement.importReplacement);
|
152
|
+
expect(content).not.toContain('// database-adapter-config-start');
|
153
|
+
expect(content).not.toContain('// database-adapter-config-end');
|
154
|
+
expect(content).toContain(dbReplacement.configReplacement.join('\n'));
|
155
|
+
expect(content).not.toContain('// bundler-config-import');
|
156
|
+
expect(content).toContain(bundlerReplacement.importReplacement);
|
157
|
+
expect(content).not.toContain('// bundler-config');
|
158
|
+
expect(content).toContain(bundlerReplacement.configReplacement);
|
159
|
+
});
|
182
160
|
});
|
183
161
|
});
|
184
|
-
describe('Templates',
|
162
|
+
describe('Templates', ()=>{
|
185
163
|
it.todo('Verify that all templates are valid');
|
186
|
-
|
164
|
+
// Loop through all templates.ts that should have replacement comments, and verify that they are present
|
187
165
|
});
|
188
166
|
});
|
167
|
+
|
168
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvY3JlYXRlLXByb2plY3Quc3BlYy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgZnNlIGZyb20gJ2ZzLWV4dHJhJ1xuaW1wb3J0IHBhdGggZnJvbSAncGF0aCdcbmltcG9ydCB0eXBlIHsgQnVuZGxlclR5cGUsIENsaUFyZ3MsIERiVHlwZSwgUHJvamVjdFRlbXBsYXRlIH0gZnJvbSAnLi4vdHlwZXMnXG5pbXBvcnQgeyBjcmVhdGVQcm9qZWN0IH0gZnJvbSAnLi9jcmVhdGUtcHJvamVjdCdcbmltcG9ydCB7IGJ1bmRsZXJQYWNrYWdlcywgZGJQYWNrYWdlcywgZWRpdG9yUGFja2FnZXMgfSBmcm9tICcuL3BhY2thZ2VzJ1xuaW1wb3J0IGV4cCBmcm9tICdjb25zdGFudHMnXG5pbXBvcnQgeyBnZXRWYWxpZFRlbXBsYXRlcyB9IGZyb20gJy4vdGVtcGxhdGVzJ1xuXG5jb25zdCBwcm9qZWN0RGlyID0gcGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgJy4vdG1wJylcbmRlc2NyaWJlKCdjcmVhdGVQcm9qZWN0JywgKCkgPT4ge1xuICBiZWZvcmVBbGwoKCkgPT4ge1xuICAgIGNvbnNvbGUubG9nID0gamVzdC5mbigpXG4gIH0pXG5cbiAgYmVmb3JlRWFjaCgoKSA9PiB7XG4gICAgaWYgKGZzZS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ELFNBQVMsYUFBYTtRQUNwQmdCLEdBQUcrQyxJQUFJLENBQUM7SUFDUix3R0FBd0c7SUFDMUc7QUFDRiJ9
|
@@ -1,48 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
});
|
10
|
-
};
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
15
|
-
function step(op) {
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
20
|
-
switch (op[0]) {
|
21
|
-
case 0: case 1: t = op; break;
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25
|
-
default:
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
30
|
-
if (t[2]) _.ops.pop();
|
31
|
-
_.trys.pop(); continue;
|
32
|
-
}
|
33
|
-
op = body.call(thisArg, _);
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "generateSecret", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return generateSecret;
|
36
9
|
}
|
37
|
-
};
|
38
|
-
|
39
|
-
exports.generateSecret = void 0;
|
40
|
-
var crypto_1 = require("crypto");
|
10
|
+
});
|
11
|
+
const _crypto = require("crypto");
|
41
12
|
function generateSecret() {
|
42
|
-
return
|
43
|
-
return __generator(this, function (_a) {
|
44
|
-
return [2 /*return*/, (0, crypto_1.randomBytes)(32).toString('hex').slice(0, 24)];
|
45
|
-
});
|
46
|
-
});
|
13
|
+
return (0, _crypto.randomBytes)(32).toString('hex').slice(0, 24);
|
47
14
|
}
|
48
|
-
|
15
|
+
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvZ2VuZXJhdGUtc2VjcmV0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHJhbmRvbUJ5dGVzIH0gZnJvbSAnY3J5cHRvJ1xuXG5leHBvcnQgZnVuY3Rpb24gZ2VuZXJhdGVTZWNyZXQoKTogc3RyaW5nIHtcbiAgcmV0dXJuIHJhbmRvbUJ5dGVzKDMyKS50b1N0cmluZygnaGV4Jykuc2xpY2UoMCwgMjQpXG59XG4iXSwibmFtZXMiOlsiZ2VuZXJhdGVTZWNyZXQiLCJyYW5kb21CeXRlcyIsInRvU3RyaW5nIiwic2xpY2UiXSwibWFwcGluZ3MiOiI7Ozs7K0JBRWdCQTs7O2VBQUFBOzs7d0JBRlk7QUFFckIsU0FBU0E7SUFDZCxPQUFPQyxJQUFBQSxtQkFBVyxFQUFDLElBQUlDLFFBQVEsQ0FBQyxPQUFPQyxLQUFLLENBQUMsR0FBRztBQUNsRCJ9
|
package/dist/lib/packages.js
CHANGED
@@ -1,61 +1,81 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
dbPackages: function() {
|
13
|
+
return dbPackages;
|
14
|
+
},
|
15
|
+
bundlerPackages: function() {
|
16
|
+
return bundlerPackages;
|
17
|
+
},
|
18
|
+
editorPackages: function() {
|
19
|
+
return editorPackages;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
const mongodbReplacement = {
|
6
23
|
importReplacement: "import { mongooseAdapter } from '@payloadcms/db-mongodb'",
|
24
|
+
packageName: '@payloadcms/db-mongodb',
|
7
25
|
// Replacement between `// database-adapter-config-start` and `// database-adapter-config-end`
|
8
26
|
configReplacement: [
|
9
27
|
' db: mongooseAdapter({',
|
10
28
|
' url: process.env.DATABASE_URI,',
|
11
|
-
' }),'
|
29
|
+
' }),'
|
12
30
|
],
|
13
|
-
version: '^1.0.0'
|
31
|
+
version: '^1.0.0'
|
14
32
|
};
|
15
|
-
|
16
|
-
packageName: '@payloadcms/db-postgres',
|
17
|
-
importReplacement: "import { postgresAdapter } from '@payloadcms/db-postgres'",
|
33
|
+
const postgresReplacement = {
|
18
34
|
configReplacement: [
|
19
35
|
' db: postgresAdapter({',
|
20
36
|
' pool: {',
|
21
37
|
' connectionString: process.env.DATABASE_URI,',
|
22
38
|
' },',
|
23
|
-
' }),'
|
39
|
+
' }),'
|
24
40
|
],
|
25
|
-
|
41
|
+
importReplacement: "import { postgresAdapter } from '@payloadcms/db-postgres'",
|
42
|
+
packageName: '@payloadcms/db-postgres',
|
43
|
+
version: '^0.x'
|
26
44
|
};
|
27
|
-
|
45
|
+
const dbPackages = {
|
28
46
|
mongodb: mongodbReplacement,
|
29
|
-
postgres: postgresReplacement
|
47
|
+
postgres: postgresReplacement
|
30
48
|
};
|
31
|
-
|
32
|
-
packageName: '@payloadcms/bundler-webpack',
|
49
|
+
const webpackReplacement = {
|
33
50
|
importReplacement: "import { webpackBundler } from '@payloadcms/bundler-webpack'",
|
51
|
+
packageName: '@payloadcms/bundler-webpack',
|
34
52
|
// Replacement of line containing `// bundler-config`
|
35
53
|
configReplacement: ' bundler: webpackBundler(),',
|
36
|
-
version: '^1.0.0'
|
54
|
+
version: '^1.0.0'
|
37
55
|
};
|
38
|
-
|
39
|
-
packageName: '@payloadcms/bundler-vite',
|
40
|
-
importReplacement: "import { viteBundler } from '@payloadcms/bundler-vite'",
|
56
|
+
const viteReplacement = {
|
41
57
|
configReplacement: ' bundler: viteBundler(),',
|
42
|
-
|
58
|
+
importReplacement: "import { viteBundler } from '@payloadcms/bundler-vite'",
|
59
|
+
packageName: '@payloadcms/bundler-vite',
|
60
|
+
version: '^0.x'
|
43
61
|
};
|
44
|
-
|
45
|
-
webpack: webpackReplacement,
|
62
|
+
const bundlerPackages = {
|
46
63
|
vite: viteReplacement,
|
64
|
+
webpack: webpackReplacement
|
47
65
|
};
|
48
|
-
|
49
|
-
slate: {
|
50
|
-
packageName: '@payloadcms/richtext-slate',
|
51
|
-
importReplacement: "import { slateEditor } from '@payloadcms/richtext-slate'",
|
52
|
-
configReplacement: ' editor: slateEditor({}),',
|
53
|
-
version: '^1.0.0',
|
54
|
-
},
|
66
|
+
const editorPackages = {
|
55
67
|
lexical: {
|
56
|
-
packageName: '@payloadcms/richtext-lexical',
|
57
|
-
importReplacement: "import { lexicalEditor } from '@payloadcms/richtext-lexical'",
|
58
68
|
configReplacement: ' editor: lexicalEditor({}),',
|
59
|
-
|
69
|
+
importReplacement: "import { lexicalEditor } from '@payloadcms/richtext-lexical'",
|
70
|
+
packageName: '@payloadcms/richtext-lexical',
|
71
|
+
version: '^0.x'
|
60
72
|
},
|
73
|
+
slate: {
|
74
|
+
configReplacement: ' editor: slateEditor({}),',
|
75
|
+
importReplacement: "import { slateEditor } from '@payloadcms/richtext-slate'",
|
76
|
+
packageName: '@payloadcms/richtext-slate',
|
77
|
+
version: '^1.0.0'
|
78
|
+
}
|
61
79
|
};
|
80
|
+
|
81
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcGFja2FnZXMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBCdW5kbGVyVHlwZSwgRGJUeXBlLCBFZGl0b3JUeXBlIH0gZnJvbSAnLi4vdHlwZXMnXG5cbnR5cGUgRGJBZGFwdGVyUmVwbGFjZW1lbnQgPSB7XG4gIGNvbmZpZ1JlcGxhY2VtZW50OiBzdHJpbmdbXVxuICBpbXBvcnRSZXBsYWNlbWVudDogc3RyaW5nXG4gIHBhY2thZ2VOYW1lOiBzdHJpbmdcbiAgdmVyc2lvbjogc3RyaW5nXG59XG5cbnR5cGUgQnVuZGxlclJlcGxhY2VtZW50ID0ge1xuICBjb25maWdSZXBsYWNlbWVudDogc3RyaW5nXG4gIGltcG9ydFJlcGxhY2VtZW50OiBzdHJpbmdcbiAgcGFja2FnZU5hbWU6IHN0cmluZ1xuICB2ZXJzaW9uOiBzdHJpbmdcbn1cblxudHlwZSBFZGl0b3JSZXBsYWNlbWVudCA9IHtcbiAgY29uZmlnUmVwbGFjZW1lbnQ6IHN0cmluZ1xuICBpbXBvcnRSZXBsYWNlbWVudDogc3RyaW5nXG4gIHBhY2thZ2VOYW1lOiBzdHJpbmdcbiAgdmVyc2lvbjogc3RyaW5nXG59XG5cbmNvbnN0IG1vbmdvZGJSZXBsYWNlbWVudDogRGJB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