create-payload-app 3.0.0-alpha.59 → 3.0.0-alpha.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/bin/cli.js +3 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +10 -9
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/configure-payload-config.js +12 -27
  7. package/dist/lib/configure-payload-config.js.map +1 -1
  8. package/dist/lib/create-project.js +32 -96
  9. package/dist/lib/create-project.js.map +1 -1
  10. package/dist/lib/create-project.spec.js +24 -33
  11. package/dist/lib/create-project.spec.js.map +1 -1
  12. package/dist/lib/generate-secret.js +3 -13
  13. package/dist/lib/generate-secret.js.map +1 -1
  14. package/dist/lib/init-next.js +40 -104
  15. package/dist/lib/init-next.js.map +1 -1
  16. package/dist/lib/packages.js +1 -11
  17. package/dist/lib/packages.js.map +1 -1
  18. package/dist/lib/parse-project-name.js +8 -64
  19. package/dist/lib/parse-project-name.js.map +1 -1
  20. package/dist/lib/parse-template.js +4 -55
  21. package/dist/lib/parse-template.js.map +1 -1
  22. package/dist/lib/select-db.js +8 -64
  23. package/dist/lib/select-db.js.map +1 -1
  24. package/dist/lib/templates.js +5 -23
  25. package/dist/lib/templates.js.map +1 -1
  26. package/dist/lib/wrap-next-config.js +18 -41
  27. package/dist/lib/wrap-next-config.js.map +1 -1
  28. package/dist/lib/wrap-next-config.spec.js +10 -55
  29. package/dist/lib/wrap-next-config.spec.js.map +1 -1
  30. package/dist/lib/write-env-file.js +11 -26
  31. package/dist/lib/write-env-file.js.map +1 -1
  32. package/dist/main.js +60 -115
  33. package/dist/main.js.map +1 -1
  34. package/dist/scripts/pack-template-files.js +15 -24
  35. package/dist/scripts/pack-template-files.js.map +1 -1
  36. package/dist/types.js +1 -4
  37. package/dist/types.js.map +1 -1
  38. package/dist/utils/copy-recursive-sync.js +11 -24
  39. package/dist/utils/copy-recursive-sync.js.map +1 -1
  40. package/dist/utils/log.js +12 -85
  41. package/dist/utils/log.js.map +1 -1
  42. package/dist/utils/messages.js +20 -55
  43. package/dist/utils/messages.js.map +1 -1
  44. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,82 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Main", {
