create-foldkit-app 0.15.0 → 0.15.2
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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { NodeRuntime, NodeServices, NodeStdio } from '@effect/platform-node';
|
|
3
2
|
import { Effect, Layer, Option, Schema } from 'effect';
|
|
4
3
|
import { Command, Flag } from 'effect/unstable/cli';
|
|
5
4
|
import { FetchHttpClient } from 'effect/unstable/http';
|
|
6
5
|
import { createRequire } from 'node:module';
|
|
6
|
+
import { NodeRuntime, NodeServices, NodeStdio } from '@effect/platform-node';
|
|
7
7
|
import { create as create_ } from './commands/create.js';
|
|
8
8
|
import { EXAMPLE_VALUES } from './examples.js';
|
|
9
9
|
import { validateProjectName } from './validateName.js';
|
package/dist/utils/packages.js
CHANGED
|
@@ -9,7 +9,15 @@ const PackageJson = Schema.Struct({
|
|
|
9
9
|
dependencies: StringRecord.pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
|
|
10
10
|
devDependencies: StringRecord.pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
// NOTE: foldkit workspace packages an example may depend on that aren't
|
|
13
|
+
// already installed at `latest` by the hardcoded commands below. They ship
|
|
14
|
+
// from the same monorepo, so pin them to `latest` like `foldkit` itself.
|
|
15
|
+
const PASS_THROUGH_WORKSPACE_PACKAGES = new Set([
|
|
16
|
+
'@foldkit/ui',
|
|
17
|
+
'@foldkit/devtools',
|
|
18
|
+
]);
|
|
19
|
+
const formatDeps = (deps) => pipe(deps, Record.toEntries, Array.filter(([name, version]) => !version.includes('workspace:') ||
|
|
20
|
+
PASS_THROUGH_WORKSPACE_PACKAGES.has(name)), Array.map(([name, version]) => version.includes('workspace:') ? `${name}@latest` : `${name}@${version}`));
|
|
13
21
|
const fetchExampleDeps = (example) => Effect.gen(function* () {
|
|
14
22
|
const client = yield* HttpClient.HttpClient;
|
|
15
23
|
const url = `${GITHUB_RAW_BASE_URL}/${example}/package.json`;
|
package/package.json
CHANGED
package/templates/base/AGENTS.md
CHANGED
|
@@ -72,7 +72,9 @@ Use uppercase section headers (`// MODEL`, `// MESSAGE`, `// INIT`, `// UPDATE`,
|
|
|
72
72
|
|
|
73
73
|
### Testing
|
|
74
74
|
|
|
75
|
-
Test update functions with `foldkit/test`. Since update is pure, tests run without a runtime, DOM, or side effects. Use `Story.story` for update-level tests (send Messages, assert on Model and Commands) and `Scene.scene` for feature-level testing through the view with accessible locators.
|
|
75
|
+
Test update functions with `foldkit/test`. Since update is pure, tests run without a runtime, DOM, or side effects. Use `Story.story` for update-level tests (send Messages, assert on Model and Commands) and `Scene.scene` for feature-level testing through the view with accessible locators.
|
|
76
|
+
|
|
77
|
+
Name each test file for its test style, beside the code under test: `story.test.ts` for the Story tests (which drive `update`) and `scene.test.ts` for the Scene tests (which drive the rendered view). The name describes how the test works, not a source file, so it stays correct whether `update` and `view` live in `main.ts` or in their own files. When one folder holds more than one test of a kind (sibling pages, component variants), prefix with the subject: `login.story.test.ts`. Scene tests always run from the root `update`/`view`, so a single root-level `scene.test.ts` is the right home even in a multi-page app. If the `repos/foldkit` subtree is available, study the `story.test.ts` and `scene.test.ts` files in `repos/foldkit/examples/`.
|
|
76
78
|
|
|
77
79
|
## Code Style
|
|
78
80
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
|
|
1
3
|
import { foldkit } from '@foldkit/vite-plugin'
|
|
2
4
|
import tailwindcss from '@tailwindcss/vite'
|
|
3
|
-
import { defineConfig } from 'vite'
|
|
4
5
|
|
|
5
6
|
export default defineConfig({
|
|
6
7
|
plugins: [tailwindcss(), foldkit({ devToolsMcpPort: 9988 })],
|