create-foldkit-app 0.2.3 → 0.3.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
@@ -7,6 +7,7 @@ import { create as create_ } from './commands/create.js';
7
7
  const nameSchema = Schema.String.pipe(Schema.filter((name) => Match.value(name).pipe(Match.whenOr(String.includes('/'), String.includes('\\'), () => 'Project name cannot contain path separators (/ or \\)'), Match.when(String.includes(' '), () => 'Project name cannot contain spaces'), Match.when(flow(String.match(/[<>:"|?*]/), Option.isSome), () => 'Project name cannot contain special characters: < > : " | ? *'), Match.whenOr(String.startsWith('.'), String.startsWith('-'), () => 'Project name cannot start with . or -'), Match.when(String.isEmpty, () => 'Project name cannot be empty'), Match.orElse(() => true))));
8
8
  const name = Options.text('name').pipe(Options.withAlias('n'), Options.withDescription('The name of the project to create'), Options.withSchema(nameSchema));
9
9
  const example = Options.choice('example', [
10
+ 'auth',
10
11
  'counter',
11
12
  'stopwatch',
12
13
  'weather',
@@ -18,6 +19,7 @@ const example = Options.choice('example', [
18
19
  'websocket-chat',
19
20
  ]).pipe(Options.withAlias('e'), Options.withDescription("The example application to start from. Pick an example that's similar to the application you're building. Or create multiple projects and take pieces of each!\n\n" +
20
21
  'Available examples:\n' +
22
+ ' auth - Authentication with Model-as-Union pattern and protected routes\n' +
21
23
  ' counter - Simple increment/decrement with reset\n' +
22
24
  ' stopwatch - Timer with start/stop/reset functionality\n' +
23
25
  ' weather - HTTP requests with async state handling\n' +
@@ -27,7 +29,11 @@ const example = Options.choice('example', [
27
29
  ' routing - URL routing with parser combinators and route parameters\n' +
28
30
  ' shopping-cart - Complex state management with nested models and routing\n' +
29
31
  ' websocket-chat - WebSocket integration'));
30
- const packageManager = Options.choice('package-manager', ['pnpm', 'npm', 'yarn']).pipe(Options.withAlias('p'), Options.withDescription('The package manager to use for installing dependencies'));
32
+ const packageManager = Options.choice('package-manager', [
33
+ 'pnpm',
34
+ 'npm',
35
+ 'yarn',
36
+ ]).pipe(Options.withAlias('p'), Options.withDescription('The package manager to use for installing dependencies'));
31
37
  const create = Command.make('create', {
32
38
  name,
33
39
  example,
@@ -35,7 +41,7 @@ const create = Command.make('create', {
35
41
  }, create_);
36
42
  const cli = Command.run(create, {
37
43
  name: 'Create Foldkit App',
38
- version: '0.2.2',
44
+ version: '0.3.0',
39
45
  summary: HelpDoc.getSpan(HelpDoc.p('Create a new Foldkit application')),
40
46
  });
41
47
  cli(process.argv).pipe(Effect.provide([FetchHttpClient.layer, NodeContext.layer]), NodeRuntime.runMain);
@@ -1,5 +1,5 @@
1
1
  import { FileSystem, HttpClient, HttpClientRequest, Path, } from '@effect/platform';
2
- import { Array, Effect, Match, Option, Record, Ref, Schema, String, pipe } from 'effect';
2
+ import { Array, Effect, Match, Option, Record, Ref, Schema, String, pipe, } from 'effect';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  const GITHUB_API_BASE_URL = 'https://api.github.com/repos/devinjameson/foldkit/contents/examples';
5
5
  const getBaseFiles = Effect.gen(function* () {
@@ -22,7 +22,9 @@ const getBaseFiles = Effect.gen(function* () {
22
22
  });
23
23
  const processDirectory = (dir) => Effect.gen(function* () {
24
24
  const entries = yield* fs.readDirectory(dir);
25
- yield* Effect.forEach(entries, processEntry(dir), { concurrency: 'unbounded' });
25
+ yield* Effect.forEach(entries, processEntry(dir), {
26
+ concurrency: 'unbounded',
27
+ });
26
28
  });
27
29
  yield* processDirectory(templatesDir);
28
30
  return yield* Ref.get(fileContentByPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-foldkit-app",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Create Foldkit applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",