@velastack/patterns 0.0.23 → 0.0.24

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/README.md CHANGED
@@ -13,14 +13,7 @@ It also takes any additional wizard inputs from the CLI and passes the data as `
13
13
  ```ts
14
14
  const pattern = await registry.loadPattern("generate-form", {
15
15
  env: "runtime",
16
- argv: [
17
- "generate",
18
- "form",
19
- "contact",
20
- "name:text",
21
- "email:email",
22
- "message:editor",
23
- ],
16
+ argv: ["contact", "name:text", "email:email", "message:editor"],
24
17
  root: "/user/project",
25
18
  features: {
26
19
  auth: false,
@@ -38,14 +31,7 @@ is loaded like this:
38
31
  ```ts
39
32
  const pattern = await registry.loadPattern("generate-form", {
40
33
  env: "preview",
41
- argv: [
42
- "generate",
43
- "form",
44
- "contact",
45
- "name:text",
46
- "email:email",
47
- "message:editor",
48
- ],
34
+ argv: ["contact", "name:text", "email:email", "message:editor"],
49
35
  });
50
36
  ```
51
37
 
@@ -91,3 +77,10 @@ The `src/baselines/` directory contains template SvelteKit projects that pattern
91
77
  Each baseline is a standalone project with its own `package.json`. When working with a baseline locally, run `npm install` inside its directory. The `node_modules` and `.svelte-kit` directories inside baselines are gitignored and must be installed locally before running or testing.
92
78
 
93
79
  Baselines are not bundled into the published package — they are used by the VelaStack CLI's `create` command and by the velastack.dev website.
80
+
81
+ # Workflow for adding new patterns
82
+
83
+ - Develop the pattern in the `src/patterns` directory.
84
+ - Use the demo script to generate a temporary project with the pattern to see applied changes.
85
+ - In the temporary project, run `npm run test:server` to run the tests.
86
+ - Run `npm run lint` and `npm run check` to make sure the code is correct.
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var l = Object.create, u = Object.defineProperty, d = Object.getOwnPropertyDescr
19
19
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
20
20
  }), ee = {
21
21
  name: "@velastack/patterns",
22
- version: "0.0.23",
22
+ version: "0.0.24",
23
23
  type: "module",
24
24
  private: !1,
25
25
  main: "./dist/index.js",
@@ -35,7 +35,8 @@ var l = Object.create, u = Object.defineProperty, d = Object.getOwnPropertyDescr
35
35
  "lint:format": "prettier --check .",
36
36
  test: "vitest run --exclude **/integration.test.ts",
37
37
  "test:watch": "vitest --watch --exclude **/integration.test.ts",
38
- "test:integration": "vitest run **/integration.test.ts"
38
+ "test:integration": "vitest run **/integration.test.ts",
39
+ prepare: "npm run build"
39
40
  },
40
41
  dependencies: {
41
42
  prettier: "^3.8.2",
@@ -2342,7 +2343,7 @@ function un(t, n, r) {
2342
2343
  "\n columnHelper.display({\n id: \"actions\",\n cell: ({ row }) =>\n renderComponent(RowActions, {\n viewPath: `",
2343
2344
  "/${row.original.id}`,\n editPath: `",
2344
2345
  "/${row.original.id}/edit`,\n deletePath: `",
2345
- "/${row.original.id}`\n })\n meta: { class: \"w-0 text-right\" },\n })\n ];\n\n const table = createSvelteTable({\n get data() {\n return data.",
2346
+ "/${row.original.id}`\n }),\n meta: { class: \"w-0 text-right\" },\n })\n ];\n\n const table = createSvelteTable({\n get data() {\n return data.",
2346
2347
  ";\n },\n state: {\n get sorting() {\n return sorting;\n },\n get columnVisibility() {\n return columnVisibility;\n },\n get rowSelection() {\n return rowSelection;\n },\n get columnFilters() {\n return columnFilters;\n },\n get pagination() {\n return pagination;\n }\n },\n columns,\n enableRowSelection: true,\n onRowSelectionChange: (updater) => {\n rowSelection = typeof updater === \"function\" ? updater(rowSelection) : updater;\n },\n onSortingChange: (updater) => {\n sorting = typeof updater === \"function\" ? updater(sorting) : updater;\n },\n onColumnFiltersChange: (updater) => {\n columnFilters = typeof updater === \"function\" ? updater(columnFilters) : updater;\n },\n onColumnVisibilityChange: (updater) => {\n columnVisibility = typeof updater === \"function\" ? updater(columnVisibility) : updater;\n },\n onPaginationChange: (updater) => {\n pagination = typeof updater === \"function\" ? updater(pagination) : updater;\n },\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n getFacetedRowModel: getFacetedRowModel(),\n getFacetedUniqueValues: getFacetedUniqueValues()\n });\n <\/script>\n\n <section data-role=\"content\">\n <div class=\"flex justify-between items-center mb-4\">\n <h1 class=\"text-3xl font-bold tracking-tight\">",
2347
2348
  "</h1>\n </div>\n\n <div class=\"space-y-4\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center space-x-2\">\n <Input\n placeholder=\"Filter ",
2348
2349
  "...\"\n value={(table.getColumn(\"name\")?.getFilterValue() as string) ?? \"\"}\n oninput={(e) => {\n table.getColumn(\"name\")?.setFilterValue(e.currentTarget.value);\n }}\n onchange={(e) => {\n table.getColumn(\"name\")?.setFilterValue(e.currentTarget.value);\n }}\n class=\"h-8 w-[150px] lg:w-[250px]\"\n />\n ",
@@ -2358,7 +2359,7 @@ function un(t, n, r) {
2358
2359
  "\n columnHelper.display({\n id: \"actions\",\n cell: ({ row }) =>\n renderComponent(RowActions, {\n viewPath: \\`",
2359
2360
  "/\\${row.original.id}\\`,\n editPath: \\`",
2360
2361
  "/\\${row.original.id}/edit\\`,\n deletePath: \\`",
2361
- "/\\${row.original.id}\\`\n })\n meta: { class: \"w-0 text-right\" },\n })\n ];\n\n const table = createSvelteTable({\n get data() {\n return data.",
2362
+ "/\\${row.original.id}\\`\n }),\n meta: { class: \"w-0 text-right\" },\n })\n ];\n\n const table = createSvelteTable({\n get data() {\n return data.",
2362
2363
  ";\n },\n state: {\n get sorting() {\n return sorting;\n },\n get columnVisibility() {\n return columnVisibility;\n },\n get rowSelection() {\n return rowSelection;\n },\n get columnFilters() {\n return columnFilters;\n },\n get pagination() {\n return pagination;\n }\n },\n columns,\n enableRowSelection: true,\n onRowSelectionChange: (updater) => {\n rowSelection = typeof updater === \"function\" ? updater(rowSelection) : updater;\n },\n onSortingChange: (updater) => {\n sorting = typeof updater === \"function\" ? updater(sorting) : updater;\n },\n onColumnFiltersChange: (updater) => {\n columnFilters = typeof updater === \"function\" ? updater(columnFilters) : updater;\n },\n onColumnVisibilityChange: (updater) => {\n columnVisibility = typeof updater === \"function\" ? updater(columnVisibility) : updater;\n },\n onPaginationChange: (updater) => {\n pagination = typeof updater === \"function\" ? updater(pagination) : updater;\n },\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n getFacetedRowModel: getFacetedRowModel(),\n getFacetedUniqueValues: getFacetedUniqueValues()\n });\n <\/script>\n\n <section data-role=\"content\">\n <div class=\"flex justify-between items-center mb-4\">\n <h1 class=\"text-3xl font-bold tracking-tight\">",
2363
2364
  "</h1>\n </div>\n\n <div class=\"space-y-4\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center space-x-2\">\n <Input\n placeholder=\"Filter ",
2364
2365
  "...\"\n value={(table.getColumn(\"name\")?.getFilterValue() as string) ?? \"\"}\n oninput={(e) => {\n table.getColumn(\"name\")?.setFilterValue(e.currentTarget.value);\n }}\n onchange={(e) => {\n table.getColumn(\"name\")?.setFilterValue(e.currentTarget.value);\n }}\n class=\"h-8 w-[150px] lg:w-[250px]\"\n />\n ",
@@ -2588,7 +2589,7 @@ var Sn = {
2588
2589
  "email:email"
2589
2590
  ]
2590
2591
  },
2591
- tests: 7,
2592
+ tests: 8,
2592
2593
  baseline: "velastack",
2593
2594
  generate: xn
2594
2595
  };