6
- enumerable: true,
7
- get: function() {
8
- return Main;
9
- }
10
- });
11
- const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts"));
12
- const _slugify = /*#__PURE__*/ _interop_require_default(require("@sindresorhus/slugify"));
13
- const _arg = /*#__PURE__*/ _interop_require_default(require("arg"));
14
- const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
15
- const _detectpackagemanager = require("detect-package-manager");
16
- const _figures = /*#__PURE__*/ _interop_require_default(require("figures"));
17
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
18
- const _configurepayloadconfig = require("./lib/configure-payload-config.js");
19
- const _createproject = require("./lib/create-project.js");
20
- const _generatesecret = require("./lib/generate-secret.js");
21
- const _initnext = require("./lib/init-next.js");
22
- const _parseprojectname = require("./lib/parse-project-name.js");
23
- const _parsetemplate = require("./lib/parse-template.js");
24
- const _selectdb = require("./lib/select-db.js");
25
- const _templates = require("./lib/templates.js");
26
- const _writeenvfile = require("./lib/write-env-file.js");
27
- const _log = require("./utils/log.js");
28
- const _messages = require("./utils/messages.js");
29
- function _interop_require_default(obj) {
30
- return obj && obj.__esModule ? obj : {
31
- default: obj
32
- };
33
- }
34
- function _getRequireWildcardCache(nodeInterop) {
35
- if (typeof WeakMap !== "function") return null;
36
- var cacheBabelInterop = new WeakMap();
37
- var cacheNodeInterop = new WeakMap();
38
- return (_getRequireWildcardCache = function(nodeInterop) {
39
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
40
- })(nodeInterop);
41
- }
42
- function _interop_require_wildcard(obj, nodeInterop) {
43
- if (!nodeInterop && obj && obj.__esModule) {
44
- return obj;
45
- }
46
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
47
- return {
48
- default: obj
49
- };
50
- }
51
- var cache = _getRequireWildcardCache(nodeInterop);
52
- if (cache && cache.has(obj)) {
53
- return cache.get(obj);
54
- }
55
- var newObj = {
56
- __proto__: null
57
- };
58
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
59
- for(var key in obj){
60
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
61
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
62
- if (desc && (desc.get || desc.set)) {
63
- Object.defineProperty(newObj, key, desc);
64
- } else {
65
- newObj[key] = obj[key];
66
- }
67
- }
68
- }
69
- newObj.default = obj;
70
- if (cache) {
71
- cache.set(obj, newObj);
72
- }
73
- return newObj;
74
- }
75
- class Main {
1
+ import * as p from '@clack/prompts';
2
+ import slugify from '@sindresorhus/slugify';
3
+ import arg from 'arg';
4
+ import chalk from 'chalk';
5
+ // @ts-expect-error no types
6
+ import { detect } from 'detect-package-manager';
7
+ import figures from 'figures';
8
+ import path from 'path';
9
+ import { configurePayloadConfig } from './lib/configure-payload-config.js';
10
+ import { createProject } from './lib/create-project.js';
11
+ import { generateSecret } from './lib/generate-secret.js';
12
+ import { getNextAppDetails, initNext } from './lib/init-next.js';
13
+ import { parseProjectName } from './lib/parse-project-name.js';
14
+ import { parseTemplate } from './lib/parse-template.js';
15
+ import { selectDb } from './lib/select-db.js';
16
+ import { getValidTemplates, validateTemplate } from './lib/templates.js';
17
+ import { writeEnvFile } from './lib/write-env-file.js';
18
+ import { error, info } from './utils/log.js';
19
+ import { feedbackOutro, helpMessage, moveMessage, successMessage, successfulNextInit } from './utils/messages.js';
20
+ export class Main {
76
21
  args;
77
22
  constructor(){
78
23
  // @ts-expect-error bad typings
79
- this.args = (0, _arg.default)({
24
+ this.args = arg({
80
25
  '--db': String,
81
26
  '--db-accept-recommended': Boolean,
82
27
  '--db-connection-string': String,
@@ -109,43 +54,43 @@ class Main {
109
54
  async init() {
110
55
  try {
111
56
  if (this.args['--help']) {
112
- (0, _messages.helpMessage)();
57
+ helpMessage();
113
58
  process.exit(0);
114
59
  }
115
60
  // eslint-disable-next-line no-console
116
61
  console.log('\n');
117
- _prompts.intro(_chalk.default.bgCyan(_chalk.default.black(' create-payload-app ')));
118
- _prompts.note("Welcome to Payload. Let's create a project!");
62
+ p.intro(chalk.bgCyan(chalk.black(' create-payload-app ')));
63
+ p.note("Welcome to Payload. Let's create a project!");
119
64
  // Detect if inside Next.js project
120
- const nextAppDetails = await (0, _initnext.getNextAppDetails)(process.cwd());
65
+ const nextAppDetails = await getNextAppDetails(process.cwd());
121
66
  const { hasTopLevelLayout, nextAppDir, nextConfigPath } = nextAppDetails;
122
67
  if (nextConfigPath) {
123
- this.args['--name'] = (0, _slugify.default)(_path.default.basename(_path.default.dirname(nextConfigPath)));
68
+ this.args['--name'] = slugify(path.basename(path.dirname(nextConfigPath)));
124
69
  }
125
- const projectName = await (0, _parseprojectname.parseProjectName)(this.args);
126
- const projectDir = nextConfigPath ? _path.default.dirname(nextConfigPath) : _path.default.resolve(process.cwd(), (0, _slugify.default)(projectName));
70
+ const projectName = await parseProjectName(this.args);
71
+ const projectDir = nextConfigPath ? path.dirname(nextConfigPath) : path.resolve(process.cwd(), slugify(projectName));
127
72
  const packageManager = await getPackageManager(this.args, projectDir);
128
73
  if (nextConfigPath) {
129
- _prompts.log.step(_chalk.default.bold(`${_chalk.default.bgBlack(` ${_figures.default.triangleUp} Next.js `)} project detected!`));
130
- const proceed = await _prompts.confirm({
74
+ p.log.step(chalk.bold(`${chalk.bgBlack(` ${figures.triangleUp} Next.js `)} project detected!`));
75
+ const proceed = await p.confirm({
131
76
  initialValue: true,
132
- message: _chalk.default.bold(`Install ${_chalk.default.green('Payload')} in this project?`)
77
+ message: chalk.bold(`Install ${chalk.green('Payload')} in this project?`)
133
78
  });
134
- if (_prompts.isCancel(proceed) || !proceed) {
135
- _prompts.outro((0, _messages.feedbackOutro)());
79
+ if (p.isCancel(proceed) || !proceed) {
80
+ p.outro(feedbackOutro());
136
81
  process.exit(0);
137
82
  }
138
83
  // Check for top-level layout.tsx
139
84
  if (nextAppDir && hasTopLevelLayout) {
140
- _prompts.log.warn((0, _messages.moveMessage)({
85
+ p.log.warn(moveMessage({
141
86
  nextAppDir,
142
87
  projectDir
143
88
  }));
144
- _prompts.outro((0, _messages.feedbackOutro)());
89
+ p.outro(feedbackOutro());
145
90
  process.exit(0);
146
91
  }
147
- const dbDetails = await (0, _selectdb.selectDb)(this.args, projectName);
148
- const result = await (0, _initnext.initNext)({
92
+ const dbDetails = await selectDb(this.args, projectName);
93
+ const result = await initNext({
149
94
  ...this.args,
150
95
  dbType: dbDetails.type,
151
96
  nextAppDetails,
@@ -153,47 +98,47 @@ class Main {
153
98
  projectDir
154
99
  });
155
100
  if (result.success === false) {
156
- _prompts.outro((0, _messages.feedbackOutro)());
101
+ p.outro(feedbackOutro());
157
102
  process.exit(1);
158
103
  }
159
- await (0, _configurepayloadconfig.configurePayloadConfig)({
104
+ await configurePayloadConfig({
160
105
  dbDetails,
161
106
  projectDirOrConfigPath: {
162
107
  payloadConfigPath: result.payloadConfigPath
163
108
  }
164
109
  });
165
- await (0, _writeenvfile.writeEnvFile)({
110
+ await writeEnvFile({
166
111
  cliArgs: this.args,
167
112
  databaseUri: dbDetails.dbUri,
168
- payloadSecret: (0, _generatesecret.generateSecret)(),
113
+ payloadSecret: generateSecret(),
169
114
  projectDir
170
115
  });
171
- (0, _log.info)('Payload project successfully initialized!');
172
- _prompts.note((0, _messages.successfulNextInit)(), _chalk.default.bgGreen(_chalk.default.black(' Documentation ')));
173
- _prompts.outro((0, _messages.feedbackOutro)());
116
+ info('Payload project successfully initialized!');
117
+ p.note(successfulNextInit(), chalk.bgGreen(chalk.black(' Documentation ')));
118
+ p.outro(feedbackOutro());
174
119
  return;
175
120
  }
176
121
  const templateArg = this.args['--template'];
177
122
  if (templateArg) {
178
- const valid = (0, _templates.validateTemplate)(templateArg);
123
+ const valid = validateTemplate(templateArg);
179
124
  if (!valid) {
180
- (0, _messages.helpMessage)();
125
+ helpMessage();
181
126
  process.exit(1);
182
127
  }
183
128
  }
184
- const validTemplates = (0, _templates.getValidTemplates)();
185
- const template = await (0, _parsetemplate.parseTemplate)(this.args, validTemplates);
129
+ const validTemplates = getValidTemplates();
130
+ const template = await parseTemplate(this.args, validTemplates);
186
131
  if (!template) {
187
- _prompts.log.error('Invalid template given');
188
- _prompts.outro((0, _messages.feedbackOutro)());
132
+ p.log.error('Invalid template given');
133
+ p.outro(feedbackOutro());
189
134
  process.exit(1);
190
135
  }
191
136
  switch(template.type){
192
137
  case 'starter':
193
138
  {
194
- const dbDetails = await (0, _selectdb.selectDb)(this.args, projectName);
195
- const payloadSecret = (0, _generatesecret.generateSecret)();
196
- await (0, _createproject.createProject)({
139
+ const dbDetails = await selectDb(this.args, projectName);
140
+ const payloadSecret = generateSecret();
141
+ await createProject({
197
142
  cliArgs: this.args,
198
143
  dbDetails,
199
144
  packageManager,
@@ -201,7 +146,7 @@ class Main {
201
146
  projectName,
202
147
  template
203
148
  });
204
- await (0, _writeenvfile.writeEnvFile)({
149
+ await writeEnvFile({
205
150
  cliArgs: this.args,
206
151
  databaseUri: dbDetails.dbUri,
207
152
  payloadSecret,
@@ -212,7 +157,7 @@ class Main {
212
157
  }
213
158
  case 'plugin':
214
159
  {
215
- await (0, _createproject.createProject)({
160
+ await createProject({
216
161
  cliArgs: this.args,
217
162
  packageManager,
218
163
  projectDir,
@@ -222,11 +167,11 @@ class Main {
222
167
  break;
223
168
  }
224
169
  }
225
- (0, _log.info)('Payload project successfully created!');
226
- _prompts.note((0, _messages.successMessage)(projectDir, packageManager), _chalk.default.bgGreen(_chalk.default.black(' Next Steps ')));
227
- _prompts.outro((0, _messages.feedbackOutro)());
170
+ info('Payload project successfully created!');
171
+ p.note(successMessage(projectDir, packageManager), chalk.bgGreen(chalk.black(' Next Steps ')));
172
+ p.outro(feedbackOutro());
228
173
  } catch (err) {
229
- (0, _log.error)(err instanceof Error ? err.message : 'An error occurred');
174
+ error(err instanceof Error ? err.message : 'An error occurred');
230
175
  }
231
176
  }
232
177
  }
@@ -239,7 +184,7 @@ async function getPackageManager(args, projectDir) {
239
184
  } else if (args['--use-pnpm']) {
240
185
  packageManager = 'pnpm';
241
186
  } else {
242
- const detected = await (0, _detectpackagemanager.detect)({
187
+ const detected = await detect({
243
188
  cwd: projectDir
244
189
  });
245
190
  packageManager = detected || 'npm';
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.ts"],"sourcesContent":["import * as p from '@clack/prompts'\nimport slugify from '@sindresorhus/slugify'\nimport arg from 'arg'\nimport chalk from 'chalk'\n// @ts-expect-error no types\nimport { detect } from 'detect-package-manager'\nimport figures from 'figures'\nimport path from 'path'\n\nimport type { CliArgs, PackageManager } from './types.js'\n\nimport { configurePayloadConfig } from './lib/configure-payload-config.js'\nimport { createProject } from './lib/create-project.js'\nimport { generateSecret } from './lib/generate-secret.js'\nimport { getNextAppDetails, initNext } from './lib/init-next.js'\nimport { parseProjectName } from './lib/parse-project-name.js'\nimport { parseTemplate } from './lib/parse-template.js'\nimport { selectDb } from './lib/select-db.js'\nimport { getValidTemplates, validateTemplate } from './lib/templates.js'\nimport { writeEnvFile } from './lib/write-env-file.js'\nimport { error, info } from './utils/log.js'\nimport {\n feedbackOutro,\n helpMessage,\n moveMessage,\n successMessage,\n successfulNextInit,\n} from './utils/messages.js'\n\nexport class Main {\n args: CliArgs\n\n constructor() {\n // @ts-expect-error bad typings\n this.args = arg(\n {\n '--db': String,\n '--db-accept-recommended': Boolean,\n '--db-connection-string': String,\n '--help': Boolean,\n '--local-template': String,\n '--name': String,\n '--secret': String,\n '--template': String,\n '--template-branch': String,\n\n // Next.js\n '--init-next': Boolean, // TODO: Is this needed if we detect if inside Next.js project?\n\n // Package manager\n '--no-deps': Boolean,\n '--use-npm': Boolean,\n '--use-pnpm': Boolean,\n '--use-yarn': Boolean,\n\n // Flags\n '--beta': Boolean,\n '--debug': Boolean,\n '--dry-run': Boolean,\n\n // Aliases\n '-d': '--db',\n '-h': '--help',\n '-n': '--name',\n '-t': '--template',\n },\n { permissive: true },\n )\n }\n\n async init(): Promise<void> {\n try {\n if (this.args['--help']) {\n helpMessage()\n process.exit(0)\n }\n\n // eslint-disable-next-line no-console\n console.log('\\n')\n p.intro(chalk.bgCyan(chalk.black(' create-payload-app ')))\n p.note(\"Welcome to Payload. Let's create a project!\")\n\n // Detect if inside Next.js project\n const nextAppDetails = await getNextAppDetails(process.cwd())\n const { hasTopLevelLayout, nextAppDir, nextConfigPath } = nextAppDetails\n\n if (nextConfigPath) {\n this.args['--name'] = slugify(path.basename(path.dirname(nextConfigPath)))\n }\n\n const projectName = await parseProjectName(this.args)\n const projectDir = nextConfigPath\n ? path.dirname(nextConfigPath)\n : path.resolve(process.cwd(), slugify(projectName))\n\n const packageManager = await getPackageManager(this.args, projectDir)\n\n if (nextConfigPath) {\n p.log.step(\n chalk.bold(`${chalk.bgBlack(` ${figures.triangleUp} Next.js `)} project detected!`),\n )\n\n const proceed = await p.confirm({\n initialValue: true,\n message: chalk.bold(`Install ${chalk.green('Payload')} in this project?`),\n })\n if (p.isCancel(proceed) || !proceed) {\n p.outro(feedbackOutro())\n process.exit(0)\n }\n\n // Check for top-level layout.tsx\n if (nextAppDir && hasTopLevelLayout) {\n p.log.warn(moveMessage({ nextAppDir, projectDir }))\n p.outro(feedbackOutro())\n process.exit(0)\n }\n\n const dbDetails = await selectDb(this.args, projectName)\n\n const result = await initNext({\n ...this.args,\n dbType: dbDetails.type,\n nextAppDetails,\n packageManager,\n projectDir,\n })\n\n if (result.success === false) {\n p.outro(feedbackOutro())\n process.exit(1)\n }\n\n await configurePayloadConfig({\n dbDetails,\n projectDirOrConfigPath: {\n payloadConfigPath: result.payloadConfigPath,\n },\n })\n\n await writeEnvFile({\n cliArgs: this.args,\n databaseUri: dbDetails.dbUri,\n payloadSecret: generateSecret(),\n projectDir,\n })\n\n info('Payload project successfully initialized!')\n p.note(successfulNextInit(), chalk.bgGreen(chalk.black(' Documentation ')))\n p.outro(feedbackOutro())\n return\n }\n\n const templateArg = this.args['--template']\n if (templateArg) {\n const valid = validateTemplate(templateArg)\n if (!valid) {\n helpMessage()\n process.exit(1)\n }\n }\n\n const validTemplates = getValidTemplates()\n const template = await parseTemplate(this.args, validTemplates)\n if (!template) {\n p.log.error('Invalid template given')\n p.outro(feedbackOutro())\n process.exit(1)\n }\n\n switch (template.type) {\n case 'starter': {\n const dbDetails = await selectDb(this.args, projectName)\n const payloadSecret = generateSecret()\n await createProject({\n cliArgs: this.args,\n dbDetails,\n packageManager,\n projectDir,\n projectName,\n template,\n })\n await writeEnvFile({\n cliArgs: this.args,\n databaseUri: dbDetails.dbUri,\n payloadSecret,\n projectDir,\n template,\n })\n break\n }\n case 'plugin': {\n await createProject({\n cliArgs: this.args,\n packageManager,\n projectDir,\n projectName,\n template,\n })\n break\n }\n }\n\n info('Payload project successfully created!')\n p.note(successMessage(projectDir, packageManager), chalk.bgGreen(chalk.black(' Next Steps ')))\n p.outro(feedbackOutro())\n } catch (err: unknown) {\n error(err instanceof Error ? err.message : 'An error occurred')\n }\n }\n}\n\nasync function getPackageManager(args: CliArgs, projectDir: string): Promise<PackageManager> {\n let packageManager: PackageManager = 'npm'\n\n if (args['--use-npm']) {\n packageManager = 'npm'\n } else if (args['--use-yarn']) {\n packageManager = 'yarn'\n } else if (args['--use-pnpm']) {\n packageManager = 'pnpm'\n } else {\n const detected = await detect({ cwd: projectDir })\n packageManager = detected || 'npm'\n }\n return packageManager\n}\n"],"names":["Main","args","constructor","arg","String","Boolean","permissive","init","helpMessage","process","exit","console","log","p","intro","chalk","bgCyan","black","note","nextAppDetails","getNextAppDetails","cwd","hasTopLevelLayout","nextAppDir","nextConfigPath","slugify","path","basename","dirname","projectName","parseProjectName","projectDir","resolve","packageManager","getPackageManager","step","bold","bgBlack","figures","triangleUp","proceed","confirm","initialValue","message","green","isCancel","outro","feedbackOutro","warn","moveMessage","dbDetails","selectDb","result","initNext","dbType","type","success","configurePayloadConfig","projectDirOrConfigPath","payloadConfigPath","writeEnvFile","cliArgs","databaseUri","dbUri","payloadSecret","generateSecret","info","successfulNextInit","bgGreen","templateArg","valid","validateTemplate","validTemplates","getValidTemplates","template","parseTemplate","error","createProject","successMessage","err","Error","detected","detect"],"mappings":";;;;+BA6BaA;;;eAAAA;;;iEA7BM;gEACC;4DACJ;8DACE;sCAEK;gEACH;6DACH;wCAIsB;+BACT;gCACC;0BACa;kCACX;+BACH;0BACL;2BAC2B;8BACvB;qBACD;0BAOrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAMA;IACXC,KAAa;IAEbC,aAAc;QACZ,+BAA+B;QAC/B,IAAI,CAACD,IAAI,GAAGE,IAAAA,YAAG,EACb;YACE,QAAQC;YACR,2BAA2BC;YAC3B,0BAA0BD;YAC1B,UAAUC;YACV,oBAAoBD;YACpB,UAAUA;YACV,YAAYA;YACZ,cAAcA;YACd,qBAAqBA;YAErB,UAAU;YACV,eAAeC;YAEf,kBAAkB;YAClB,aAAaA;YACb,aAAaA;YACb,cAAcA;YACd,cAAcA;YAEd,QAAQ;YACR,UAAUA;YACV,WAAWA;YACX,aAAaA;YAEb,UAAU;YACV,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM;QACR,GACA;YAAEC,YAAY;QAAK;IAEvB;IAEA,MAAMC,OAAsB;QAC1B,IAAI;YACF,IAAI,IAAI,CAACN,IAAI,CAAC,SAAS,EAAE;gBACvBO,IAAAA,qBAAW;gBACXC,QAAQC,IAAI,CAAC;YACf;YAEA,sCAAsC;YACtCC,QAAQC,GAAG,CAAC;YACZC,SAAEC,KAAK,CAACC,cAAK,CAACC,MAAM,CAACD,cAAK,CAACE,KAAK,CAAC;YACjCJ,SAAEK,IAAI,CAAC;YAEP,mCAAmC;YACnC,MAAMC,iBAAiB,MAAMC,IAAA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iBAAiBgD,YAAY;IAC/B;IACA,OAAOhD;AACT"}
1
+ {"version":3,"sources":["../src/main.ts"],"sourcesContent":["import * as p from '@clack/prompts'\nimport slugify from '@sindresorhus/slugify'\nimport arg from 'arg'\nimport chalk from 'chalk'\n// @ts-expect-error no types\nimport { detect } from 'detect-package-manager'\nimport figures from 'figures'\nimport path from 'path'\n\nimport type { CliArgs, PackageManager } from './types.js'\n\nimport { configurePayloadConfig } from './lib/configure-payload-config.js'\nimport { createProject } from './lib/create-project.js'\nimport { generateSecret } from './lib/generate-secret.js'\nimport { getNextAppDetails, initNext } from './lib/init-next.js'\nimport { parseProjectName } from './lib/parse-project-name.js'\nimport { parseTemplate } from './lib/parse-template.js'\nimport { selectDb } from './lib/select-db.js'\nimport { getValidTemplates, validateTemplate } from './lib/templates.js'\nimport { writeEnvFile } from './lib/write-env-file.js'\nimport { error, info } from './utils/log.js'\nimport {\n feedbackOutro,\n helpMessage,\n moveMessage,\n successMessage,\n successfulNextInit,\n} from './utils/messages.js'\n\nexport class Main {\n args: CliArgs\n\n constructor() {\n // @ts-expect-error bad typings\n this.args = arg(\n {\n '--db': String,\n '--db-accept-recommended': Boolean,\n '--db-connection-string': String,\n '--help': Boolean,\n '--local-template': String,\n '--name': String,\n '--secret': String,\n '--template': String,\n '--template-branch': String,\n\n // Next.js\n '--init-next': Boolean, // TODO: Is this needed if we detect if inside Next.js project?\n\n // Package manager\n '--no-deps': Boolean,\n '--use-npm': Boolean,\n '--use-pnpm': Boolean,\n '--use-yarn': Boolean,\n\n // Flags\n '--beta': Boolean,\n '--debug': Boolean,\n '--dry-run': Boolean,\n\n // Aliases\n '-d': '--db',\n '-h': '--help',\n '-n': '--name',\n '-t': '--template',\n },\n { permissive: true },\n )\n }\n\n async init(): Promise<void> {\n try {\n if (this.args['--help']) {\n helpMessage()\n process.exit(0)\n }\n\n // eslint-disable-next-line no-console\n console.log('\\n')\n p.intro(chalk.bgCyan(chalk.black(' create-payload-app ')))\n p.note(\"Welcome to Payload. Let's create a project!\")\n\n // Detect if inside Next.js project\n const nextAppDetails = await getNextAppDetails(process.cwd())\n const { hasTopLevelLayout, nextAppDir, nextConfigPath } = nextAppDetails\n\n if (nextConfigPath) {\n this.args['--name'] = slugify(path.basename(path.dirname(nextConfigPath)))\n }\n\n const projectName = await parseProjectName(this.args)\n const projectDir = nextConfigPath\n ? path.dirname(nextConfigPath)\n : path.resolve(process.cwd(), slugify(projectName))\n\n const packageManager = await getPackageManager(this.args, projectDir)\n\n if (nextConfigPath) {\n p.log.step(\n chalk.bold(`${chalk.bgBlack(` ${figures.triangleUp} Next.js `)} project detected!`),\n )\n\n const proceed = await p.confirm({\n initialValue: true,\n message: chalk.bold(`Install ${chalk.green('Payload')} in this project?`),\n })\n if (p.isCancel(proceed) || !proceed) {\n p.outro(feedbackOutro())\n process.exit(0)\n }\n\n // Check for top-level layout.tsx\n if (nextAppDir && hasTopLevelLayout) {\n p.log.warn(moveMessage({ nextAppDir, projectDir }))\n p.outro(feedbackOutro())\n process.exit(0)\n }\n\n const dbDetails = await selectDb(this.args, projectName)\n\n const result = await initNext({\n ...this.args,\n dbType: dbDetails.type,\n nextAppDetails,\n packageManager,\n projectDir,\n })\n\n if (result.success === false) {\n p.outro(feedbackOutro())\n process.exit(1)\n }\n\n await configurePayloadConfig({\n dbDetails,\n projectDirOrConfigPath: {\n payloadConfigPath: result.payloadConfigPath,\n },\n })\n\n await writeEnvFile({\n cliArgs: this.args,\n databaseUri: dbDetails.dbUri,\n payloadSecret: generateSecret(),\n projectDir,\n })\n\n info('Payload project successfully initialized!')\n p.note(successfulNextInit(), chalk.bgGreen(chalk.black(' Documentation ')))\n p.outro(feedbackOutro())\n return\n }\n\n const templateArg = this.args['--template']\n if (templateArg) {\n const valid = validateTemplate(templateArg)\n if (!valid) {\n helpMessage()\n process.exit(1)\n }\n }\n\n const validTemplates = getValidTemplates()\n const template = await parseTemplate(this.args, validTemplates)\n if (!template) {\n p.log.error('Invalid template given')\n p.outro(feedbackOutro())\n process.exit(1)\n }\n\n switch (template.type) {\n case 'starter': {\n const dbDetails = await selectDb(this.args, projectName)\n const payloadSecret = generateSecret()\n await createProject({\n cliArgs: this.args,\n dbDetails,\n packageManager,\n projectDir,\n projectName,\n template,\n })\n await writeEnvFile({\n cliArgs: this.args,\n databaseUri: dbDetails.dbUri,\n payloadSecret,\n projectDir,\n template,\n })\n break\n }\n case 'plugin': {\n await createProject({\n cliArgs: this.args,\n packageManager,\n projectDir,\n projectName,\n template,\n })\n break\n }\n }\n\n info('Payload project successfully created!')\n p.note(successMessage(projectDir, packageManager), chalk.bgGreen(chalk.black(' Next Steps ')))\n p.outro(feedbackOutro())\n } catch (err: unknown) {\n error(err instanceof Error ? err.message : 'An error occurred')\n }\n }\n}\n\nasync function getPackageManager(args: CliArgs, projectDir: string): Promise<PackageManager> {\n let packageManager: PackageManager = 'npm'\n\n if (args['--use-npm']) {\n packageManager = 'npm'\n } else if (args['--use-yarn']) {\n packageManager = 'yarn'\n } else if (args['--use-pnpm']) {\n packageManager = 'pnpm'\n } else {\n const detected = await detect({ cwd: projectDir })\n packageManager = detected || 'npm'\n }\n return packageManager\n}\n"],"names":["p","slugify","arg","chalk","detect","figures","path","configurePayloadConfig","createProject","generateSecret","getNextAppDetails","initNext","parseProjectName","parseTemplate","selectDb","getValidTemplates","validateTemplate","writeEnvFile","error","info","feedbackOutro","helpMessage","moveMessage","successMessage","successfulNextInit","Main","args","constructor","String","Boolean","permissive","init","process","exit","console","log","intro","bgCyan","black","note","nextAppDetails","cwd","hasTopLevelLayout","nextAppDir","nextConfigPath","basename","dirname","projectName","projectDir","resolve","packageManager","getPackageManager","step","bold","bgBlack","triangleUp","proceed","confirm","initialValue","message","green","isCancel","outro","warn","dbDetails","result","dbType","type","success","projectDirOrConfigPath","payloadConfigPath","cliArgs","databaseUri","dbUri","payloadSecret","bgGreen","templateArg","valid","validTemplates","template","err","Error","detected"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -1,18 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
6
- const _promises = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
7
- const _nodeurl = require("node:url");
8
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
9
- function _interop_require_default(obj) {
10
- return obj && obj.__esModule ? obj : {
11
- default: obj
12
- };
13
- }
14
- const filename = (0, _nodeurl.fileURLToPath)(require("url").pathToFileURL(__filename).toString());
15
- const dirname = _path.default.dirname(filename);
1
+ import fs from 'fs';
2
+ import fsp from 'fs/promises';
3
+ import { fileURLToPath } from 'node:url';
4
+ import path from 'path';
5
+ const filename = fileURLToPath(import.meta.url);
6
+ const dirname = path.dirname(filename);
16
7
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
17
8
  main();
18
9
  /**
@@ -20,22 +11,22 @@ main();
20
11
  *
21
12
  * Eventually, this should be replaced with using tar.x to stream from the git repo
22
13
  */ async function main() {
23
- const root = _path.default.resolve(dirname, '../../../../');
24
- const outputPath = _path.default.resolve(dirname, '../../dist/template');
25
- const sourceTemplatePath = _path.default.resolve(root, 'templates/blank-3.0');
26
- if (!_fs.default.existsSync(sourceTemplatePath)) {
14
+ const root = path.resolve(dirname, '../../../../');
15
+ const outputPath = path.resolve(dirname, '../../dist/template');
16
+ const sourceTemplatePath = path.resolve(root, 'templates/blank-3.0');
17
+ if (!fs.existsSync(sourceTemplatePath)) {
27
18
  throw new Error(`Source path does not exist: ${sourceTemplatePath}`);
28
19
  }
29
- if (!_fs.default.existsSync(outputPath)) {
30
- _fs.default.mkdirSync(outputPath, {
20
+ if (!fs.existsSync(outputPath)) {
21
+ fs.mkdirSync(outputPath, {
31
22
  recursive: true
32
23
  });
33
24
  }
34
25
  // Copy the src directory from `templates/blank-3.0` to `dist`
35
- const srcPath = _path.default.resolve(sourceTemplatePath, 'src');
36
- const distSrcPath = _path.default.resolve(outputPath, 'src');
26
+ const srcPath = path.resolve(sourceTemplatePath, 'src');
27
+ const distSrcPath = path.resolve(outputPath, 'src');
37
28
  // Copy entire file structure from src to dist
38
- await _promises.default.cp(srcPath, distSrcPath, {
29
+ await fsp.cp(srcPath, distSrcPath, {
39
30
  recursive: true
40
31
  });
41
32
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/scripts/pack-template-files.ts"],"sourcesContent":["import fs from 'fs'\nimport fsp from 'fs/promises'\nimport { fileURLToPath } from 'node:url'\nimport path from 'path'\nconst filename = fileURLToPath(import.meta.url)\nconst dirname = path.dirname(filename)\n\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\nmain()\n\n/**\n * Copy the necessary template files from `templates/blank-3.0` to `dist/template`\n *\n * Eventually, this should be replaced with using tar.x to stream from the git repo\n */\n\nasync function main() {\n const root = path.resolve(dirname, '../../../../')\n const outputPath = path.resolve(dirname, '../../dist/template')\n const sourceTemplatePath = path.resolve(root, 'templates/blank-3.0')\n\n if (!fs.existsSync(sourceTemplatePath)) {\n throw new Error(`Source path does not exist: ${sourceTemplatePath}`)\n }\n\n if (!fs.existsSync(outputPath)) {\n fs.mkdirSync(outputPath, { recursive: true })\n }\n\n // Copy the src directory from `templates/blank-3.0` to `dist`\n const srcPath = path.resolve(sourceTemplatePath, 'src')\n const distSrcPath = path.resolve(outputPath, 'src')\n // Copy entire file structure from src to dist\n await fsp.cp(srcPath, distSrcPath, { recursive: true })\n}\n"],"names":["filename","fileURLToPath","dirname","path","main","root","resolve","outputPath","sourceTemplatePath","fs","existsSync","Error","mkdirSync","recursive","srcPath","distSrcPath","fsp","cp"],"mappings":";;;;2DAAe;iEACC;yBACc;6DACb;;;;;;AACjB,MAAMA,WAAWC,IAAAA,sBAAa,EAAC;AAC/B,MAAMC,UAAUC,aAAI,CAACD,OAAO,CAACF;AAE7B,mEAAmE;AACnEI;AAEA;;;;CAIC,GAED,eAAeA;IACb,MAAMC,OAAOF,aAAI,CAACG,OAAO,CAACJ,SAAS;IACnC,MAAMK,aAAaJ,aAAI,CAACG,OAAO,CAACJ,SAAS;IACzC,MAAMM,qBAAqBL,aAAI,CAACG,OAAO,CAACD,MAAM;IAE9C,IAAI,CAACI,WAAE,CAACC,UAAU,CAACF,qBAAqB;QACtC,MAAM,IAAIG,MAAM,CAAC,4BAA4B,EAAEH,mBAAmB,CAAC;IACrE;IAEA,IAAI,CAACC,WAAE,CAACC,UAAU,CAACH,aAAa;QAC9BE,WAAE,CAACG,SAAS,CAACL,YAAY;YAAEM,WAAW;QAAK;IAC7C;IAEA,8DAA8D;IAC9D,MAAMC,UAAUX,aAAI,CAACG,OAAO,CAACE,oBAAoB;IACjD,MAAMO,cAAcZ,aAAI,CAACG,OAAO,CAACC,YAAY;IAC7C,8CAA8C;IAC9C,MAAMS,iBAAG,CAACC,EAAE,CAACH,SAASC,aAAa;QAAEF,WAAW;IAAK;AACvD"}
1
+ {"version":3,"sources":["../../src/scripts/pack-template-files.ts"],"sourcesContent":["import fs from 'fs'\nimport fsp from 'fs/promises'\nimport { fileURLToPath } from 'node:url'\nimport path from 'path'\nconst filename = fileURLToPath(import.meta.url)\nconst dirname = path.dirname(filename)\n\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\nmain()\n\n/**\n * Copy the necessary template files from `templates/blank-3.0` to `dist/template`\n *\n * Eventually, this should be replaced with using tar.x to stream from the git repo\n */\n\nasync function main() {\n const root = path.resolve(dirname, '../../../../')\n const outputPath = path.resolve(dirname, '../../dist/template')\n const sourceTemplatePath = path.resolve(root, 'templates/blank-3.0')\n\n if (!fs.existsSync(sourceTemplatePath)) {\n throw new Error(`Source path does not exist: ${sourceTemplatePath}`)\n }\n\n if (!fs.existsSync(outputPath)) {\n fs.mkdirSync(outputPath, { recursive: true })\n }\n\n // Copy the src directory from `templates/blank-3.0` to `dist`\n const srcPath = path.resolve(sourceTemplatePath, 'src')\n const distSrcPath = path.resolve(outputPath, 'src')\n // Copy entire file structure from src to dist\n await fsp.cp(srcPath, distSrcPath, { recursive: true })\n}\n"],"names":["fs","fsp","fileURLToPath","path","filename","url","dirname","main","root","resolve","outputPath","sourceTemplatePath","existsSync","Error","mkdirSync","recursive","srcPath","distSrcPath","cp"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,SAAS,cAAa;AAC7B,SAASC,aAAa,QAAQ,WAAU;AACxC,OAAOC,UAAU,OAAM;AACvB,MAAMC,WAAWF,cAAc,YAAYG,GAAG;AAC9C,MAAMC,UAAUH,KAAKG,OAAO,CAACF;AAE7B,mEAAmE;AACnEG;AAEA;;;;CAIC,GAED,eAAeA;IACb,MAAMC,OAAOL,KAAKM,OAAO,CAACH,SAAS;IACnC,MAAMI,aAAaP,KAAKM,OAAO,CAACH,SAAS;IACzC,MAAMK,qBAAqBR,KAAKM,OAAO,CAACD,MAAM;IAE9C,IAAI,CAACR,GAAGY,UAAU,CAACD,qBAAqB;QACtC,MAAM,IAAIE,MAAM,CAAC,4BAA4B,EAAEF,mBAAmB,CAAC;IACrE;IAEA,IAAI,CAACX,GAAGY,UAAU,CAACF,aAAa;QAC9BV,GAAGc,SAAS,CAACJ,YAAY;YAAEK,WAAW;QAAK;IAC7C;IAEA,8DAA8D;IAC9D,MAAMC,UAAUb,KAAKM,OAAO,CAACE,oBAAoB;IACjD,MAAMM,cAAcd,KAAKM,OAAO,CAACC,YAAY;IAC7C,8CAA8C;IAC9C,MAAMT,IAAIiB,EAAE,CAACF,SAASC,aAAa;QAAEF,WAAW;IAAK;AACvD"}
package/dist/types.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
1
+ export { };
5
2
 
6
3
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type arg from 'arg'\n\nexport interface Args extends arg.Spec {\n '--beta': BooleanConstructor\n '--db': StringConstructor\n '--db-accept-recommended': BooleanConstructor\n '--db-connection-string': StringConstructor\n '--debug': BooleanConstructor\n '--dry-run': BooleanConstructor\n '--help': BooleanConstructor\n '--init-next': BooleanConstructor\n '--local-template': StringConstructor\n '--name': StringConstructor\n '--no-deps': BooleanConstructor\n '--secret': StringConstructor\n '--template': StringConstructor\n '--template-branch': StringConstructor\n '--use-npm': BooleanConstructor\n '--use-pnpm': BooleanConstructor\n '--use-yarn': BooleanConstructor\n\n // Aliases\n\n '-h': string\n '-n': string\n '-t': string\n}\n\nexport type CliArgs = arg.Result<Args>\n\nexport type ProjectTemplate = GitTemplate | PluginTemplate\n\n/**\n * Template that is cloned verbatim from a git repo\n * Performs .env manipulation based upon input\n */\nexport interface GitTemplate extends Template {\n type: 'starter'\n url: string\n}\n\n/**\n * Type specifically for the plugin template\n * No .env manipulation is done\n */\nexport interface PluginTemplate extends Template {\n type: 'plugin'\n url: string\n}\n\ninterface Template {\n description?: string\n name: string\n type: ProjectTemplate['type']\n}\n\nexport type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn'\n\nexport type DbType = 'mongodb' | 'postgres'\n\nexport type DbDetails = {\n dbUri: string\n type: DbType\n}\n\nexport type EditorType = 'lexical' | 'slate'\n"],"names":[],"rangeMappings":"","mappings":"AAiEA,WAA4C"}
@@ -1,33 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "copyRecursiveSync", {
6
- enumerable: true,
7
- get: function() {
8
- return copyRecursiveSync;
9
- }
10
- });
11
- const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- function copyRecursiveSync(src, dest, debug) {
19
- const exists = _fs.default.existsSync(src);
20
- const stats = exists && _fs.default.statSync(src);
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ /**
4
+ * Recursively copy files from src to dest
5
+ */ export function copyRecursiveSync(src, dest, debug) {
6
+ const exists = fs.existsSync(src);
7
+ const stats = exists && fs.statSync(src);
21
8
  const isDirectory = exists && stats !== false && stats.isDirectory();
22
9
  if (isDirectory) {
23
- _fs.default.mkdirSync(dest, {
10
+ fs.mkdirSync(dest, {
24
11
  recursive: true
25
12
  });
26
- _fs.default.readdirSync(src).forEach((childItemName)=>{
27
- copyRecursiveSync(_path.default.join(src, childItemName), _path.default.join(dest, childItemName));
13
+ fs.readdirSync(src).forEach((childItemName)=>{
14
+ copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
28
15
  });
29
16
  } else {
30
- _fs.default.copyFileSync(src, dest);
17
+ fs.copyFileSync(src, dest);
31
18
  }
32
19
  }
33
20
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/copy-recursive-sync.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\n\n/**\n * Recursively copy files from src to dest\n */\nexport function copyRecursiveSync(src: string, dest: string, debug?: boolean) {\n const exists = fs.existsSync(src)\n const stats = exists && fs.statSync(src)\n const isDirectory = exists && stats !== false && stats.isDirectory()\n if (isDirectory) {\n fs.mkdirSync(dest, { recursive: true })\n fs.readdirSync(src).forEach((childItemName) => {\n copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))\n })\n } else {\n fs.copyFileSync(src, dest)\n }\n}\n"],"names":["copyRecursiveSync","src","dest","debug","exists","fs","existsSync","stats","statSync","isDirectory","mkdirSync","recursive","readdirSync","forEach","childItemName","path","join","copyFileSync"],"mappings":";;;;+BAMgBA;;;eAAAA;;;2DAND;6DACE;;;;;;AAKV,SAASA,kBAAkBC,GAAW,EAAEC,IAAY,EAAEC,KAAe;IAC1E,MAAMC,SAASC,WAAE,CAACC,UAAU,CAACL;IAC7B,MAAMM,QAAQH,UAAUC,WAAE,CAACG,QAAQ,CAACP;IACpC,MAAMQ,cAAcL,UAAUG,UAAU,SAASA,MAAME,WAAW;IAClE,IAAIA,aAAa;QACfJ,WAAE,CAACK,SAAS,CAACR,MAAM;YAAES,WAAW;QAAK;QACrCN,WAAE,CAACO,WAAW,CAACX,KAAKY,OAAO,CAAC,CAACC;YAC3Bd,kBAAkBe,aAAI,CAACC,IAAI,CAACf,KAAKa,gBAAgBC,aAAI,CAACC,IAAI,CAACd,MAAMY;QACnE;IACF,OAAO;QACLT,WAAE,CAACY,YAAY,CAAChB,KAAKC;IACvB;AACF"}
1
+ {"version":3,"sources":["../../src/utils/copy-recursive-sync.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\n\n/**\n * Recursively copy files from src to dest\n */\nexport function copyRecursiveSync(src: string, dest: string, debug?: boolean) {\n const exists = fs.existsSync(src)\n const stats = exists && fs.statSync(src)\n const isDirectory = exists && stats !== false && stats.isDirectory()\n if (isDirectory) {\n fs.mkdirSync(dest, { recursive: true })\n fs.readdirSync(src).forEach((childItemName) => {\n copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))\n })\n } else {\n fs.copyFileSync(src, dest)\n }\n}\n"],"names":["fs","path","copyRecursiveSync","src","dest","debug","exists","existsSync","stats","statSync","isDirectory","mkdirSync","recursive","readdirSync","forEach","childItemName","join","copyFileSync"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AAEvB;;CAEC,GACD,OAAO,SAASC,kBAAkBC,GAAW,EAAEC,IAAY,EAAEC,KAAe;IAC1E,MAAMC,SAASN,GAAGO,UAAU,CAACJ;IAC7B,MAAMK,QAAQF,UAAUN,GAAGS,QAAQ,CAACN;IACpC,MAAMO,cAAcJ,UAAUE,UAAU,SAASA,MAAME,WAAW;IAClE,IAAIA,aAAa;QACfV,GAAGW,SAAS,CAACP,MAAM;YAAEQ,WAAW;QAAK;QACrCZ,GAAGa,WAAW,CAACV,KAAKW,OAAO,CAAC,CAACC;YAC3Bb,kBAAkBD,KAAKe,IAAI,CAACb,KAAKY,gBAAgBd,KAAKe,IAAI,CAACZ,MAAMW;QACnE;IACF,OAAO;QACLf,GAAGiB,YAAY,CAACd,KAAKC;IACvB;AACF"}
package/dist/utils/log.js CHANGED
@@ -1,92 +1,19 @@
1
- /* eslint-disable no-console */ "use strict";
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
- debug: function() {
13
- return debug;
14
- },
15
- error: function() {
16
- return error;
17
- },
18
- info: function() {
19
- return info;
20
- },
21
- log: function() {
22
- return log;
23
- },
24
- warning: function() {
25
- return warning;
26
- }
27
- });
28
- const _prompts = /*#__PURE__*/ _interop_require_wildcard(require("@clack/prompts"));
29
- const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
30
- function _interop_require_default(obj) {
31
- return obj && obj.__esModule ? obj : {
32
- default: obj
33
- };
34
- }
35
- function _getRequireWildcardCache(nodeInterop) {
36
- if (typeof WeakMap !== "function") return null;
37
- var cacheBabelInterop = new WeakMap();
38
- var cacheNodeInterop = new WeakMap();
39
- return (_getRequireWildcardCache = function(nodeInterop) {
40
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
41
- })(nodeInterop);
42
- }
43
- function _interop_require_wildcard(obj, nodeInterop) {
44
- if (!nodeInterop && obj && obj.__esModule) {
45
- return obj;
46
- }
47
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
48
- return {
49
- default: obj
50
- };
51
- }
52
- var cache = _getRequireWildcardCache(nodeInterop);
53
- if (cache && cache.has(obj)) {
54
- return cache.get(obj);
55
- }
56
- var newObj = {
57
- __proto__: null
58
- };
59
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
60
- for(var key in obj){
61
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
62
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
63
- if (desc && (desc.get || desc.set)) {
64
- Object.defineProperty(newObj, key, desc);
65
- } else {
66
- newObj[key] = obj[key];
67
- }
68
- }
69
- }
70
- newObj.default = obj;
71
- if (cache) {
72
- cache.set(obj, newObj);
73
- }
74
- return newObj;
75
- }
76
- const warning = (message)=>{
77
- _prompts.log.warn(_chalk.default.yellow('? ') + _chalk.default.bold(message));
1
+ /* eslint-disable no-console */ import * as p from '@clack/prompts';
2
+ import chalk from 'chalk';
3
+ export const warning = (message)=>{
4
+ p.log.warn(chalk.yellow('? ') + chalk.bold(message));
78
5
  };
79
- const info = (message)=>{
80
- _prompts.log.step(_chalk.default.bold(message));
6
+ export const info = (message)=>{
7
+ p.log.step(chalk.bold(message));
81
8
  };
82
- const error = (message)=>{
83
- _prompts.log.error(_chalk.default.bold(message));
9
+ export const error = (message)=>{
10
+ p.log.error(chalk.bold(message));
84
11
  };
85
- const debug = (message)=>{
86
- _prompts.log.step(`${_chalk.default.bgGray('[DEBUG]')} ${_chalk.default.gray(message)}`);
12
+ export const debug = (message)=>{
13
+ p.log.step(`${chalk.bgGray('[DEBUG]')} ${chalk.gray(message)}`);
87
14
  };
88
- const log = (message)=>{
89
- _prompts.log.message(message);
15
+ export const log = (message)=>{
16
+ p.log.message(message);
90
17
  };
91
18
 
92
19
  //# sourceMappingURL=log.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport * as p from '@clack/prompts'\nimport chalk from 'chalk'\n\nexport const warning = (message: string): void => {\n p.log.warn(chalk.yellow('? ') + chalk.bold(message))\n}\n\nexport const info = (message: string): void => {\n p.log.step(chalk.bold(message))\n}\n\nexport const error = (message: string): void => {\n p.log.error(chalk.bold(message))\n}\n\nexport const debug = (message: string): void => {\n p.log.step(`${chalk.bgGray('[DEBUG]')} ${chalk.gray(message)}`)\n}\n\nexport const log = (message: string): void => {\n p.log.message(message)\n}\n"],"names":["debug","error","info","log","warning","message","p","warn","chalk","yellow","bold","step","bgGray","gray"],"mappings":"AAAA,6BAA6B;;;;;;;;;;;IAgBhBA,KAAK;eAALA;;IAJAC,KAAK;eAALA;;IAJAC,IAAI;eAAJA;;IAYAC,GAAG;eAAHA;;IAhBAC,OAAO;eAAPA;;;iEAHM;8DACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEX,MAAMA,UAAU,CAACC;IACtBC,SAAEH,GAAG,CAACI,IAAI,CAACC,cAAK,CAACC,MAAM,CAAC,QAAQD,cAAK,CAACE,IAAI,CAACL;AAC7C;AAEO,MAAMH,OAAO,CAACG;IACnBC,SAAEH,GAAG,CAACQ,IAAI,CAACH,cAAK,CAACE,IAAI,CAACL;AACxB;AAEO,MAAMJ,QAAQ,CAACI;IACpBC,SAAEH,GAAG,CAACF,KAAK,CAACO,cAAK,CAACE,IAAI,CAACL;AACzB;AAEO,MAAML,QAAQ,CAACK;IACpBC,SAAEH,GAAG,CAACQ,IAAI,CAAC,CAAC,EAAEH,cAAK,CAACI,MAAM,CAAC,WAAW,CAAC,EAAEJ,cAAK,CAACK,IAAI,CAACR,SAAS,CAAC;AAChE;AAEO,MAAMF,MAAM,CAACE;IAClBC,SAAEH,GAAG,CAACE,OAAO,CAACA;AAChB"}
1
+ {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport * as p from '@clack/prompts'\nimport chalk from 'chalk'\n\nexport const warning = (message: string): void => {\n p.log.warn(chalk.yellow('? ') + chalk.bold(message))\n}\n\nexport const info = (message: string): void => {\n p.log.step(chalk.bold(message))\n}\n\nexport const error = (message: string): void => {\n p.log.error(chalk.bold(message))\n}\n\nexport const debug = (message: string): void => {\n p.log.step(`${chalk.bgGray('[DEBUG]')} ${chalk.gray(message)}`)\n}\n\nexport const log = (message: string): void => {\n p.log.message(message)\n}\n"],"names":["p","chalk","warning","message","log","warn","yellow","bold","info","step","error","debug","bgGray","gray"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,6BAA6B,GAC7B,YAAYA,OAAO,iBAAgB;AACnC,OAAOC,WAAW,QAAO;AAEzB,OAAO,MAAMC,UAAU,CAACC;IACtBH,EAAEI,GAAG,CAACC,IAAI,CAACJ,MAAMK,MAAM,CAAC,QAAQL,MAAMM,IAAI,CAACJ;AAC7C,EAAC;AAED,OAAO,MAAMK,OAAO,CAACL;IACnBH,EAAEI,GAAG,CAACK,IAAI,CAACR,MAAMM,IAAI,CAACJ;AACxB,EAAC;AAED,OAAO,MAAMO,QAAQ,CAACP;IACpBH,EAAEI,GAAG,CAACM,KAAK,CAACT,MAAMM,IAAI,CAACJ;AACzB,EAAC;AAED,OAAO,MAAMQ,QAAQ,CAACR;IACpBH,EAAEI,GAAG,CAACK,IAAI,CAAC,CAAC,EAAER,MAAMW,MAAM,CAAC,WAAW,CAAC,EAAEX,MAAMY,IAAI,CAACV,SAAS,CAAC;AAChE,EAAC;AAED,OAAO,MAAMC,MAAM,CAACD;IAClBH,EAAEI,GAAG,CAACD,OAAO,CAACA;AAChB,EAAC"}