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.
- package/LICENSE +373 -0
- package/bin/create-gtkx.js +5 -0
- package/dist/cli.d.ts +24 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +1 -0
- package/dist/command.d.ts +65 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +69 -0
- package/dist/command.js.map +1 -0
- package/dist/create.d.ts +3 -0
- package/dist/create.d.ts.map +1 -0
- package/dist/create.js +7 -0
- package/dist/create.js.map +1 -0
- package/dist/deps.d.ts +3 -0
- package/dist/deps.d.ts.map +1 -0
- package/dist/deps.js +51 -0
- package/dist/deps.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +25 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +13 -0
- package/dist/options.js.map +1 -0
- package/dist/scaffolder.d.ts +51 -0
- package/dist/scaffolder.d.ts.map +1 -0
- package/dist/scaffolder.js +191 -0
- package/dist/scaffolder.js.map +1 -0
- package/dist/templates.d.ts +11 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +25 -0
- package/dist/templates.js.map +1 -0
- package/package.json +65 -0
- package/src/cli.ts +21 -0
- package/src/command.ts +87 -0
- package/src/create.ts +7 -0
- package/src/deps.ts +51 -0
- package/src/index.ts +4 -0
- package/src/options.ts +24 -0
- package/src/scaffolder.ts +306 -0
- package/src/templates.ts +42 -0
- package/templates/claude/EXAMPLES.md.ejs +790 -0
- package/templates/claude/SKILL.md.ejs +126 -0
- package/templates/claude/WIDGETS.md.ejs +934 -0
- package/templates/config/vitest.config.ts.ejs +11 -0
- package/templates/gitignore.ejs +4 -0
- package/templates/gtkx.config.ts.ejs +6 -0
- package/templates/package.json.ejs +16 -0
- package/templates/src/app.tsx.ejs +48 -0
- package/templates/src/gtkx-env.d.ts.ejs +2 -0
- package/templates/src/index.tsx.ejs +4 -0
- package/templates/tests/app.test.tsx.ejs +16 -0
- package/templates/tsconfig.json.ejs +14 -0
|
@@ -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,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
|
+
}
|