create-forkly 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -29,12 +29,15 @@ const cli = cac('forkly');
29
29
  cli.command('create [dir]', 'Create a new Forkly project')
30
30
  .action(async (dir = '.') => {
31
31
  p.intro('Forkly Project Scaffolder');
32
- const projectName = await p.text({
33
- message: 'Project name:',
34
- placeholder: 'my-forkly-app',
35
- defaultValue: dir === '.' ? 'my-forkly-app' : dir,
36
- });
37
- if (p.isCancel(projectName)) {
32
+ const specifiedDir = dir !== '.';
33
+ const projectName = specifiedDir
34
+ ? dir
35
+ : await p.text({
36
+ message: 'Project name:',
37
+ placeholder: 'my-forkly-app',
38
+ defaultValue: 'my-forkly-app',
39
+ });
40
+ if (!specifiedDir && p.isCancel(projectName)) {
38
41
  p.cancel('Cancelled');
39
42
  process.exit(0);
40
43
  }
@@ -82,5 +85,5 @@ cli.command('create [dir]', 'Create a new Forkly project')
82
85
  p.outro(`Done! Run:\n cd ${projectName}\n ${devCmd}`);
83
86
  });
84
87
  cli.help();
85
- cli.version('0.6.1');
88
+ cli.version('0.6.2');
86
89
  cli.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-forkly",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "CLI to scaffold a new Forkly project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -6,7 +6,6 @@ const Base = setRouter({
6
6
  });
7
7
 
8
8
  export class HelloRouter extends Base {
9
- static channel = 'async' as const;
10
9
 
11
10
  async get() {
12
11
  const name = this.request.query.name ?? 'World';
@@ -2,12 +2,11 @@
2
2
  import { Router } from 'forkly';
3
3
 
4
4
  export class IndexRouter extends Router {
5
- static channel = 'async' as const;
6
5
 
7
6
  async get() {
8
7
  return {
9
8
  message: 'Welcome to Forkly!',
10
- version: '0.5.0',
9
+ version: '0.8.0',
11
10
  timestamp: Date.now(),
12
11
  };
13
12
  }
@@ -8,7 +8,6 @@ const users: Record<string, { name: string; email: string }> = {
8
8
  };
9
9
 
10
10
  export class UserRouter extends Router {
11
- static channel = 'async' as const;
12
11
 
13
12
  async get() {
14
13
  const id = this.request.params.id;