@gtkx/cli 0.1.55 → 0.2.1
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/cli.d.ts +2 -0
- package/dist/create.js +5 -6
- package/dist/dev-server.d.ts +1 -1
- package/dist/dev-server.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +24 -5
package/dist/cli.d.ts
ADDED
package/dist/create.js
CHANGED
|
@@ -105,9 +105,7 @@ const generateExampleTest = (testing) => {
|
|
|
105
105
|
: `import { describe, it, after } from "node:test";
|
|
106
106
|
import { strict as assert } from "node:assert";`;
|
|
107
107
|
const afterEachFn = testing === "node" ? "after" : "afterEach";
|
|
108
|
-
const assertion = testing === "node"
|
|
109
|
-
? `assert.ok(button, "Button should be rendered");`
|
|
110
|
-
: `expect(button).toBeDefined();`;
|
|
108
|
+
const assertion = testing === "node" ? `assert.ok(button, "Button should be rendered");` : `expect(button).toBeDefined();`;
|
|
111
109
|
return `${imports}
|
|
112
110
|
import { cleanup, render, screen } from "@gtkx/testing";
|
|
113
111
|
import App from "../src/app.js";
|
|
@@ -293,7 +291,8 @@ export const createApp = async (options = {}) => {
|
|
|
293
291
|
writeFileSync(join(projectPath, "tests", "app.test.tsx"), generateExampleTest(testing));
|
|
294
292
|
}
|
|
295
293
|
s.stop("Project structure created!");
|
|
296
|
-
|
|
294
|
+
const installSpinner = p.spinner();
|
|
295
|
+
installSpinner.start("Installing dependencies...");
|
|
297
296
|
const devDeps = [...DEV_DEPENDENCIES];
|
|
298
297
|
if (testing !== "none") {
|
|
299
298
|
devDeps.push(...TESTING_DEV_DEPENDENCIES[testing]);
|
|
@@ -306,10 +305,10 @@ export const createApp = async (options = {}) => {
|
|
|
306
305
|
execSync(addCmd, { cwd: projectPath, stdio: "pipe" });
|
|
307
306
|
const addDevCmd = getAddCommand(packageManager, devDeps, true);
|
|
308
307
|
execSync(addDevCmd, { cwd: projectPath, stdio: "pipe" });
|
|
309
|
-
|
|
308
|
+
installSpinner.stop("Dependencies installed!");
|
|
310
309
|
}
|
|
311
310
|
catch (error) {
|
|
312
|
-
|
|
311
|
+
installSpinner.stop("Failed to install dependencies");
|
|
313
312
|
p.log.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
314
313
|
p.log.info("You can install dependencies manually by running:");
|
|
315
314
|
p.log.info(` cd ${name}`);
|
package/dist/dev-server.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export interface DevServerOptions {
|
|
|
9
9
|
* Creates and starts a GTKX development server with HMR support.
|
|
10
10
|
*/
|
|
11
11
|
export declare const createDevServer: (options: DevServerOptions) => Promise<ViteDevServer>;
|
|
12
|
-
export {
|
|
12
|
+
export type { ViteDevServer };
|
package/dist/dev-server.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { events } from "@gtkx/ffi";
|
|
2
3
|
import { update } from "@gtkx/react";
|
|
3
4
|
import react from "@vitejs/plugin-react";
|
|
4
5
|
import { createServer } from "vite";
|
|
@@ -33,6 +34,9 @@ export const createDevServer = async (options) => {
|
|
|
33
34
|
server.moduleGraph.invalidateModule(module);
|
|
34
35
|
}
|
|
35
36
|
};
|
|
37
|
+
events.on("stop", () => {
|
|
38
|
+
server.close();
|
|
39
|
+
});
|
|
36
40
|
server.watcher.on("change", async (changedPath) => {
|
|
37
41
|
console.log(`[gtkx] File changed: ${changedPath}`);
|
|
38
42
|
invalidateAllModules();
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "CLI for GTKX - create and develop GTK4 React applications",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "Eugenio Depalo <eugeniodepalo@gmail.com>",
|
|
7
|
+
"homepage": "https://eugeniodepalo.github.io/gtkx",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/eugeniodepalo/gtkx/issues"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/eugeniodepalo/gtkx.git",
|
|
14
|
+
"directory": "packages/cli"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"gtk",
|
|
18
|
+
"react",
|
|
19
|
+
"native",
|
|
20
|
+
"linux",
|
|
21
|
+
"cli",
|
|
22
|
+
"scaffold",
|
|
23
|
+
"hmr",
|
|
24
|
+
"vite"
|
|
25
|
+
],
|
|
7
26
|
"type": "module",
|
|
8
27
|
"exports": {
|
|
9
28
|
"./package.json": "./package.json",
|
|
@@ -25,11 +44,11 @@
|
|
|
25
44
|
],
|
|
26
45
|
"dependencies": {
|
|
27
46
|
"@clack/prompts": "0.11.0",
|
|
28
|
-
"@vitejs/plugin-react": "
|
|
47
|
+
"@vitejs/plugin-react": "5.1.2",
|
|
29
48
|
"citty": "0.1.6",
|
|
30
|
-
"vite": "
|
|
31
|
-
"@gtkx/ffi": "0.1
|
|
32
|
-
"@gtkx/react": "0.1
|
|
49
|
+
"vite": "7.2.7",
|
|
50
|
+
"@gtkx/ffi": "0.2.1",
|
|
51
|
+
"@gtkx/react": "0.2.1"
|
|
33
52
|
},
|
|
34
53
|
"peerDependencies": {
|
|
35
54
|
"react": "^19"
|