create-warlock 5.16.0 → 5.17.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/esm/commands/create-new-app/index.mjs +55 -50
  3. package/esm/commands/create-new-app/index.mjs.map +1 -1
  4. package/esm/commands/create-new-app/types.d.mts +1 -1
  5. package/esm/commands/create-warlock-app/index.mjs +2 -2
  6. package/esm/commands/create-warlock-app/index.mjs.map +1 -1
  7. package/esm/features/agent-kit-targets.mjs +37 -6
  8. package/esm/features/agent-kit-targets.mjs.map +1 -1
  9. package/esm/flags/assert-flag-combinations.mjs +31 -0
  10. package/esm/flags/assert-flag-combinations.mjs.map +1 -0
  11. package/esm/flags/assert-package-manager.mjs +44 -0
  12. package/esm/flags/assert-package-manager.mjs.map +1 -0
  13. package/esm/flags/definitions.mjs +7 -4
  14. package/esm/flags/definitions.mjs.map +1 -1
  15. package/esm/flags/seed-from-flags.mjs +28 -0
  16. package/esm/flags/seed-from-flags.mjs.map +1 -0
  17. package/esm/helpers/app.mjs +5 -2
  18. package/esm/helpers/app.mjs.map +1 -1
  19. package/esm/helpers/insert-import.mjs.map +1 -1
  20. package/esm/helpers/package-manager.mjs +29 -19
  21. package/esm/helpers/package-manager.mjs.map +1 -1
  22. package/esm/helpers/project-builder-helpers.mjs +1 -1
  23. package/esm/index.d.mts +1 -1
  24. package/esm/index.mjs +2 -2
  25. package/esm/index.mjs.map +1 -1
  26. package/esm/prompts/ask-agent-targets.mjs +87 -0
  27. package/esm/prompts/ask-agent-targets.mjs.map +1 -0
  28. package/esm/prompts/ask-project-name.mjs +25 -0
  29. package/esm/prompts/ask-project-name.mjs.map +1 -0
  30. package/esm/prompts/ask-stack.mjs +22 -9
  31. package/esm/prompts/ask-stack.mjs.map +1 -1
  32. package/esm/summary.mjs.map +1 -1
  33. package/llms-full.txt +1 -1
  34. package/package.json +2 -2
  35. package/skills/create-a-warlock-project/SKILL.md +1 -1
  36. package/templates/warlock/AGENTS.md +1 -0
  37. package/templates/warlock/package.json +3 -3
  38. package/templates/warlock/skills/web-code-standards/SKILL.md +266 -0
  39. package/templates/warlock/src/app/uploads/routes.ts +7 -3
  40. package/templates/warlock/src/config/cache.ts +25 -27
  41. package/templates/warlock/src/config/http.ts +17 -0
  42. package/templates/warlock/src/web/404.page.tsx +5 -3
  43. package/templates/warlock/src/web/home/index.page.tsx +10 -7
  44. package/templates/warlock/src/web/root.tsx +6 -3
  45. package/templates/warlock/src/app/uploads/controllers/fetch-uploaded-file.controller.ts +0 -33
@@ -1,8 +1,10 @@
1
1
  import "./404.css";
2
2
 
3
- export const metadata = {
4
- title: "Page not found",
5
- robots: "noindex",
3
+ export const config = {
4
+ metadata: {
5
+ title: "Page not found",
6
+ robots: "noindex",
7
+ },
6
8
  };
7
9
 
8
10
  export default function NotFoundPage() {
@@ -1,4 +1,4 @@
1
- import type { PageLoader, PageProps } from "@warlock.js/web";
1
+ import type { PageConfig, PageLoader, PageProps } from "@warlock.js/web";
2
2
  import { getHomeService } from "app/home/services/home.service";
3
3
  import { isLocaleCode } from "../../shared/locales";
4
4
  import { ContactSection } from "./components/contact-section";
@@ -10,12 +10,6 @@ import "./styles/home.css";
10
10
 
11
11
  export { register } from "./register";
12
12
 
13
- export const route = { path: "/", name: "home" };
14
- export const metadata = {
15
- title: "Warlock.js — Build with uncommon power",
16
- description:
17
- "A TypeScript framework for production backends, server-rendered React applications, and AI-native systems.",
18
- };
19
13
  type HomeLoaderOptions = Parameters<PageLoader>[0];
20
14
 
21
15
  export async function loader({ request, response }: HomeLoaderOptions) {
@@ -29,6 +23,15 @@ export async function loader({ request, response }: HomeLoaderOptions) {
29
23
  return { locale, ...homeData };
30
24
  }
31
25
 
26
+ export const config = {
27
+ route: { path: "/", name: "home" },
28
+ metadata: {
29
+ title: "Warlock.js — Build with uncommon power",
30
+ description:
31
+ "A TypeScript framework for production backends, server-rendered React applications, and AI-native systems.",
32
+ },
33
+ } satisfies PageConfig<typeof loader>;
34
+
32
35
  type HomePageProps = PageProps<typeof loader>;
33
36
 
34
37
  export default function HomePage({ data }: HomePageProps) {
@@ -1,12 +1,15 @@
1
- import type { AppProps } from "@warlock.js/web";
1
+ import type { AppProps, RootConfig } from "@warlock.js/web";
2
2
  import { Head, Scripts, useLocale, useTextDirection } from "@warlock.js/web";
3
3
  import "./app.css";
4
4
 
5
+ /** Enable React's development checks for the hydrated page/layout tree. */
6
+ export const config = { strictMode: true } satisfies RootConfig;
7
+
5
8
  /**
6
9
  * The application root.
7
10
  *
8
- * NOT async, and it receives no request/response: it renders on the server and
9
- * again in the browser during hydration, where neither exists.
11
+ * Synchronous server document. Only its children inside #vessel are hydrated;
12
+ * put interactive state in a page or layout beneath that boundary.
10
13
  */
11
14
  export default function App({ children }: AppProps) {
12
15
  const locale = useLocale();
@@ -1,33 +0,0 @@
1
- import { CACHE_FOR } from "@warlock.js/cache";
2
- import { Image, type RequestHandler, storage } from "@warlock.js/core";
3
- import { fileExistsAsync } from "@warlock.js/fs";
4
- import { v } from "@warlock.js/seal";
5
-
6
- export const fetchUploadedFileController: RequestHandler = async ({ request, response }) => {
7
- const absolutePath = storage.root(request.input("*"));
8
-
9
- const { w: width, h: height } = request.validated();
10
-
11
- if (!(await fileExistsAsync(absolutePath))) {
12
- return response.notFound();
13
- }
14
-
15
- if (width || height) {
16
- const image = new Image(absolutePath);
17
- image.resize({
18
- width,
19
- height,
20
- });
21
-
22
- return response.sendImage(image, CACHE_FOR.ONE_DAY);
23
- }
24
-
25
- return response.sendFile(absolutePath, CACHE_FOR.ONE_YEAR);
26
- };
27
-
28
- fetchUploadedFileController.validation = {
29
- schema: v.object({
30
- w: v.numeric().min(1),
31
- h: v.numeric().min(1),
32
- }),
33
- };