create-foldkit-app 0.4.1 → 0.4.3

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
@@ -3,7 +3,10 @@ import { Command, HelpDoc, Options } from '@effect/cli';
3
3
  import { FetchHttpClient } from '@effect/platform';
4
4
  import { NodeContext, NodeRuntime } from '@effect/platform-node';
5
5
  import { Effect, Match, Option, Schema, String, flow } from 'effect';
6
+ import { createRequire } from 'node:module';
6
7
  import { create as create_ } from './commands/create.js';
8
+ /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
9
+ const packageJson = createRequire(import.meta.url)('../package.json');
7
10
  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
11
  const name = Options.text('name').pipe(Options.withAlias('n'), Options.withDescription('The name of the project to create'), Options.withSchema(nameSchema));
9
12
  const example = Options.choice('example', [
@@ -14,6 +17,7 @@ const example = Options.choice('example', [
14
17
  'form',
15
18
  'snake',
16
19
  'routing',
20
+ 'query-sync',
17
21
  'shopping-cart',
18
22
  'websocket-chat',
19
23
  'auth',
@@ -26,9 +30,10 @@ const example = Options.choice('example', [
26
30
  ' form - Form validation with async email checking\n' +
27
31
  ' snake - Classic game built with subscriptions\n' +
28
32
  ' routing - URL routing with parser combinators and route parameters\n' +
33
+ ' query-sync - URL-driven filtering, sorting, and search with query parameters\n' +
29
34
  ' shopping-cart - Complex state management with nested models and routing\n' +
30
- ' websocket-chat - WebSocket integration\n' +
31
- ' auth - Authentication with Model-as-Union pattern and protected routes'));
35
+ ' websocket-chat - Managed resources with WebSocket integration\n' +
36
+ ' auth - Authentication with Submodels, OutMessage, and protected routes'));
32
37
  const packageManager = Options.choice('package-manager', [
33
38
  'pnpm',
34
39
  'npm',
@@ -41,7 +46,7 @@ const create = Command.make('create', {
41
46
  }, create_);
42
47
  const cli = Command.run(create, {
43
48
  name: 'Create Foldkit App',
44
- version: '0.3.1',
49
+ version: packageJson.version,
45
50
  summary: HelpDoc.getSpan(HelpDoc.p('Create a new Foldkit application')),
46
51
  });
47
52
  cli(process.argv).pipe(Effect.provide([FetchHttpClient.layer, NodeContext.layer]), NodeRuntime.runMain);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-foldkit-app",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Create Foldkit applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -12,12 +12,12 @@
12
12
  "templates"
13
13
  ],
14
14
  "dependencies": {
15
- "@effect/cli": "^0.73.0",
16
- "@effect/platform": "^0.94.1",
17
- "@effect/platform-node": "^0.104.0",
15
+ "@effect/cli": "^0.73.2",
16
+ "@effect/platform": "^0.94.5",
17
+ "@effect/platform-node": "^0.104.1",
18
18
  "@types/prompts": "^2.4.9",
19
19
  "chalk": "^5.6.2",
20
- "effect": "^3.19.14",
20
+ "effect": "^3.19.19",
21
21
  "prompts": "^2.4.2",
22
22
  "rimraf": "^6.1.2",
23
23
  "typescript": "^5.9.3"
@@ -3,7 +3,7 @@
3
3
  "singleQuote": true,
4
4
  "arrowParens": "avoid",
5
5
  "trailingComma": "all",
6
- "printWidth": 100,
6
+ "printWidth": 80,
7
7
 
8
8
  "importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"],
9
9
  "importOrderSeparation": true,
@@ -71,7 +71,11 @@ const fetchWeather = (
71
71
  Effect.gen(function* () {
72
72
  // ...
73
73
  return SucceededWeatherFetch({ data })
74
- }).pipe(Effect.catchAll(error => Effect.succeed(FailedWeatherFetch({ error: String(error) }))))
74
+ }).pipe(
75
+ Effect.catchAll(error =>
76
+ Effect.succeed(FailedWeatherFetch({ error: String(error) })),
77
+ ),
78
+ )
75
79
  ```
76
80
 
77
81
  Commands return specific schema types (e.g. `Command<typeof SucceededMsg | typeof FailedMsg>`) rather than the full Message type.
@@ -20,7 +20,10 @@ export default [
20
20
  'no-redeclare': 'off',
21
21
  'no-undef': 'off',
22
22
  'no-unused-vars': 'off',
23
- '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
23
+ '@typescript-eslint/consistent-type-assertions': [
24
+ 'error',
25
+ { assertionStyle: 'never' },
26
+ ],
24
27
  '@typescript-eslint/no-explicit-any': 'error',
25
28
  '@typescript-eslint/no-unused-vars': [
26
29
  'error',