create-gtkx 0.21.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 (55) hide show
  1. package/LICENSE +373 -0
  2. package/bin/create-gtkx.js +5 -0
  3. package/dist/cli.d.ts +24 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +19 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/command.d.ts +65 -0
  8. package/dist/command.d.ts.map +1 -0
  9. package/dist/command.js +69 -0
  10. package/dist/command.js.map +1 -0
  11. package/dist/create.d.ts +3 -0
  12. package/dist/create.d.ts.map +1 -0
  13. package/dist/create.js +7 -0
  14. package/dist/create.js.map +1 -0
  15. package/dist/deps.d.ts +3 -0
  16. package/dist/deps.d.ts.map +1 -0
  17. package/dist/deps.js +51 -0
  18. package/dist/deps.js.map +1 -0
  19. package/dist/index.d.ts +5 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +4 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/options.d.ts +25 -0
  24. package/dist/options.d.ts.map +1 -0
  25. package/dist/options.js +13 -0
  26. package/dist/options.js.map +1 -0
  27. package/dist/scaffolder.d.ts +51 -0
  28. package/dist/scaffolder.d.ts.map +1 -0
  29. package/dist/scaffolder.js +191 -0
  30. package/dist/scaffolder.js.map +1 -0
  31. package/dist/templates.d.ts +11 -0
  32. package/dist/templates.d.ts.map +1 -0
  33. package/dist/templates.js +25 -0
  34. package/dist/templates.js.map +1 -0
  35. package/package.json +65 -0
  36. package/src/cli.ts +21 -0
  37. package/src/command.ts +87 -0
  38. package/src/create.ts +7 -0
  39. package/src/deps.ts +51 -0
  40. package/src/index.ts +4 -0
  41. package/src/options.ts +24 -0
  42. package/src/scaffolder.ts +306 -0
  43. package/src/templates.ts +42 -0
  44. package/templates/claude/EXAMPLES.md.ejs +790 -0
  45. package/templates/claude/SKILL.md.ejs +126 -0
  46. package/templates/claude/WIDGETS.md.ejs +934 -0
  47. package/templates/config/vitest.config.ts.ejs +11 -0
  48. package/templates/gitignore.ejs +4 -0
  49. package/templates/gtkx.config.ts.ejs +6 -0
  50. package/templates/package.json.ejs +16 -0
  51. package/templates/src/app.tsx.ejs +48 -0
  52. package/templates/src/gtkx-env.d.ts.ejs +2 -0
  53. package/templates/src/index.tsx.ejs +4 -0
  54. package/templates/tests/app.test.tsx.ejs +16 -0
  55. package/templates/tsconfig.json.ejs +14 -0
@@ -0,0 +1,11 @@
1
+ import gtkx from "@gtkx/cli/vitest";
2
+ import { defineConfig } from "vitest/config";
3
+
4
+ export default defineConfig({
5
+ plugins: [gtkx()],
6
+ test: {
7
+ include: ["tests/**/*.test.{ts,tsx}"],
8
+ globals: false,
9
+ bail: 1,
10
+ },
11
+ });
@@ -0,0 +1,4 @@
1
+ node_modules/
2
+ dist/
3
+ *.log
4
+ .DS_Store
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from "@gtkx/config";
2
+
3
+ export default defineConfig({
4
+ libraries: ["Gtk-4.0", "Adw-1"],
5
+ applicationId: "<%= applicationId %>",
6
+ });
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "<%= name %>",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "type": "module",
6
+ "imports": {
7
+ "#data/*": "./data/*"
8
+ },
9
+ "scripts": {
10
+ "dev": "gtkx dev",
11
+ "build": "gtkx build",
12
+ "typecheck": "gtkx codegen && tsc --noEmit",
13
+ "start": "node dist/bundle.js"<% if (testing === 'vitest') { %>,
14
+ "test": "vitest"<% } %>
15
+ }
16
+ }
@@ -0,0 +1,48 @@
1
+ import { applicationId } from "virtual:gtkx-config";
2
+ import * as Gtk from "@gtkx/gi/gtk";
3
+ import { GtkApplication, GtkApplicationWindow, GtkBox, GtkButton, GtkLabel } from "@gtkx/jsx/gtk";
4
+ import { quit } from "@gtkx/react";
5
+ import { useState } from "react";
6
+
7
+ const MainWindow = () => {
8
+ const [count, setCount] = useState(0);
9
+
10
+ return (
11
+ <GtkApplicationWindow
12
+ title="<%= title %>"
13
+ defaultWidth={400}
14
+ defaultHeight={300}
15
+ onCloseRequest={() => {
16
+ quit();
17
+ return true;
18
+ }}
19
+ >
20
+ <GtkBox
21
+ orientation={Gtk.Orientation.VERTICAL}
22
+ spacing={20}
23
+ marginTop={40}
24
+ marginBottom={40}
25
+ marginStart={40}
26
+ marginEnd={40}
27
+ valign={Gtk.Align.CENTER}
28
+ halign={Gtk.Align.CENTER}
29
+ >
30
+ <GtkLabel label="Welcome to GTKX!" cssClasses={["title-1"]} />
31
+ <GtkLabel label={`Count: ${count}`} cssClasses={["title-2"]} />
32
+ <GtkButton
33
+ label="Increment"
34
+ onClicked={() => setCount((c) => c + 1)}
35
+ cssClasses={["suggested-action", "pill"]}
36
+ />
37
+ </GtkBox>
38
+ </GtkApplicationWindow>
39
+ );
40
+ };
41
+
42
+ export const App = () => (
43
+ <GtkApplication applicationId={applicationId}>
44
+ <MainWindow />
45
+ </GtkApplication>
46
+ );
47
+
48
+ export default App;
@@ -0,0 +1,2 @@
1
+ /// <reference types="@gtkx/cli/env" />
2
+ /// <reference path="../node_modules/.gtkx/env.d.ts" />
@@ -0,0 +1,4 @@
1
+ import { createRoot } from "@gtkx/react";
2
+ import { App } from "./app.js";
3
+
4
+ createRoot().render(<App />);
@@ -0,0 +1,16 @@
1
+ import { describe, it, expect, afterEach } from "vitest";
2
+ import * as Gtk from "@gtkx/gi/gtk";
3
+ import { cleanup, render, screen } from "@gtkx/testing";
4
+ import App from "../src/app.js";
5
+
6
+ afterEach(async () => {
7
+ await cleanup();
8
+ });
9
+
10
+ describe("App", () => {
11
+ it("renders the increment button", async () => {
12
+ await render(<App />, { wrapper: false });
13
+ const button = await screen.findByRole(Gtk.AccessibleRole.BUTTON, { name: "Increment" });
14
+ expect(button).toBeDefined();
15
+ });
16
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "jsx": "react-jsx",
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "resolveJsonModule": true,
10
+ "outDir": "out-tsc",
11
+ "rootDir": "src"
12
+ },
13
+ "include": ["src/**/*"]
14
+ }