create-payload-app
Advanced tools
Comparing version 1.0.0 to 3.0.0-alpha.50
@@ -5,4 +5,4 @@ "use strict"; | ||
}); | ||
const _main = require("./main"); | ||
const _log = require("./utils/log"); | ||
const _main = require("./main.js"); | ||
const _log = require("./utils/log.js"); | ||
async function main() { | ||
@@ -13,2 +13,2 @@ await new _main.Main().init(); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBNYWluIH0gZnJvbSAnLi9tYWluJ1xuaW1wb3J0IHsgZXJyb3IgfSBmcm9tICcuL3V0aWxzL2xvZydcblxuYXN5bmMgZnVuY3Rpb24gbWFpbigpOiBQcm9taXNlPHZvaWQ+IHtcbiAgYXdhaXQgbmV3IE1haW4oKS5pbml0KClcbn1cblxubWFpbigpLmNhdGNoKChlKSA9PiBlcnJvcihgQW4gZXJyb3IgaGFzIG9jY3VycmVkOiAke2UgaW5zdGFuY2VvZiBFcnJvciA/IGUubWVzc2FnZSA6IGV9YCkpXG4iXSwibmFtZXMiOlsibWFpbiIsIk1haW4iLCJpbml0IiwiY2F0Y2giLCJlIiwiZXJyb3IiLCJFcnJvciIsIm1lc3NhZ2UiXSwibWFwcGluZ3MiOiI7Ozs7c0JBQXFCO3FCQUNDO0FBRXRCLGVBQWVBO0lBQ2IsTUFBTSxJQUFJQyxVQUFJLEdBQUdDLElBQUk7QUFDdkI7QUFFQUYsT0FBT0csS0FBSyxDQUFDLENBQUNDLElBQU1DLElBQUFBLFVBQUssRUFBQyxDQUFDLHVCQUF1QixFQUFFRCxhQUFhRSxRQUFRRixFQUFFRyxPQUFPLEdBQUdILEVBQUUsQ0FBQyJ9 | ||
//# sourceMappingURL=index.js.map |
@@ -12,5 +12,5 @@ "use strict"; | ||
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra")); | ||
const _path = /*#__PURE__*/ _interop_require_default(require("path")); | ||
const _log = require("../utils/log"); | ||
const _packages = require("./packages"); | ||
const _globby = /*#__PURE__*/ _interop_require_default(require("globby")); | ||
const _log = require("../utils/log.js"); | ||
const _packages = require("./packages.js"); | ||
function _interop_require_default(obj) { | ||
@@ -25,38 +25,14 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
// Update package.json | ||
const packageJsonPath = _path.default.resolve(args.projectDir, 'package.json'); | ||
try { | ||
const packageObj = await _fsextra.default.readJson(packageJsonPath); | ||
packageObj.dependencies['payload'] = '^2.0.0'; | ||
const dbPackage = _packages.dbPackages[args.dbDetails.type]; | ||
const bundlerPackage = _packages.bundlerPackages['webpack']; | ||
const editorPackage = _packages.editorPackages['slate']; | ||
// Delete all other db adapters | ||
Object.values(_packages.dbPackages).forEach((p)=>{ | ||
if (p.packageName !== dbPackage.packageName) { | ||
delete packageObj.dependencies[p.packageName]; | ||
} | ||
}); | ||
packageObj.dependencies[dbPackage.packageName] = dbPackage.version; | ||
packageObj.dependencies[bundlerPackage.packageName] = bundlerPackage.version; | ||
packageObj.dependencies[editorPackage.packageName] = editorPackage.version; | ||
await _fsextra.default.writeJson(packageJsonPath, packageObj, { | ||
spaces: 2 | ||
}); | ||
} catch (err) { | ||
(0, _log.warning)('Unable to update name in package.json'); | ||
} | ||
try { | ||
const possiblePaths = [ | ||
_path.default.resolve(args.projectDir, 'src/payload.config.ts'), | ||
_path.default.resolve(args.projectDir, 'src/payload/payload.config.ts') | ||
]; | ||
let payloadConfigPath; | ||
possiblePaths.forEach((p)=>{ | ||
if (_fsextra.default.pathExistsSync(p) && !payloadConfigPath) { | ||
payloadConfigPath = p; | ||
} | ||
}); | ||
if (!('payloadConfigPath' in args.projectDirOrConfigPath)) { | ||
payloadConfigPath = (await (0, _globby.default)('**/payload.config.ts', { | ||
absolute: true, | ||
cwd: args.projectDirOrConfigPath.projectDir | ||
}))?.[0]; | ||
} else { | ||
payloadConfigPath = args.projectDirOrConfigPath.payloadConfigPath; | ||
} | ||
if (!payloadConfigPath) { | ||
(0, _log.warning)('Unable to update payload.config.ts with plugins'); | ||
(0, _log.warning)('Unable to update payload.config.ts with plugins. Could not find payload.config.ts.'); | ||
return; | ||
@@ -66,5 +42,3 @@ } | ||
const configLines = configContent.split('\n'); | ||
const dbReplacement = _packages.dbPackages[args.dbDetails.type]; | ||
const bundlerReplacement = _packages.bundlerPackages['webpack']; | ||
const editorReplacement = _packages.editorPackages['slate']; | ||
const dbReplacement = _packages.dbReplacements[args.dbDetails.type]; | ||
let dbConfigStartLineIndex; | ||
@@ -76,14 +50,2 @@ let dbConfigEndLineIndex; | ||
} | ||
if (l.includes('// bundler-import')) { | ||
configLines[i] = bundlerReplacement.importReplacement; | ||
} | ||
if (l.includes('// bundler-config')) { | ||
configLines[i] = bundlerReplacement.configReplacement; | ||
} | ||
if (l.includes('// editor-import')) { | ||
configLines[i] = editorReplacement.importReplacement; | ||
} | ||
if (l.includes('// editor-config')) { | ||
configLines[i] = editorReplacement.configReplacement; | ||
} | ||
if (l.includes('// database-adapter-config-start')) { | ||
@@ -104,6 +66,6 @@ dbConfigStartLineIndex = i; | ||
} catch (err) { | ||
(0, _log.warning)('Unable to update payload.config.ts with plugins'); | ||
(0, _log.warning)(`Unable to update payload.config.ts with plugins: ${err instanceof Error ? err.message : ''}`); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvY29uZmlndXJlLXBheWxvYWQtY29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBmc2UgZnJvbSAnZnMtZXh0cmEnXG5pbXBvcnQgcGF0aCBmcm9tICdwYXRoJ1xuXG5pbXBvcnQgdHlwZSB7IERiRGV0YWlscyB9IGZyb20gJy4uL3R5cGVzJ1xuXG5pbXBvcnQgeyB3YXJuaW5nIH0gZnJvbSAnLi4vdXRpbHMvbG9nJ1xuaW1wb3J0IHsgYnVuZGxlclBhY2thZ2VzLCB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LGlCQUFpQjtRQUV0QztRQUVBcEMsZ0JBQUcsQ0FBQ3NDLGFBQWEsQ0FBQ2pCLG1CQUFtQkksWUFBWWMsSUFBSSxDQUFDO0lBQ3hELEVBQUUsT0FBT3JCLEtBQWM7UUFDckJDLElBQUFBLFlBQU8sRUFBQztJQUNWO0FBQ0YifQ== | ||
//# sourceMappingURL=configure-payload-config.js.map |
@@ -19,2 +19,3 @@ "use strict"; | ||
}); | ||
const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts")); | ||
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk")); | ||
@@ -24,6 +25,6 @@ const _degit = /*#__PURE__*/ _interop_require_default(require("degit")); | ||
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra")); | ||
const _ora = /*#__PURE__*/ _interop_require_default(require("ora")); | ||
const _nodeurl = require("node:url"); | ||
const _path = /*#__PURE__*/ _interop_require_default(require("path")); | ||
const _log = require("../utils/log"); | ||
const _configurepayloadconfig = require("./configure-payload-config"); | ||
const _log = require("../utils/log.js"); | ||
const _configurepayloadconfig = require("./configure-payload-config.js"); | ||
function _interop_require_default(obj) { | ||
@@ -34,2 +35,45 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { | ||
if (typeof WeakMap !== "function") return null; | ||
var cacheBabelInterop = new WeakMap(); | ||
var cacheNodeInterop = new WeakMap(); | ||
return (_getRequireWildcardCache = function(nodeInterop) { | ||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop; | ||
})(nodeInterop); | ||
} | ||
function _interop_require_wildcard(obj, nodeInterop) { | ||
if (!nodeInterop && obj && obj.__esModule) { | ||
return obj; | ||
} | ||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") { | ||
return { | ||
default: obj | ||
}; | ||
} | ||
var cache = _getRequireWildcardCache(nodeInterop); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = { | ||
__proto__: null | ||
}; | ||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for(var key in obj){ | ||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
const filename = (0, _nodeurl.fileURLToPath)(require("url").pathToFileURL(__filename).toString()); | ||
const dirname = _path.default.dirname(filename); | ||
async function createOrFindProjectDir(projectDir) { | ||
@@ -58,5 +102,3 @@ const pathExists = await _fsextra.default.pathExists(projectDir); | ||
} catch (err) { | ||
console.log({ | ||
err | ||
}); | ||
(0, _log.error)(`Error installing dependencies${err instanceof Error ? `: ${err.message}` : ''}.`); | ||
return false; | ||
@@ -67,9 +109,22 @@ } | ||
const { cliArgs, dbDetails, packageManager, projectDir, projectName, template } = args; | ||
if (cliArgs['--dry-run']) { | ||
(0, _log.debug)(`Dry run: Creating project in ${_chalk.default.green(projectDir)}`); | ||
return; | ||
} | ||
await createOrFindProjectDir(projectDir); | ||
console.log(`\n Creating project in ${_chalk.default.green(_path.default.resolve(projectDir))}\n`); | ||
if ('url' in template) { | ||
const emitter = (0, _degit.default)(template.url); | ||
if (cliArgs['--local-template']) { | ||
// Copy template from local path. For development purposes. | ||
const localTemplate = _path.default.resolve(dirname, '../../../../templates/', cliArgs['--local-template']); | ||
await _fsextra.default.copy(localTemplate, projectDir); | ||
} else if ('url' in template) { | ||
let templateUrl = template.url; | ||
if (cliArgs['--template-branch']) { | ||
templateUrl = `${template.url}#${cliArgs['--template-branch']}`; | ||
(0, _log.debug)(`Using template url: ${templateUrl}`); | ||
} | ||
const emitter = (0, _degit.default)(templateUrl); | ||
await emitter.clone(projectDir); | ||
} | ||
const spinner = (0, _ora.default)('Checking latest Payload version...').start(); | ||
const spinner = _prompts.spinner(); | ||
spinner.start('Checking latest Payload version...'); | ||
await updatePackageJSON({ | ||
@@ -79,5 +134,8 @@ projectDir, | ||
}); | ||
spinner.message('Configuring Payload...'); | ||
await (0, _configurepayloadconfig.configurePayloadConfig)({ | ||
dbDetails, | ||
projectDir | ||
projectDirOrConfigPath: { | ||
projectDir | ||
} | ||
}); | ||
@@ -89,14 +147,16 @@ // Remove yarn.lock file. This is only desired in Payload Cloud. | ||
} | ||
spinner.text = 'Installing dependencies...'; | ||
const result = await installDeps({ | ||
cliArgs, | ||
packageManager, | ||
projectDir | ||
}); | ||
spinner.stop(); | ||
spinner.clear(); | ||
if (result) { | ||
(0, _log.success)('Dependencies installed'); | ||
if (!cliArgs['--no-deps']) { | ||
spinner.message('Installing dependencies...'); | ||
const result = await installDeps({ | ||
cliArgs, | ||
packageManager, | ||
projectDir | ||
}); | ||
if (result) { | ||
spinner.stop('Successfully installed Payload and dependencies'); | ||
} else { | ||
spinner.stop('Error installing dependencies', 1); | ||
} | ||
} else { | ||
(0, _log.error)('Error installing dependencies'); | ||
spinner.stop('Dependency installation skipped'); | ||
} | ||
@@ -114,6 +174,6 @@ } | ||
} catch (err) { | ||
(0, _log.warning)('Unable to update name in package.json'); | ||
(0, _log.warning)(`Unable to update name in package.json. ${err instanceof Error ? err.message : ''}`); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvY3JlYXRlLXByb2plY3QudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNoYWxrIGZyb20gJ2NoYWxrJ1xuaW1wb3J0IGRlZ2l0IGZyb20gJ2RlZ2l0J1xuaW1wb3J0IGV4ZWNhIGZyb20gJ2V4ZWNhJ1xuaW1wb3J0IGZzZSBmcm9tICdmcy1leHRyYSdcbmltcG9ydCBvcmEgZnJvbSAnb3JhJ1xuaW1wb3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kM7SUFDQyxNQUFNLEVBQUVMLFVBQVUsRUFBRWtCLFdBQVcsRUFBRSxHQUFHYjtJQUNwQyxNQUFNa0Msa0JBQWtCM0IsYUFBSSxDQUFDQyxPQUFPLENBQUNiLFlBQVk7SUFDakQsSUFBSTtRQUNGLE1BQU13QyxhQUFhLE1BQU10QyxnQkFBRyxDQUFDdUMsUUFBUSxDQUFDRjtRQUN0Q0MsV0FBV0UsSUFBSSxHQUFHeEI7UUFDbEIsTUFBTWhCLGdCQUFHLENBQUN5QyxTQUFTLENBQUNKLGlCQUFpQkMsWUFBWTtZQUFFSSxRQUFRO1FBQUU7SUFDL0QsRUFBRSxPQUFPOUIsS0FBYztRQUNyQitCLElBQUFBLFlBQU8sRUFBQztJQUNWO0FBQ0YifQ== | ||
//# sourceMappingURL=create-project.js.map |
@@ -7,5 +7,7 @@ "use strict"; | ||
const _path = /*#__PURE__*/ _interop_require_default(require("path")); | ||
const _createproject = require("./create-project"); | ||
const _packages = require("./packages"); | ||
const _templates = require("./templates"); | ||
const _createproject = require("./create-project.js"); | ||
const _nodeurl = require("node:url"); | ||
const _packages = require("./packages.js"); | ||
const _templates = require("./templates.js"); | ||
const _globby = /*#__PURE__*/ _interop_require_default(require("globby")); | ||
function _interop_require_default(obj) { | ||
@@ -16,3 +18,5 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
const projectDir = _path.default.resolve(__dirname, './tmp'); | ||
const filename = (0, _nodeurl.fileURLToPath)(require("url").pathToFileURL(__filename).toString()); | ||
const dirname = _path.default.dirname(filename); | ||
const projectDir = _path.default.resolve(dirname, './tmp'); | ||
describe('createProject', ()=>{ | ||
@@ -43,25 +47,6 @@ beforeAll(()=>{ | ||
'--db': 'mongodb', | ||
'--local-template': 'blank', | ||
'--no-deps': true | ||
}; | ||
const packageManager = 'yarn'; | ||
it('creates starter project', async ()=>{ | ||
const projectName = 'starter-project'; | ||
const template = { | ||
name: 'blank', | ||
type: 'starter', | ||
url: 'https://github.com/payloadcms/payload/templates/blank', | ||
description: 'Blank Template' | ||
}; | ||
await (0, _createproject.createProject)({ | ||
cliArgs: args, | ||
projectName, | ||
projectDir, | ||
template, | ||
packageManager | ||
}); | ||
const packageJsonPath = _path.default.resolve(projectDir, 'package.json'); | ||
const packageJson = _fsextra.default.readJsonSync(packageJsonPath); | ||
// Check package name and description | ||
expect(packageJson.name).toEqual(projectName); | ||
}); | ||
it('creates plugin template', async ()=>{ | ||
@@ -87,43 +72,26 @@ const projectName = 'plugin'; | ||
}); | ||
describe('db adapters and bundlers', ()=>{ | ||
describe('creates project from template', ()=>{ | ||
const templates = (0, _templates.getValidTemplates)(); | ||
it.each([ | ||
[ | ||
'blank', | ||
'mongodb', | ||
'webpack' | ||
'blank-3.0', | ||
'mongodb' | ||
], | ||
[ | ||
'blank', | ||
'postgres', | ||
'webpack' | ||
], | ||
[ | ||
'website', | ||
'mongodb', | ||
'webpack' | ||
], | ||
[ | ||
'website', | ||
'postgres', | ||
'webpack' | ||
], | ||
[ | ||
'ecommerce', | ||
'mongodb', | ||
'webpack' | ||
], | ||
[ | ||
'ecommerce', | ||
'postgres', | ||
'webpack' | ||
'blank-3.0', | ||
'postgres' | ||
] | ||
])('update config and deps: %s, %s, %s', async (templateName, db, bundler)=>{ | ||
])('update config and deps: %s, %s', async (templateName, db)=>{ | ||
const projectName = 'starter-project'; | ||
const template = templates.find((t)=>t.name === templateName); | ||
const cliArgs = { | ||
...args, | ||
'--db': db, | ||
'--local-template': templateName | ||
}; | ||
await (0, _createproject.createProject)({ | ||
cliArgs: args, | ||
cliArgs, | ||
projectName, | ||
projectDir, | ||
template, | ||
template: template, | ||
packageManager, | ||
@@ -135,18 +103,13 @@ dbDetails: { | ||
}); | ||
const dbReplacement = _packages.dbPackages[db]; | ||
const bundlerReplacement = _packages.bundlerPackages[bundler]; | ||
const editorReplacement = _packages.editorPackages['slate']; | ||
const dbReplacement = _packages.dbReplacements[db]; | ||
const packageJsonPath = _path.default.resolve(projectDir, 'package.json'); | ||
const packageJson = _fsextra.default.readJsonSync(packageJsonPath); | ||
// Check deps | ||
expect(packageJson.dependencies['payload']).toEqual('^2.0.0'); | ||
expect(packageJson.dependencies[dbReplacement.packageName]).toEqual(dbReplacement.version); | ||
// Should only have one db adapter | ||
expect(Object.keys(packageJson.dependencies).filter((n)=>n.startsWith('@payloadcms/db-'))).toHaveLength(1); | ||
expect(packageJson.dependencies[bundlerReplacement.packageName]).toEqual(bundlerReplacement.version); | ||
expect(packageJson.dependencies[editorReplacement.packageName]).toEqual(editorReplacement.version); | ||
let payloadConfigPath = _path.default.resolve(projectDir, 'src/payload.config.ts'); | ||
// Website and ecommerce templates have payload.config.ts in src/payload | ||
if (!_fsextra.default.existsSync(payloadConfigPath)) { | ||
payloadConfigPath = _path.default.resolve(projectDir, 'src/payload/payload.config.ts'); | ||
const payloadConfigPath = (await (0, _globby.default)('**/payload.config.ts', { | ||
absolute: true, | ||
cwd: projectDir | ||
}))?.[0]; | ||
if (!payloadConfigPath) { | ||
throw new Error(`Could not find payload.config.ts inside ${projectDir}`); | ||
} | ||
@@ -160,15 +123,7 @@ const content = _fsextra.default.readFileSync(payloadConfigPath, 'utf-8'); | ||
expect(content).toContain(dbReplacement.configReplacement.join('\n')); | ||
expect(content).not.toContain('// bundler-config-import'); | ||
expect(content).toContain(bundlerReplacement.importReplacement); | ||
expect(content).not.toContain('// bundler-config'); | ||
expect(content).toContain(bundlerReplacement.configReplacement); | ||
}); | ||
}); | ||
}); | ||
describe('Templates', ()=>{ | ||
it.todo('Verify that all templates are valid'); | ||
// Loop through all templates.ts that should have replacement comments, and verify that they are present | ||
}); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvY3JlYXRlLXByb2plY3Quc3BlYy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgZnNlIGZyb20gJ2ZzLWV4dHJhJ1xuaW1wb3J0IHBhdGggZnJvbSA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2xpY2UoMCwgMjQpXG59XG4iXSwibmFtZXMiOlsiZ2VuZXJhdGVTZWNyZXQiLCJyYW5kb21CeXRlcyIsInRvU3RyaW5nIiwic2xpY2UiXSwibWFwcGluZ3MiOiI7Ozs7K0JBRWdCQTs7O2VBQUFBOzs7d0JBRlk7QUFFckIsU0FBU0E7SUFDZCxPQUFPQyxJQUFBQSxtQkFBVyxFQUFDLElBQUlDLFFBQVEsQ0FBQyxPQUFPQyxLQUFLLENBQUMsR0FBRztBQUNsRCJ9 | ||
//# sourceMappingURL=generate-secret.js.map |
@@ -5,17 +5,6 @@ "use strict"; | ||
}); | ||
function _export(target, all) { | ||
for(var name in all)Object.defineProperty(target, name, { | ||
enumerable: true, | ||
get: all[name] | ||
}); | ||
} | ||
_export(exports, { | ||
dbPackages: function() { | ||
return dbPackages; | ||
}, | ||
bundlerPackages: function() { | ||
return bundlerPackages; | ||
}, | ||
editorPackages: function() { | ||
return editorPackages; | ||
Object.defineProperty(exports, "dbReplacements", { | ||
enumerable: true, | ||
get: function() { | ||
return dbReplacements; | ||
} | ||
@@ -31,4 +20,3 @@ }); | ||
' }),' | ||
], | ||
version: '^1.0.0' | ||
] | ||
}; | ||
@@ -44,41 +32,9 @@ const postgresReplacement = { | ||
importReplacement: "import { postgresAdapter } from '@payloadcms/db-postgres'", | ||
packageName: '@payloadcms/db-postgres', | ||
version: '^0.x' | ||
packageName: '@payloadcms/db-postgres' | ||
}; | ||
const dbPackages = { | ||
const dbReplacements = { | ||
mongodb: mongodbReplacement, | ||
postgres: postgresReplacement | ||
}; | ||
const webpackReplacement = { | ||
importReplacement: "import { webpackBundler } from '@payloadcms/bundler-webpack'", | ||
packageName: '@payloadcms/bundler-webpack', | ||
// Replacement of line containing `// bundler-config` | ||
configReplacement: ' bundler: webpackBundler(),', | ||
version: '^1.0.0' | ||
}; | ||
const viteReplacement = { | ||
configReplacement: ' bundler: viteBundler(),', | ||
importReplacement: "import { viteBundler } from '@payloadcms/bundler-vite'", | ||
packageName: '@payloadcms/bundler-vite', | ||
version: '^0.x' | ||
}; | ||
const bundlerPackages = { | ||
vite: viteReplacement, | ||
webpack: webpackReplacement | ||
}; | ||
const editorPackages = { | ||
lexical: { | ||
configReplacement: ' editor: lexicalEditor({}),', | ||
importReplacement: "import { lexicalEditor } from '@payloadcms/richtext-lexical'", | ||
packageName: '@payloadcms/richtext-lexical', | ||
version: '^0.x' | ||
}, | ||
slate: { | ||
configReplacement: ' editor: slateEditor({}),', | ||
importReplacement: "import { slateEditor } from '@payloadcms/richtext-slate'", | ||
packageName: '@payloadcms/richtext-slate', | ||
version: '^1.0.0' | ||
} | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcGFja2FnZXMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBCdW5kbGVyVHlwZSwgRGJUeXBlLCBFZGl0b3JUeXBlIH0gZnJvbSAnLi4vdHlwZXMnXG5cbnR5cGUgRGJBZGFwdGVyUmVwbGFjZW1lbnQgPSB7XG4gIGNvbmZpZ1JlcGxhY2VtZW50OiBzdHJpbmdbXVxuICBpbXBvcnRSZXBsYWNlbWVudDogc3RyaW5nXG4gIHBhY2thZ2VOYW1lOiBzdHJpbmdcbiAgdmVyc2lvbjogc3RyaW5nXG59XG5cbnR5cGUgQnVuZGxlclJlcGxhY2VtZW50ID0ge1xuICBjb25maWdSZXBsYWNlbWVudDogc3RyaW5nXG4gIGltcG9ydFJlcGxhY2VtZW50OiBzdHJpbmdcbiAgcGFja2FnZU5hbWU6IHN0cmluZ1xuICB2ZXJzaW9uOiBzdHJpbmdcbn1cblxudHlwZSBFZGl0b3JSZXBsYWNlbWVudCA9IHtcbiAgY29uZmlnUmVwbGFjZW1lbnQ6IHN0cmluZ1xuICBpbXBvcnRSZXBsYWNlbWVudDogc3RyaW5nXG4gIHBhY2thZ2VOYW1lOiBzdHJpbmdcbiAgd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FPO1FBQ0xWLG1CQUFtQjtRQUNuQkYsbUJBQW1CO1FBQ25CQyxhQUFhO1FBQ2JFLFNBQVM7SUFDWDtBQUNGIn0= | ||
//# sourceMappingURL=packages.js.map |
@@ -11,3 +11,4 @@ "use strict"; | ||
}); | ||
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts")); | ||
const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts")); | ||
const _slugify = /*#__PURE__*/ _interop_require_default(require("@sindresorhus/slugify")); | ||
function _interop_require_default(obj) { | ||
@@ -18,18 +19,58 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { | ||
if (typeof WeakMap !== "function") return null; | ||
var cacheBabelInterop = new WeakMap(); | ||
var cacheNodeInterop = new WeakMap(); | ||
return (_getRequireWildcardCache = function(nodeInterop) { | ||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop; | ||
})(nodeInterop); | ||
} | ||
function _interop_require_wildcard(obj, nodeInterop) { | ||
if (!nodeInterop && obj && obj.__esModule) { | ||
return obj; | ||
} | ||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") { | ||
return { | ||
default: obj | ||
}; | ||
} | ||
var cache = _getRequireWildcardCache(nodeInterop); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = { | ||
__proto__: null | ||
}; | ||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for(var key in obj){ | ||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
async function parseProjectName(args) { | ||
if (args['--name']) return args['--name']; | ||
if (args._[0]) return args._[0]; | ||
const response = await (0, _prompts.default)({ | ||
name: 'value', | ||
if (args['--name']) return (0, _slugify.default)(args['--name']); | ||
if (args._[0]) return (0, _slugify.default)(args._[0]); | ||
const projectName = await _prompts.text({ | ||
message: 'Project name?', | ||
type: 'text', | ||
validate: (value)=>!!value.length | ||
}, { | ||
onCancel: ()=>{ | ||
process.exit(0); | ||
validate: (value)=>{ | ||
if (!value) return 'Please enter a project name.'; | ||
} | ||
}); | ||
return response.value; | ||
if (_prompts.isCancel(projectName)) { | ||
process.exit(0); | ||
} | ||
return (0, _slugify.default)(projectName); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcGFyc2UtcHJvamVjdC1uYW1lLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgQ2xpQXJncyB9IGZyb20gJy4uL3R5cGVzJ1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gcGFyc2VQcm9qZWN0TmFtZShhcmdzOiBDbGlBcmdzKTogUHJvbWlzZTxzdHJpbmc+IHtcbiAgaWYgKGFyZ3NbJy0tbmFtZSddKSByZXR1cm4gYXJnc1snLS1uYW1lJ11cbiAgaWYgKGFyZ3MuX1swXSkgcmV0dXJuIGFyZ3MuX1swXVxuXG4gIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgcHJvbXB0cyhcbiAgICB7XG4gICAgICBuYW1lOiAndmFsdWUnLFxuICAgICAgbWVzc2FnZTogJ1Byb2plY3QgbmFtZT8nLFxuICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgdmFsaWRhdGU6ICh2YWx1ZTogc3RyaW5nKSA9PiAhIXZhbHVlLmxlbmd0aCxcbiAgICB9LFxuICAgIHtcbiAgICAgIG9uQ2FuY2VsOiAoKSA9PiB7XG4gICAgICAgIHByb2Nlc3MuZXhpdCgwKVxuICAgICAgfSxcbiAgICB9LFxuICApXG5cbiAgcmV0dXJuIHJlc3BvbnNlLnZhbHVlXG59XG4iXSwibmFtZXMiOlsicGFyc2VQcm9qZWN0TmFtZSIsImFyZ3MiLCJfIiwicmVzcG9uc2UiLCJwcm9tcHRzIiwibmFtZSIsIm1lc3NhZ2UiLCJ0eXBlIiwidmFsaWRhdGUiLCJ2YWx1ZSIsImxlbmd0aCIsIm9uQ2FuY2VsIiwicHJvY2VzcyIsImV4aXQiXSwibWFwcGluZ3MiOiI7Ozs7K0JBSXNCQTs7O2VBQUFBOzs7Z0VBSkY7Ozs7OztBQUliLGVBQWVBLGlCQUFpQkMsSUFBYTtJQUNsRCxJQUFJQSxJQUFJLENBQUMsU0FBUyxFQUFFLE9BQU9BLElBQUksQ0FBQyxTQUFTO0lBQ3pDLElBQUlBLEtBQUtDLENBQUMsQ0FBQyxFQUFFLEVBQUUsT0FBT0QsS0FBS0MsQ0FBQyxDQUFDLEVBQUU7SUFFL0IsTUFBTUMsV0FBVyxNQUFNQyxJQUFBQSxnQkFBTyxFQUM1QjtRQUNFQyxNQUFNO1FBQ05DLFNBQVM7UUFDVEMsTUFBTTtRQUNOQyxVQUFVLENBQUNDLFFBQWtCLENBQUMsQ0FBQ0EsTUFBTUMsTUFBTTtJQUM3QyxHQUNBO1FBQ0VDLFVBQVU7WUFDUkMsUUFBUUMsSUFBSSxDQUFDO1FBQ2Y7SUFDRjtJQUdGLE9BQU9WLFNBQVNNLEtBQUs7QUFDdkIifQ== | ||
//# sourceMappingURL=parse-project-name.js.map |
@@ -11,7 +11,43 @@ "use strict"; | ||
}); | ||
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts")); | ||
function _interop_require_default(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts")); | ||
function _getRequireWildcardCache(nodeInterop) { | ||
if (typeof WeakMap !== "function") return null; | ||
var cacheBabelInterop = new WeakMap(); | ||
var cacheNodeInterop = new WeakMap(); | ||
return (_getRequireWildcardCache = function(nodeInterop) { | ||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop; | ||
})(nodeInterop); | ||
} | ||
function _interop_require_wildcard(obj, nodeInterop) { | ||
if (!nodeInterop && obj && obj.__esModule) { | ||
return obj; | ||
} | ||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") { | ||
return { | ||
default: obj | ||
}; | ||
} | ||
var cache = _getRequireWildcardCache(nodeInterop); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = { | ||
__proto__: null | ||
}; | ||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for(var key in obj){ | ||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
@@ -25,24 +61,18 @@ async function parseTemplate(args, validTemplates) { | ||
} | ||
const response = await (0, _prompts.default)({ | ||
name: 'value', | ||
choices: validTemplates.map((p)=>{ | ||
const response = await _prompts.select({ | ||
message: 'Choose project template', | ||
options: validTemplates.map((p)=>{ | ||
return { | ||
description: p.description, | ||
title: p.name, | ||
label: p.name, | ||
value: p.name | ||
}; | ||
}), | ||
message: 'Choose project template', | ||
type: 'select', | ||
validate: (value)=>!!value.length | ||
}, { | ||
onCancel: ()=>{ | ||
process.exit(0); | ||
} | ||
}) | ||
}); | ||
const template = validTemplates.find((t)=>t.name === response.value); | ||
if (!template) throw new Error('Template is undefined'); | ||
if (_prompts.isCancel(response)) { | ||
process.exit(0); | ||
} | ||
const template = validTemplates.find((t)=>t.name === response); | ||
return template; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcGFyc2UtdGVtcGxhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHByb21wdHMgZnJvbSAncHJvbXB0cydcblxuaW1wb3J0IHR5cGUgeyBDbGlBcmdzLCBQcm9qZWN0VGVtcGxhdGUgfSBmcm9tICcuLi90eXBlcydcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHBhcnNlVGVtcGxhdGUoXG4gIGFyZ3M6IENsaUFyZ3MsXG4gIHZhbGlkVGVtcGxhdGVzOiBQcm9qZWN0VGVtcGxhdGVbXSxcbik6IFByb21pc2U8UHJvamVjdFRlbXBsYXRlPiB7XG4gIGlmIChhcmdzWyctLXRlbXBsYXRlJ10pIHtcbiAgICBjb25zdCB0ZW1wbGF0ZU5hbWUgPSBhcmdzWyctLXRlbXBsYXRlJ11cbiAgICBjb25zdCB0ZW1wbGF0ZSA9IHZhbGlkVGVtcGxhdGVzLmZpbmQoKHQpID0+IHQubmFtZSA9PT0gdGVtcGxhdGVOYW1lKVxuICAgIGlmICghdGVtcGxhdGUpIHRocm93IG5ldyBFcnJvcignSW52YWxpZCB0ZW1wbGF0ZSBnaXZlbicpXG4gICAgcmV0dXJuIHRlbXBsYXRlXG4gIH1cblxuICBjb25zdCByZXNwb25zZSA9IGF3YWl0IHByb21wdHMoXG4gICAge1xuICAgICAgbmFtZTogJ3ZhbHVlJyxcbiAgICAgIGNob2ljZXM6IHZhbGlkVGVtcGxhdGVzLm1hcCgocCkgPT4ge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGRlc2NyaXB0aW9uOiBwLmRlc2NyaXB0aW9uLFxuICAgICAgICAgIHRpdGxlOiBwLm5hbWUsXG4gICAgICAgICAgdmFsdWU6IHAubmFtZSxcbiAgICAgICAgfVxuICAgICAgfSksXG4gICAgICBtZXNzYWdlOiAn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SSxDQUFDQyxVQUFVLE1BQU0sSUFBSUksTUFBTTtRQUMvQixPQUFPSjtJQUNUO0lBRUEsTUFBTUssV0FBVyxNQUFNQyxJQUFBQSxnQkFBTyxFQUM1QjtRQUNFSCxNQUFNO1FBQ05JLFNBQVNULGVBQWVVLEdBQUcsQ0FBQyxDQUFDQztZQUMzQixPQUFPO2dCQUNMQyxhQUFhRCxFQUFFQyxXQUFXO2dCQUMxQkMsT0FBT0YsRUFBRU4sSUFBSTtnQkFDYlMsT0FBT0gsRUFBRU4sSUFBSTtZQUNmO1FBQ0Y7UUFDQVUsU0FBUztRQUNUQyxNQUFNO1FBQ05DLFVBQVUsQ0FBQ0gsUUFBa0IsQ0FBQyxDQUFDQSxNQUFNSSxNQUFNO0lBQzdDLEdBQ0E7UUFDRUMsVUFBVTtZQUNSQyxRQUFRQyxJQUFJLENBQUM7UUFDZjtJQUNGO0lBR0YsTUFBTW5CLFdBQVdGLGVBQWVHLElBQUksQ0FBQyxDQUFDQyxJQUFNQSxFQUFFQyxJQUFJLEtBQUtFLFNBQVNPLEtBQUs7SUFDckUsSUFBSSxDQUFDWixVQUFVLE1BQU0sSUFBSUksTUFBTTtJQUUvQixPQUFPSjtBQUNUIn0= | ||
//# sourceMappingURL=parse-template.js.map |
@@ -11,4 +11,4 @@ "use strict"; | ||
}); | ||
const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts")); | ||
const _slugify = /*#__PURE__*/ _interop_require_default(require("@sindresorhus/slugify")); | ||
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts")); | ||
function _interop_require_default(obj) { | ||
@@ -19,2 +19,43 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { | ||
if (typeof WeakMap !== "function") return null; | ||
var cacheBabelInterop = new WeakMap(); | ||
var cacheNodeInterop = new WeakMap(); | ||
return (_getRequireWildcardCache = function(nodeInterop) { | ||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop; | ||
})(nodeInterop); | ||
} | ||
function _interop_require_wildcard(obj, nodeInterop) { | ||
if (!nodeInterop && obj && obj.__esModule) { | ||
return obj; | ||
} | ||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") { | ||
return { | ||
default: obj | ||
}; | ||
} | ||
var cache = _getRequireWildcardCache(nodeInterop); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = { | ||
__proto__: null | ||
}; | ||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for(var key in obj){ | ||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
const dbChoiceRecord = { | ||
@@ -40,35 +81,35 @@ mongodb: { | ||
} else { | ||
const dbTypeRes = await (0, _prompts.default)({ | ||
name: 'value', | ||
choices: Object.values(dbChoiceRecord).map((dbChoice)=>{ | ||
return { | ||
title: dbChoice.title, | ||
value: dbChoice.value | ||
}; | ||
}), | ||
message: 'Select a database', | ||
type: 'select', | ||
validate: (value)=>!!value.length | ||
}, { | ||
onCancel: ()=>{ | ||
process.exit(0); | ||
} | ||
dbType = await _prompts.select({ | ||
initialValue: 'mongodb', | ||
message: `Select a database`, | ||
options: [ | ||
{ | ||
label: 'MongoDB', | ||
value: 'mongodb' | ||
}, | ||
{ | ||
label: 'Postgres', | ||
value: 'postgres' | ||
} | ||
] | ||
}); | ||
dbType = dbTypeRes.value; | ||
if (_prompts.isCancel(dbType)) process.exit(0); | ||
} | ||
const dbChoice = dbChoiceRecord[dbType]; | ||
const dbUriRes = await (0, _prompts.default)({ | ||
name: 'value', | ||
initial: `${dbChoice.dbConnectionPrefix}${projectName === '.' ? `payload-${getRandomDigitSuffix()}` : (0, _slugify.default)(projectName)}`, | ||
message: `Enter ${dbChoice.title.split(' ')[0]} connection string`, | ||
type: 'text', | ||
validate: (value)=>!!value.length | ||
}, { | ||
onCancel: ()=>{ | ||
process.exit(0); | ||
} | ||
}); | ||
let dbUri = undefined; | ||
const initialDbUri = `${dbChoice.dbConnectionPrefix}${projectName === '.' ? `payload-${getRandomDigitSuffix()}` : (0, _slugify.default)(projectName)}`; | ||
if (args['--db-accept-recommended']) { | ||
dbUri = initialDbUri; | ||
} else if (args['--db-connection-string']) { | ||
dbUri = args['--db-connection-string']; | ||
} else { | ||
dbUri = await _prompts.text({ | ||
initialValue: initialDbUri, | ||
message: `Enter ${dbChoice.title.split(' ')[0]} connection string` | ||
}); | ||
if (_prompts.isCancel(dbUri)) process.exit(0); | ||
} | ||
return { | ||
dbUri: dbUriRes.value, | ||
type: dbChoice.value | ||
type: dbChoice.value, | ||
dbUri | ||
}; | ||
@@ -80,2 +121,2 @@ } | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvc2VsZWN0LWRiLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzbHVnaWZ5IGZyb20gJ0BzaW5kcmVzb3JodXMvc2x1Z2lmeSdcbmltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgQ2xpQXJncywgRGJEZXRhaWxzLCBEYlR5cGUgfSBmcm9tICcuLi90eXBlcydcblxudHlwZSBEYkNob2ljZSA9IHtcbiAgZGJDb25uZWN0aW9uUHJlZml4OiBgJHtzdHJpbmd9L2BcbiAgdGl0bGU6IHN0cmluZ1xuICB2YWx1ZTogRGJUeXBlXG59XG5cbmNvbnN0IGRiQ2hvaWNlUmVjb3JkOiBSZWNvcmQ8RGJUeXBlLCBEYkNob2ljZT4gPSB7XG4gIG1vbmdvZGI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FNBQVNTLFVBQVViLEtBQUs7SUFDMUI7SUFFQSxNQUFNUyxXQUFXYixjQUFjLENBQUNRLE9BQU87SUFFdkMsTUFBTW9CLFdBQVcsTUFBTVYsSUFBQUEsZ0JBQU8sRUFDNUI7UUFDRUMsTUFBTTtRQUNOVSxTQUFTLENBQUMsRUFBRWhCLFNBQVNYLGtCQUFrQixDQUFDLEVBQ3RDSyxnQkFBZ0IsTUFBTSxDQUFDLFFBQVEsRUFBRXVCLHVCQUF1QixDQUFDLEdBQUdDLElBQUFBLGdCQUFPLEVBQUN4QixhQUNyRSxDQUFDO1FBQ0ZjLFNBQVMsQ0FBQyxNQUFNLEVBQUVSLFNBQVNWLEtBQUssQ0FBQzZCLEtBQUssQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLGtCQUFrQixDQUFDO1FBQ2xFVixNQUFNO1FBQ05DLFVBQVUsQ0FBQ25CLFFBQWtCLENBQUMsQ0FBQ0EsTUFBTW9CLE1BQU07SUFDN0MsR0FDQTtRQUNFQyxVQUFVO1lBQ1JDLFFBQVFDLElBQUksQ0FBQztRQUNmO0lBQ0Y7SUFHRixPQUFPO1FBQ0xNLE9BQU9MLFNBQVN4QixLQUFLO1FBQ3JCa0IsTUFBTVQsU0FBU1QsS0FBSztJQUN0QjtBQUNGO0FBRUEsU0FBUzBCO0lBQ1AsT0FBTyxBQUFDSSxDQUFBQSxLQUFLQyxNQUFNLEtBQUtELEtBQUtFLEdBQUcsQ0FBQyxJQUFJLEVBQUMsRUFBR0MsT0FBTyxDQUFDO0FBQ25EIn0= | ||
//# sourceMappingURL=select-db.js.map |
@@ -12,10 +12,10 @@ "use strict"; | ||
_export(exports, { | ||
getValidTemplates: function() { | ||
return getValidTemplates; | ||
}, | ||
validateTemplate: function() { | ||
return validateTemplate; | ||
}, | ||
getValidTemplates: function() { | ||
return getValidTemplates; | ||
} | ||
}); | ||
const _log = require("../utils/log"); | ||
const _log = require("../utils/log.js"); | ||
function validateTemplate(templateName) { | ||
@@ -33,5 +33,11 @@ const validTemplates = getValidTemplates(); | ||
{ | ||
name: 'blank-3.0', | ||
type: 'starter', | ||
description: 'Blank 3.0 Template', | ||
url: 'https://github.com/payloadcms/payload/templates/blank-3.0' | ||
}, | ||
{ | ||
name: 'blank', | ||
type: 'starter', | ||
description: 'Blank Template', | ||
type: 'starter', | ||
url: 'https://github.com/payloadcms/payload/templates/blank' | ||
@@ -41,4 +47,4 @@ }, | ||
name: 'website', | ||
type: 'starter', | ||
description: 'Website Template', | ||
type: 'starter', | ||
url: 'https://github.com/payloadcms/payload/templates/website' | ||
@@ -48,4 +54,4 @@ }, | ||
name: 'ecommerce', | ||
type: 'starter', | ||
description: 'E-commerce Template', | ||
type: 'starter', | ||
url: 'https://github.com/payloadcms/payload/templates/ecommerce' | ||
@@ -55,4 +61,4 @@ }, | ||
name: 'plugin', | ||
type: 'plugin', | ||
description: 'Template for creating a Payload plugin', | ||
type: 'plugin', | ||
url: 'https://github.com/payloadcms/payload-plugin-template' | ||
@@ -62,4 +68,4 @@ }, | ||
name: 'payload-demo', | ||
type: 'starter', | ||
description: 'Payload demo site at https://demo.payloadcms.com', | ||
type: 'starter', | ||
url: 'https://github.com/payloadcms/public-demo' | ||
@@ -69,4 +75,4 @@ }, | ||
name: 'payload-website', | ||
type: 'starter', | ||
description: 'Payload website CMS at https://payloadcms.com', | ||
type: 'starter', | ||
url: 'https://github.com/payloadcms/website-cms' | ||
@@ -77,2 +83,2 @@ } | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvdGVtcGxhdGVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgUHJvamVjdFRlbXBsYXRlIH0gZnJvbSAnLi4vdHlwZXMnXG5cbmltcG9ydCB7IGVycm9yLCBpbmZvIH0gZnJvbSAnLi4vdXRpbHMvbG9nJ1xuXG5leHBvcnQgZnVuY3Rpb24gdmFsaWRh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Q05DLEtBQUs7UUFDUDtLQUNEO0FBQ0gifQ== | ||
//# sourceMappingURL=templates.js.map |
@@ -13,3 +13,3 @@ "use strict"; | ||
const _path = /*#__PURE__*/ _interop_require_default(require("path")); | ||
const _log = require("../utils/log"); | ||
const _log = require("../utils/log.js"); | ||
function _interop_require_default(obj) { | ||
@@ -21,5 +21,9 @@ return obj && obj.__esModule ? obj : { | ||
async function writeEnvFile(args) { | ||
const { databaseUri, payloadSecret, projectDir, template } = args; | ||
const { cliArgs, databaseUri, payloadSecret, projectDir, template } = args; | ||
if (cliArgs['--dry-run']) { | ||
(0, _log.debug)(`DRY RUN: .env file created`); | ||
return; | ||
} | ||
try { | ||
if (template.type === 'starter' && _fsextra.default.existsSync(_path.default.join(projectDir, '.env.example'))) { | ||
if (template?.type === 'starter' && _fsextra.default.existsSync(_path.default.join(projectDir, '.env.example'))) { | ||
// Parse .env file into key/value pairs | ||
@@ -43,6 +47,5 @@ const envFile = await _fsextra.default.readFile(_path.default.join(projectDir, '.env.example'), 'utf8'); | ||
} else { | ||
const content = `MONGODB_URI=${databaseUri}\nPAYLOAD_SECRET=${payloadSecret}`; | ||
const content = `DATABASE_URI=${databaseUri}\nPAYLOAD_SECRET=${payloadSecret}`; | ||
await _fsextra.default.outputFile(`${projectDir}/.env`, content); | ||
} | ||
(0, _log.success)('.env file created'); | ||
} catch (err) { | ||
@@ -57,2 +60,2 @@ (0, _log.error)('Unable to write .env file'); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvd3JpdGUtZW52LWZpbGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGZzIGZyb20gJ2ZzLWV4dHJhJ1xuaW1wb3J0IHBhdGggZnJvbSAncGF0aCdcblxuaW1wb3J0IHR5cGUgeyBQcm9qZWN0VGVtcGxhdGUgfSBmcm9tICcuLi90eXBlcydcblxuaW1wb3J0IHsgZXJyb3IsIHN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
@@ -11,14 +11,20 @@ "use strict"; | ||
}); | ||
const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts")); | ||
const _slugify = /*#__PURE__*/ _interop_require_default(require("@sindresorhus/slugify")); | ||
const _arg = /*#__PURE__*/ _interop_require_default(require("arg")); | ||
const _commandexists = /*#__PURE__*/ _interop_require_default(require("command-exists")); | ||
const _createproject = require("./lib/create-project"); | ||
const _generatesecret = require("./lib/generate-secret"); | ||
const _parseprojectname = require("./lib/parse-project-name"); | ||
const _parsetemplate = require("./lib/parse-template"); | ||
const _selectdb = require("./lib/select-db"); | ||
const _templates = require("./lib/templates"); | ||
const _writeenvfile = require("./lib/write-env-file"); | ||
const _log = require("./utils/log"); | ||
const _messages = require("./utils/messages"); | ||
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk")); | ||
const _detectpackagemanager = require("detect-package-manager"); | ||
const _figures = /*#__PURE__*/ _interop_require_default(require("figures")); | ||
const _path = /*#__PURE__*/ _interop_require_default(require("path")); | ||
const _configurepayloadconfig = require("./lib/configure-payload-config.js"); | ||
const _createproject = require("./lib/create-project.js"); | ||
const _generatesecret = require("./lib/generate-secret.js"); | ||
const _initnext = require("./lib/init-next.js"); | ||
const _parseprojectname = require("./lib/parse-project-name.js"); | ||
const _parsetemplate = require("./lib/parse-template.js"); | ||
const _selectdb = require("./lib/select-db.js"); | ||
const _templates = require("./lib/templates.js"); | ||
const _writeenvfile = require("./lib/write-env-file.js"); | ||
const _log = require("./utils/log.js"); | ||
const _messages = require("./utils/messages.js"); | ||
function _interop_require_default(obj) { | ||
@@ -29,2 +35,43 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { | ||
if (typeof WeakMap !== "function") return null; | ||
var cacheBabelInterop = new WeakMap(); | ||
var cacheNodeInterop = new WeakMap(); | ||
return (_getRequireWildcardCache = function(nodeInterop) { | ||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop; | ||
})(nodeInterop); | ||
} | ||
function _interop_require_wildcard(obj, nodeInterop) { | ||
if (!nodeInterop && obj && obj.__esModule) { | ||
return obj; | ||
} | ||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") { | ||
return { | ||
default: obj | ||
}; | ||
} | ||
var cache = _getRequireWildcardCache(nodeInterop); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = { | ||
__proto__: null | ||
}; | ||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for(var key in obj){ | ||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
class Main { | ||
@@ -36,6 +83,12 @@ args; | ||
'--db': String, | ||
'--db-accept-recommended': Boolean, | ||
'--db-connection-string': String, | ||
'--help': Boolean, | ||
'--local-template': String, | ||
'--name': String, | ||
'--secret': String, | ||
'--template': String, | ||
'--template-branch': String, | ||
// Next.js | ||
'--init-next': Boolean, | ||
// Package manager | ||
@@ -48,2 +101,3 @@ '--no-deps': Boolean, | ||
'--beta': Boolean, | ||
'--debug': Boolean, | ||
'--dry-run': Boolean, | ||
@@ -62,5 +116,66 @@ // Aliases | ||
if (this.args['--help']) { | ||
console.log((0, _messages.helpMessage)()); | ||
(0, _messages.helpMessage)(); | ||
process.exit(0); | ||
} | ||
// eslint-disable-next-line no-console | ||
console.log('\n'); | ||
_prompts.intro(_chalk.default.bgCyan(_chalk.default.black(' create-payload-app '))); | ||
_prompts.note("Welcome to Payload. Let's create a project!"); | ||
// Detect if inside Next.js project | ||
const nextAppDetails = await (0, _initnext.getNextAppDetails)(process.cwd()); | ||
const { hasTopLevelLayout, nextAppDir, nextConfigPath } = nextAppDetails; | ||
if (nextConfigPath) { | ||
this.args['--name'] = (0, _slugify.default)(_path.default.basename(_path.default.dirname(nextConfigPath))); | ||
} | ||
const projectName = await (0, _parseprojectname.parseProjectName)(this.args); | ||
const projectDir = nextConfigPath ? _path.default.dirname(nextConfigPath) : _path.default.resolve(process.cwd(), (0, _slugify.default)(projectName)); | ||
const packageManager = await getPackageManager(this.args, projectDir); | ||
if (nextConfigPath) { | ||
_prompts.log.step(_chalk.default.bold(`${_chalk.default.bgBlack(` ${_figures.default.triangleUp} Next.js `)} project detected!`)); | ||
const proceed = await _prompts.confirm({ | ||
initialValue: true, | ||
message: _chalk.default.bold(`Install ${_chalk.default.green('Payload')} in this project?`) | ||
}); | ||
if (_prompts.isCancel(proceed) || !proceed) { | ||
_prompts.outro((0, _messages.feedbackOutro)()); | ||
process.exit(0); | ||
} | ||
// Check for top-level layout.tsx | ||
if (nextAppDir && hasTopLevelLayout) { | ||
_prompts.log.warn((0, _messages.moveMessage)({ | ||
nextAppDir, | ||
projectDir | ||
})); | ||
_prompts.outro((0, _messages.feedbackOutro)()); | ||
process.exit(0); | ||
} | ||
const dbDetails = await (0, _selectdb.selectDb)(this.args, projectName); | ||
const result = await (0, _initnext.initNext)({ | ||
...this.args, | ||
dbType: dbDetails.type, | ||
nextAppDetails, | ||
packageManager, | ||
projectDir | ||
}); | ||
if (result.success === false) { | ||
_prompts.outro((0, _messages.feedbackOutro)()); | ||
process.exit(1); | ||
} | ||
await (0, _configurepayloadconfig.configurePayloadConfig)({ | ||
dbDetails, | ||
projectDirOrConfigPath: { | ||
payloadConfigPath: result.payloadConfigPath | ||
} | ||
}); | ||
await (0, _writeenvfile.writeEnvFile)({ | ||
cliArgs: this.args, | ||
databaseUri: dbDetails.dbUri, | ||
payloadSecret: (0, _generatesecret.generateSecret)(), | ||
projectDir | ||
}); | ||
(0, _log.info)('Payload project successfully initialized!'); | ||
_prompts.note((0, _messages.successfulNextInit)(), _chalk.default.bgGreen(_chalk.default.black(' Documentation '))); | ||
_prompts.outro((0, _messages.feedbackOutro)()); | ||
return; | ||
} | ||
const templateArg = this.args['--template']; | ||
@@ -70,50 +185,56 @@ if (templateArg) { | ||
if (!valid) { | ||
console.log((0, _messages.helpMessage)()); | ||
(0, _messages.helpMessage)(); | ||
process.exit(1); | ||
} | ||
} | ||
console.log(_messages.welcomeMessage); | ||
const projectName = await (0, _parseprojectname.parseProjectName)(this.args); | ||
const validTemplates = (0, _templates.getValidTemplates)(); | ||
const template = await (0, _parsetemplate.parseTemplate)(this.args, validTemplates); | ||
const projectDir = projectName === '.' ? process.cwd() : `./${(0, _slugify.default)(projectName)}`; | ||
const packageManager = await getPackageManager(this.args); | ||
if (template.type !== 'plugin') { | ||
const dbDetails = await (0, _selectdb.selectDb)(this.args, projectName); | ||
const payloadSecret = (0, _generatesecret.generateSecret)(); | ||
if (!this.args['--dry-run']) { | ||
await (0, _createproject.createProject)({ | ||
cliArgs: this.args, | ||
dbDetails, | ||
packageManager, | ||
projectDir, | ||
projectName, | ||
template | ||
}); | ||
await (0, _writeenvfile.writeEnvFile)({ | ||
databaseUri: dbDetails.dbUri, | ||
payloadSecret, | ||
projectDir, | ||
template | ||
}); | ||
} | ||
} else { | ||
if (!this.args['--dry-run']) { | ||
await (0, _createproject.createProject)({ | ||
cliArgs: this.args, | ||
packageManager, | ||
projectDir, | ||
projectName, | ||
template | ||
}); | ||
} | ||
if (!template) { | ||
_prompts.log.error('Invalid template given'); | ||
_prompts.outro((0, _messages.feedbackOutro)()); | ||
process.exit(1); | ||
} | ||
(0, _log.success)('Payload project successfully created'); | ||
console.log((0, _messages.successMessage)(projectDir, packageManager)); | ||
} catch (error) { | ||
console.log(error); | ||
switch(template.type){ | ||
case 'starter': | ||
{ | ||
const dbDetails = await (0, _selectdb.selectDb)(this.args, projectName); | ||
const payloadSecret = (0, _generatesecret.generateSecret)(); | ||
await (0, _createproject.createProject)({ | ||
cliArgs: this.args, | ||
dbDetails, | ||
packageManager, | ||
projectDir, | ||
projectName, | ||
template | ||
}); | ||
await (0, _writeenvfile.writeEnvFile)({ | ||
cliArgs: this.args, | ||
databaseUri: dbDetails.dbUri, | ||
payloadSecret, | ||
projectDir, | ||
template | ||
}); | ||
break; | ||
} | ||
case 'plugin': | ||
{ | ||
await (0, _createproject.createProject)({ | ||
cliArgs: this.args, | ||
packageManager, | ||
projectDir, | ||
projectName, | ||
template | ||
}); | ||
break; | ||
} | ||
} | ||
(0, _log.info)('Payload project successfully created!'); | ||
_prompts.note((0, _messages.successMessage)(projectDir, packageManager), _chalk.default.bgGreen(_chalk.default.black(' Next Steps '))); | ||
_prompts.outro((0, _messages.feedbackOutro)()); | ||
} catch (err) { | ||
(0, _log.error)(err instanceof Error ? err.message : 'An error occurred'); | ||
} | ||
} | ||
} | ||
async function getPackageManager(args) { | ||
async function getPackageManager(args, projectDir) { | ||
let packageManager = 'npm'; | ||
@@ -127,11 +248,6 @@ if (args['--use-npm']) { | ||
} else { | ||
try { | ||
if (await (0, _commandexists.default)('yarn')) { | ||
packageManager = 'yarn'; | ||
} else if (await (0, _commandexists.default)('pnpm')) { | ||
packageManager = 'pnpm'; | ||
} | ||
} catch (error) { | ||
packageManager = 'npm'; | ||
} | ||
const detected = await (0, _detectpackagemanager.detect)({ | ||
cwd: projectDir | ||
}); | ||
packageManager = detected || 'npm'; | ||
} | ||
@@ -141,2 +257,2 @@ return packageManager; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tYWluLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzbHVnaWZ5IGZyb20gJ0BzaW5kcmVzb3JodXMvc2x1Z2lmeSdcbmltcG9ydCBhcmcgZnJvbSAnYXJnJ1xuaW1wb3J0IGNvbW1hbmRFeGlzdHMgZnJvbSAnY29tbWFuZC1leGlzdHMnXG5cbmltcG9ydCB0eXBlIHsgQ2xpQXJncywgUGFja2FnZU1hbmFnZXIgf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AgIC8vIFBhY2thZ2UgbWFuYWdlclxuICAgICAgICAnLS1uby1kZXBzJzogQm9vbGVhbixcbiAgICAgICAgJy0tdXNlLW5wbSc6IEJvb2xlYW4sXG4gICAgICAgICctLXVzZS1wbnBtJzogQm9vbGVhbixcbiAgICAgICAgJy0tdXNlLXlhcm4nOiBCb29sZWFuLFxuXG4gICAgICAgIC8vIEZsYWdzXG4gICAgICAgICctLWJldGEnOiBCb29sZWFuLFxuICAgICAgICAnLS1kcnktcnVuJzogQm9vbGVhbixcblxuICAgICAgICAvLyBBbGlhc2VzXG4gICAgICAgICctZCc6ICctLWRiJyxcbiAgICAgICAgJy1oJzogJy0taGVscCcsXG4gICAgICAgICctbic6ICctLW5hbWUnLFxuICAgICAgICAnLXQnOiAnLS10ZW1wbGF0ZScsXG4gICAgICB9LFxuICAgICAgeyBwZXJtaXNzaXZlOiB0cnVlIH0sXG4gICAgKVxuICB9XG5cbiAgYXN5bmMgaW5pdCgpOiBQcm9taXNlPHZvaWQ+IHtcbiAgICB0cnkge1xuICAgICAgaWYgKHRoaXMuYXJnc1snLS1oZWxwJ10pIHtcbiAgICAgICAgY29uc29sZS5sb2coaGVscE1lc3NhZ2UoKSlcbiAgICAgICAgcHJvY2Vzcy5leGl0KDApXG4gICAgICB9XG4gICAgICBjb25zdCB0ZW1wbGF0ZUFyZyA9IHRoaXMuYXJnc1snLS10ZW1wbGF0ZSddXG4gICAgICBpZiAodGVtcGxhdGVBcmcpIHtcbiAgICAgICAgY29uc3QgdmFsaWQgPSB2YWxpZGF0ZVRlbXBsYXRlKHRlbXBsYXRlQXJnKVxuICAgICAgICBpZiAoIXZhbGlkKSB7XG4gICAgICAgICAgY29uc29sZS5sb2coaGVscE1lc3NhZ2UoKSlcbiAgICAgICAgICBwcm9jZXNzLmV4aXQoMSlcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBjb25zb2xlLmxvZyh3ZWxjb21lTWVzc2FnZSlcbiAgICAgIGNvbnN0IHByb2plY3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QUNqQyxJQUFJO3dCQUNsQnlCO3dCQUNBSDt3QkFDQU47d0JBQ0FJO29CQUNGO2dCQUNGO1lBQ0Y7WUFFQWlCLElBQUFBLFlBQU8sRUFBQztZQUNSOUIsUUFBUUMsR0FBRyxDQUFDOEIsSUFBQUEsd0JBQWMsRUFBQ2hCLFlBQVlHO1FBQ3pDLEVBQUUsT0FBT2MsT0FBZ0I7WUFDdkJoQyxRQUFRQyxHQUFHLENBQUMrQjtRQUNkO0lBQ0Y7QUFDRjtBQUVBLGVBQWViLGtCQUFrQjFCLElBQWE7SUFDNUMsSUFBSXlCLGlCQUFpQztJQUVyQyxJQUFJekIsSUFBSSxDQUFDLFlBQVksRUFBRTtRQUNyQnlCLGlCQUFpQjtJQUNuQixPQUFPLElBQUl6QixJQUFJLENBQUMsYUFBYSxFQUFFO1FBQzdCeUIsaUJBQWlCO0lBQ25CLE9BQU8sSUFBSXpCLElBQUksQ0FBQyxhQUFhLEVBQUU7UUFDN0J5QixpQkFBaUI7SUFDbkIsT0FBTztRQUNMLElBQUk7WUFDRixJQUFJLE1BQU1lLElBQUFBLHNCQUFhLEVBQUMsU0FBUztnQkFDL0JmLGlCQUFpQjtZQUNuQixPQUFPLElBQUksTUFBTWUsSUFBQUEsc0JBQWEsRUFBQyxTQUFTO2dCQUN0Q2YsaUJBQWlCO1lBQ25CO1FBQ0YsRUFBRSxPQUFPYyxPQUFnQjtZQUN2QmQsaUJBQWlCO1FBQ25CO0lBQ0Y7SUFDQSxPQUFPQTtBQUNUIn0= | ||
//# sourceMappingURL=main.js.map |
@@ -6,2 +6,2 @@ "use strict"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9 | ||
//# sourceMappingURL=types.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
/* eslint-disable no-console */ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -12,7 +12,7 @@ value: true | ||
_export(exports, { | ||
success: function() { | ||
return success; | ||
debug: function() { | ||
return debug; | ||
}, | ||
warning: function() { | ||
return warning; | ||
error: function() { | ||
return error; | ||
}, | ||
@@ -22,8 +22,11 @@ info: function() { | ||
}, | ||
error: function() { | ||
return error; | ||
log: function() { | ||
return log; | ||
}, | ||
warning: function() { | ||
return warning; | ||
} | ||
}); | ||
const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts")); | ||
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk")); | ||
const _figures = /*#__PURE__*/ _interop_require_default(require("figures")); | ||
function _interop_require_default(obj) { | ||
@@ -34,15 +37,59 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
const success = (message)=>{ | ||
console.log(`${_chalk.default.green(_figures.default.tick)} ${_chalk.default.bold(message)}`); | ||
}; | ||
function _getRequireWildcardCache(nodeInterop) { | ||
if (typeof WeakMap !== "function") return null; | ||
var cacheBabelInterop = new WeakMap(); | ||
var cacheNodeInterop = new WeakMap(); | ||
return (_getRequireWildcardCache = function(nodeInterop) { | ||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop; | ||
})(nodeInterop); | ||
} | ||
function _interop_require_wildcard(obj, nodeInterop) { | ||
if (!nodeInterop && obj && obj.__esModule) { | ||
return obj; | ||
} | ||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") { | ||
return { | ||
default: obj | ||
}; | ||
} | ||
var cache = _getRequireWildcardCache(nodeInterop); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = { | ||
__proto__: null | ||
}; | ||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for(var key in obj){ | ||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
const warning = (message)=>{ | ||
console.log(_chalk.default.yellow('? ') + _chalk.default.bold(message)); | ||
_prompts.log.warn(_chalk.default.yellow('? ') + _chalk.default.bold(message)); | ||
}; | ||
const info = (message)=>{ | ||
console.log(`${_chalk.default.yellow(_figures.default.info)} ${_chalk.default.bold(message)}`); | ||
_prompts.log.step(_chalk.default.bold(message)); | ||
}; | ||
const error = (message)=>{ | ||
console.log(`${_chalk.default.red(_figures.default.cross)} ${_chalk.default.bold(message)}`); | ||
_prompts.log.error(_chalk.default.bold(message)); | ||
}; | ||
const debug = (message)=>{ | ||
_prompts.log.step(`${_chalk.default.bgGray('[DEBUG]')} ${_chalk.default.gray(message)}`); | ||
}; | ||
const log = (message)=>{ | ||
_prompts.log.message(message); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9sb2cudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNoYWxrIGZyb20gJ2NoYWxrJ1xuaW1wb3J0IGZpZ3VyZXMgZnJvbSAnZmlndXJlcydcblxuZXhwb3J0IGNvbnN0IHN1Y2Nlc3MgPSAobWVzc2FnZTogc3RyaW5nKTogdm9pZCA9PiB7XG4gIGNvbnNvbGUubG9nKGAke2NoYWxrLmdyZWVuKGZpZ3VyZXMudGljayl9ICR7Y2hhbGsuYm9sZChtZXNzYWdlKX1gKVxufVxuXG5leHBvcnQgY29uc3Qgd2FybmluZyA9IChtZXNzYWdlOiBzdHJpbmcpOiB2b2lkID0+IHtcbiAgY29uc29sZS5sb2coY2hhbGsueWVsbG93KCc/ICcpICsgY2hhbGsuYm9sZChtZXNzYWdlKSlcbn1cblxuZXhwb3J0IGNvbnN0IGluZm8gPSAobWVzc2FnZTogc3RyaW5nKTogdm9p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QkFBTyxDQUFDUCxJQUFJLEVBQUUsQ0FBQyxFQUFFSyxjQUFLLENBQUNJLElBQUksQ0FBQ1AsU0FBUyxDQUFDO0FBQ3BFO0FBRU8sTUFBTUQsUUFBUSxDQUFDQztJQUNwQkMsUUFBUUMsR0FBRyxDQUFDLENBQUMsRUFBRUMsY0FBSyxDQUFDTSxHQUFHLENBQUNKLGdCQUFPLENBQUNLLEtBQUssRUFBRSxDQUFDLEVBQUVQLGNBQUssQ0FBQ0ksSUFBSSxDQUFDUCxTQUFTLENBQUM7QUFDbEUifQ== | ||
//# sourceMappingURL=log.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
/* eslint-disable no-console */ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -12,4 +12,4 @@ value: true | ||
_export(exports, { | ||
welcomeMessage: function() { | ||
return welcomeMessage; | ||
feedbackOutro: function() { | ||
return feedbackOutro; | ||
}, | ||
@@ -19,11 +19,19 @@ helpMessage: function() { | ||
}, | ||
moveMessage: function() { | ||
return moveMessage; | ||
}, | ||
successMessage: function() { | ||
return successMessage; | ||
}, | ||
successfulNextInit: function() { | ||
return successfulNextInit; | ||
}, | ||
welcomeMessage: function() { | ||
return welcomeMessage; | ||
} | ||
}); | ||
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk")); | ||
const _figures = /*#__PURE__*/ _interop_require_default(require("figures")); | ||
const _path = /*#__PURE__*/ _interop_require_default(require("path")); | ||
const _terminallink = /*#__PURE__*/ _interop_require_default(require("terminal-link")); | ||
const _templates = require("../lib/templates"); | ||
const _templates = require("../lib/templates.js"); | ||
function _interop_require_default(obj) { | ||
@@ -34,3 +42,3 @@ return obj && obj.__esModule ? obj : { | ||
} | ||
const header = (message)=>`${_chalk.default.yellow(_figures.default.star)} ${_chalk.default.bold(message)}`; | ||
const header = (message)=>_chalk.default.bold(message); | ||
const welcomeMessage = (0, _chalk.default)` | ||
@@ -42,3 +50,3 @@ {green Welcome to Payload. Let's create a project! } | ||
const validTemplates = (0, _templates.getValidTemplates)(); | ||
return (0, _chalk.default)` | ||
console.log((0, _chalk.default)` | ||
{bold USAGE} | ||
@@ -48,3 +56,3 @@ | ||
{dim $} {bold npx create-payload-app} my-project | ||
{dim $} {bold npx create-payload-app} -n my-project -t blog | ||
{dim $} {bold npx create-payload-app} -n my-project -t template-name | ||
@@ -63,3 +71,3 @@ {bold OPTIONS} | ||
-h Show help | ||
`; | ||
`); | ||
} | ||
@@ -70,15 +78,38 @@ function formatTemplates(templates) { | ||
function successMessage(projectDir, packageManager) { | ||
const relativePath = _path.default.relative(process.cwd(), projectDir); | ||
return ` | ||
${header('Launch Application:')} | ||
${header('Launch Application:')} | ||
- cd ${projectDir} | ||
- ${packageManager === 'yarn' ? 'yarn' : 'npm run'} dev or follow directions in ${createTerminalLink('README.md', `file://${_path.default.resolve(projectDir, 'README.md')}`)} | ||
- cd ./${relativePath} | ||
- ${packageManager === 'npm' ? 'npm run' : packageManager} dev or follow directions in ${createTerminalLink('README.md', `file://${_path.default.resolve(projectDir, 'README.md')}`)} | ||
${header('Documentation:')} | ||
${header('Documentation:')} | ||
- ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')} | ||
- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')} | ||
- ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')} | ||
- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')} | ||
`; | ||
} | ||
function successfulNextInit() { | ||
return `- ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')} | ||
- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')} | ||
`; | ||
} | ||
function moveMessage(args) { | ||
const relativePath = _path.default.relative(process.cwd(), args.nextAppDir); | ||
return ` | ||
${header('Next Steps:')} | ||
Payload does not support a top-level layout.tsx file in the app directory. | ||
${_chalk.default.bold('To continue:')} | ||
Move all files from ./${relativePath} to a named directory such as ./${relativePath}/${_chalk.default.bold('(app)')} | ||
Once moved, rerun the create-payload-app command again. | ||
`; | ||
} | ||
function feedbackOutro() { | ||
return `${_chalk.default.bgCyan(_chalk.default.black(' Have feedback? '))} Visit us on ${createTerminalLink('GitHub', 'https://github.com/payloadcms/payload')}.`; | ||
} | ||
// Create terminalLink with fallback for unsupported terminals | ||
@@ -91,2 +122,2 @@ function createTerminalLink(text, url) { | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9tZXNzYWdlcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgY2hhbGsgZnJvbSAnY2hhbGsnXG5pbXBvcnQgZmlndXJlcyBmcm9tICdmaWd1cmVzJ1xuaW1wb3J0IHBhdGggZnJvbSAncGF0aCdcbmltcG9ydCB0ZXJtaW5hbExpbmsgZnJvbSAndGVybWluYWwtbGluaydcblxuaW1wb3J0IHR5cGUgeyBQcm9qZWN0VGVtcGxhdGUgfSBmcm9tICcuLi90eXBlcydcblxuaW1wb3J0IHsgZ2V0VmFsaWRUZW1wbGF0ZXMgfSBmcm9tICcuLi9saWIvdGVtcGxhdGVzJ1xuXG5jb25zdCBoZWFkZXIgPSAobWVzc2FnZTogc3RyaW5nKTogc3RyaW5nID0+IGAke2NoYWxrLnllbGxvdyhmaWd1cmVzLnN0YXIpfSAke2NoYWxrLmJvbGQobWVzc2FnZSl9YFxuXG5leHBvcnQgY29uc3Qgd2VsY29tZU1lc3NhZ2UgPSBjaGFsa2BcbiAge2dyZWVuIFdlbGNvbWUgdG8gUGF5bG9hZC4gTGV0J3MgY3JlYXRlIGEgcHJvamVjdCEgfVxuYFxuXG5jb25zdCBzcGFjZXIgPSAnICcucmVwZWF0KDgpXG5cbmV4cG9ydCBmdW5jdGlvbiBoZWxwTWVzc2FnZSgpOiBzdHJpbmcge1xuICBjb25zdCB2YWxpZFRlbXBsYXRlcyA9IG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QkFBbUIsaUJBQWlCLHNEQUFzRDs7QUFFbEcsQ0FBQztBQUNEO0FBRUEsOERBQThEO0FBQzlELFNBQVNBLG1CQUFtQkcsSUFBWSxFQUFFQyxHQUFXO0lBQ25ELE9BQU9DLElBQUFBLHFCQUFZLEVBQUNGLE1BQU1DLEtBQUs7UUFDN0JFLFVBQVUsQ0FBQ0gsTUFBTUMsTUFBUSxDQUFDLEVBQUVELEtBQUssRUFBRSxFQUFFQyxJQUFJLENBQUM7SUFDNUM7QUFDRiJ9 | ||
//# sourceMappingURL=messages.js.map |
{ | ||
"name": "create-payload-app", | ||
"version": "1.0.0", | ||
"version": "3.0.0-alpha.50", | ||
"license": "MIT", | ||
"type": "module", | ||
"homepage": "https://payloadcms.com", | ||
"bin": { | ||
"create-payload-app": "bin/cli.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/payloadcms/payload.git", | ||
"directory": "packages/create-payload-app" | ||
}, | ||
"files": [ | ||
@@ -14,2 +21,3 @@ "package.json", | ||
"dependencies": { | ||
"@clack/prompts": "^0.7.0", | ||
"@sindresorhus/slugify": "^1.1.0", | ||
@@ -19,9 +27,10 @@ "arg": "^5.0.0", | ||
"command-exists": "^1.2.9", | ||
"comment-json": "^4.2.3", | ||
"degit": "^2.8.4", | ||
"detect-package-manager": "^3.0.1", | ||
"esprima": "^4.0.1", | ||
"execa": "^5.0.0", | ||
"figures": "^3.2.0", | ||
"figures": "^6.1.0", | ||
"fs-extra": "^9.0.1", | ||
"handlebars": "^4.7.7", | ||
"ora": "^5.1.0", | ||
"prompts": "^2.4.2", | ||
"globby": "11.1.0", | ||
"terminal-link": "^2.1.1" | ||
@@ -32,14 +41,22 @@ }, | ||
"@types/degit": "^2.8.3", | ||
"@types/esprima": "^4.0.6", | ||
"@types/fs-extra": "^9.0.12", | ||
"@types/jest": "^27.0.3", | ||
"@types/node": "^16.6.2", | ||
"@types/prompts": "^2.4.1", | ||
"ts-jest": "^29.1.0" | ||
"@types/node": "^16.6.2" | ||
}, | ||
"exports": { | ||
"./commands": { | ||
"import": "./src/lib/init-next.ts", | ||
"require": "./src/lib/init-next.ts", | ||
"types": "./src/lib/init-next.ts" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "pnpm build:swc", | ||
"build": "pnpm pack-template-files && pnpm typecheck && pnpm build:swc", | ||
"typecheck": "tsc", | ||
"pack-template-files": "tsx src/scripts/pack-template-files.ts", | ||
"build:swc": "swc ./src -d ./dist --config-file .swcrc", | ||
"clean": "rimraf dist", | ||
"clean": "rimraf {dist,*.tsbuildinfo}", | ||
"test": "jest" | ||
} | ||
} |
@@ -13,3 +13,3 @@ # Create Payload App | ||
$ npx create-payload-app my-project | ||
$ npx create-payload-app -n my-project -t blog | ||
$ npx create-payload-app -n my-project -t website | ||
@@ -16,0 +16,0 @@ OPTIONS |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
168932
6
92
2072
Yes
14
9
1
+ Added@clack/prompts@^0.7.0
+ Addedcomment-json@^4.2.3
+ Addedesprima@^4.0.1
+ Addedglobby@11.1.0
+ Added@clack/core@0.3.5(transitive)
+ Added@clack/prompts@0.7.0(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Addedarray-timsort@1.0.3(transitive)
+ Addedarray-union@2.1.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedcomment-json@4.2.5(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddetect-package-manager@3.0.2(transitive)
+ Addeddir-glob@3.0.1(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedfast-glob@3.3.3(transitive)
+ Addedfastq@1.18.0(transitive)
+ Addedfigures@6.1.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedhas-own-prop@2.0.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-unicode-supported@2.1.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removedhandlebars@^4.7.7
- Removedora@^5.1.0
- Removedprompts@^2.4.2
- Removedansi-regex@5.0.1(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbl@4.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedcli-cursor@3.1.0(transitive)
- Removedcli-spinners@2.9.2(transitive)
- Removedclone@1.0.4(transitive)
- Removeddefaults@1.0.4(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfigures@3.2.0(transitive)
- Removedhandlebars@4.7.8(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-interactive@1.0.0(transitive)
- Removedis-unicode-supported@0.1.0(transitive)
- Removedkleur@3.0.3(transitive)
- Removedlog-symbols@4.1.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedneo-async@2.6.2(transitive)
- Removedora@5.4.1(transitive)
- Removedprompts@2.4.2(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedrestore-cursor@3.1.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removeduglify-js@3.19.3(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwcwidth@1.0.1(transitive)
- Removedwordwrap@1.0.0(transitive)
Updatedfigures@^6.1.0