create-gtkx 2.0.0-beta.1 → 2.0.0-beta.11
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 +8 -163
- package/dist/build-allowance.d.ts.map +1 -1
- package/dist/build-allowance.js +6 -5
- package/dist/build-allowance.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +12 -3
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +111 -45
- package/dist/command.js.map +1 -1
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +2 -4
- package/dist/manifest.js.map +1 -1
- package/dist/package-managers.d.ts +3 -3
- package/dist/package-managers.d.ts.map +1 -1
- package/dist/package-managers.js +21 -3
- package/dist/package-managers.js.map +1 -1
- package/dist/scaffolder.d.ts +2 -0
- package/dist/scaffolder.d.ts.map +1 -1
- package/dist/scaffolder.js +200 -112
- package/dist/scaffolder.js.map +1 -1
- package/dist/templates/gtkx.config.ts.ejs +3 -4
- package/dist/templates/package.json.ejs +4 -1
- package/dist/templates/src/app.tsx.ejs +27 -24
- package/dist/templates.d.ts +1 -1
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js.map +1 -1
- package/package.json +26 -12
- package/src/build-allowance.ts +6 -7
- package/src/cli.ts +1 -1
- package/src/command.ts +140 -57
- package/src/manifest.ts +2 -4
- package/src/package-managers.ts +21 -3
- package/src/scaffolder.ts +282 -153
- package/src/templates/gtkx.config.ts.ejs +3 -4
- package/src/templates/package.json.ejs +4 -1
- package/src/templates/src/app.tsx.ejs +27 -24
- package/src/templates.ts +1 -1
- package/dist/install-hints.d.ts +0 -3
- package/dist/install-hints.d.ts.map +0 -1
- package/dist/install-hints.js +0 -35
- package/dist/install-hints.js.map +0 -1
- package/src/install-hints.ts +0 -54
|
@@ -4,11 +4,10 @@ export default defineConfig({
|
|
|
4
4
|
applicationId: "<%= applicationId %>",
|
|
5
5
|
applicationIcon: "data/icons",
|
|
6
6
|
deploy: {
|
|
7
|
-
name:
|
|
8
|
-
summary: "A
|
|
7
|
+
name: <%- sourceStringLiteral(displayName) %>,
|
|
8
|
+
summary: "A Linux application built with GTKX",
|
|
9
9
|
description: [
|
|
10
|
-
|
|
11
|
-
+ "widgets from React. Replace this paragraph with a description of what your application does.",
|
|
10
|
+
<%- sourceStringLiteral(`${displayName} is built with GTKX. Replace this paragraph with a description of what your application does.`) %>,
|
|
12
11
|
],
|
|
13
12
|
categories: ["Utility"],
|
|
14
13
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "<%= name %>",
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "A
|
|
5
|
+
"description": "A Linux application built with GTKX",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
<% if (developerEmail) { -%>
|
|
8
8
|
"author": <%- sourceStringLiteral(`${developerName} <${developerEmail}>`) %>,
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
"dev": "gtkx dev",
|
|
18
18
|
"build": "gtkx build",
|
|
19
19
|
"codegen": "gtkx codegen",
|
|
20
|
+
<% if (shouldIncludeTesting) { -%>
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
<% } -%>
|
|
20
23
|
<% if (isTypescript) { -%>
|
|
21
24
|
"typecheck": "gtkx codegen && tsc",
|
|
22
25
|
<% } -%>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
2
|
-
import {
|
|
2
|
+
import { AdwApplication, AdwApplicationWindow, AdwHeaderBar, AdwToolbarView } from "@gtkx/jsx/adw";
|
|
3
|
+
import { GtkBox, GtkButton, GtkLabel } from "@gtkx/jsx/gtk";
|
|
3
4
|
import { quit } from "@gtkx/react";
|
|
4
5
|
import { useState } from "react";
|
|
5
6
|
|
|
@@ -7,38 +8,40 @@ const MainWindow = () => {
|
|
|
7
8
|
const [count, setCount] = useState(0);
|
|
8
9
|
|
|
9
10
|
return (
|
|
10
|
-
<
|
|
11
|
-
title=
|
|
11
|
+
<AdwApplicationWindow
|
|
12
|
+
title={<%- sourceStringLiteral(displayName) %>}
|
|
12
13
|
defaultWidth={400}
|
|
13
14
|
defaultHeight={300}
|
|
14
15
|
onCloseRequest={quit}
|
|
15
16
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
<AdwToolbarView topBar={<AdwHeaderBar />}>
|
|
18
|
+
<GtkBox
|
|
19
|
+
orientation={Gtk.Orientation.VERTICAL}
|
|
20
|
+
spacing={20}
|
|
21
|
+
marginTop={40}
|
|
22
|
+
marginBottom={40}
|
|
23
|
+
marginStart={40}
|
|
24
|
+
marginEnd={40}
|
|
25
|
+
valign={Gtk.Align.CENTER}
|
|
26
|
+
halign={Gtk.Align.CENTER}
|
|
27
|
+
>
|
|
28
|
+
<GtkLabel cssClasses={["title-1"]}>Welcome to GTKX!</GtkLabel>
|
|
29
|
+
<GtkLabel cssClasses={["title-2"]}>Count: {count}</GtkLabel>
|
|
30
|
+
<GtkButton
|
|
31
|
+
label="Increment"
|
|
32
|
+
onClicked={() => setCount((c) => c + 1)}
|
|
33
|
+
cssClasses={["suggested-action", "pill"]}
|
|
34
|
+
/>
|
|
35
|
+
</GtkBox>
|
|
36
|
+
</AdwToolbarView>
|
|
37
|
+
</AdwApplicationWindow>
|
|
35
38
|
);
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
export const App = () => (
|
|
39
|
-
<
|
|
42
|
+
<AdwApplication>
|
|
40
43
|
<MainWindow />
|
|
41
|
-
</
|
|
44
|
+
</AdwApplication>
|
|
42
45
|
);
|
|
43
46
|
|
|
44
47
|
export default App;
|
package/src/templates.ts
CHANGED
package/dist/install-hints.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-hints.d.ts","sourceRoot":"","sources":["../src/install-hints.ts"],"names":[],"mappings":"AAkDA,QAAA,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,MAAM,GAAG,SAC4B,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/install-hints.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const RELEASE_AGE_PATTERN = /ERR_PNPM_(?:MINIMUM_RELEASE_AGE_VIOLATION|NO_MATURE_MATCHING_VERSION)/;
|
|
2
|
-
const BLOCKED_VERSION_PATTERN = /^[ \t]*(\S+) was published at .+ within the minimumReleaseAge cutoff/gm;
|
|
3
|
-
const RELEASE_AGE_POLICY = "pnpm refused the install under its minimumReleaseAge policy, which by default holds back every package " +
|
|
4
|
-
"published in the last 24 hours so a compromised release has time to be caught and pulled. Nothing is wrong " +
|
|
5
|
-
"with these versions other than their age.";
|
|
6
|
-
const RELEASE_AGE_REMEDY = "Wait for them to clear that window and install again, or allow the versions pnpm named. They belong at the " +
|
|
7
|
-
"top level of pnpm-workspace.yaml, as a sibling of packages: and allowBuilds: rather than nested inside " +
|
|
8
|
-
"either of them:";
|
|
9
|
-
const RELEASE_AGE_REMEDY_WITHOUT_VERSIONS = "Wait for them to clear that window and install again, or list the versions pnpm reported under a top-level " +
|
|
10
|
-
"minimumReleaseAgeExclude key in pnpm-workspace.yaml.";
|
|
11
|
-
const RELEASE_AGE_PARTIAL_LIST = "pnpm reports only the versions the command it stopped on had to resolve, so a later install can name more. " +
|
|
12
|
-
"Add each one to the same list.";
|
|
13
|
-
const RELEASE_AGE_OPT_OUT = 'Listing exact versions keeps the policy on for every other package. Setting "minimumReleaseAge: 0" in the ' +
|
|
14
|
-
"same file turns it off for all of them, so prefer the list above. npm and yarn apply no such policy.";
|
|
15
|
-
const getBlockedVersions = (message) => {
|
|
16
|
-
const matches = Array.from(message.matchAll(BLOCKED_VERSION_PATTERN), (match) => match[1] ?? "");
|
|
17
|
-
return [...new Set(matches.filter(Boolean))];
|
|
18
|
-
};
|
|
19
|
-
const formatExcludeBlock = (versions) => ["minimumReleaseAgeExclude:", ...versions.map((version) => ` - '${version}'`)].join("\n");
|
|
20
|
-
const describeReleaseAge = (message) => {
|
|
21
|
-
const versions = getBlockedVersions(message);
|
|
22
|
-
if (versions.length === 0) {
|
|
23
|
-
return [RELEASE_AGE_POLICY, RELEASE_AGE_REMEDY_WITHOUT_VERSIONS].join("\n\n");
|
|
24
|
-
}
|
|
25
|
-
return [
|
|
26
|
-
RELEASE_AGE_POLICY,
|
|
27
|
-
RELEASE_AGE_REMEDY,
|
|
28
|
-
formatExcludeBlock(versions),
|
|
29
|
-
RELEASE_AGE_PARTIAL_LIST,
|
|
30
|
-
RELEASE_AGE_OPT_OUT,
|
|
31
|
-
].join("\n\n");
|
|
32
|
-
};
|
|
33
|
-
const getInstallHint = (message) => RELEASE_AGE_PATTERN.test(message) ? describeReleaseAge(message) : undefined;
|
|
34
|
-
export { getInstallHint };
|
|
35
|
-
//# sourceMappingURL=install-hints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-hints.js","sourceRoot":"","sources":["../src/install-hints.ts"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG,uEAAuE,CAAC;AACpG,MAAM,uBAAuB,GAAG,wEAAwE,CAAC;AAEzG,MAAM,kBAAkB,GACpB,yGAAyG;IACzG,6GAA6G;IAC7G,2CAA2C,CAAC;AAEhD,MAAM,kBAAkB,GACpB,6GAA6G;IAC7G,yGAAyG;IACzG,iBAAiB,CAAC;AAEtB,MAAM,mCAAmC,GACrC,6GAA6G;IAC7G,sDAAsD,CAAC;AAE3D,MAAM,wBAAwB,GAC1B,6GAA6G;IAC7G,gCAAgC,CAAC;AAErC,MAAM,mBAAmB,GACrB,4GAA4G;IAC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NPM_(?:MINIMUM_RELEASE_AGE_VIOLATION|NO_MATURE_MATCHING_VERSION)/;\nconst BLOCKED_VERSION_PATTERN = /^[ \\t]*(\\S+) was published at .+ within the minimumReleaseAge cutoff/gm;\n\nconst RELEASE_AGE_POLICY =\n \"pnpm refused the install under its minimumReleaseAge policy, which by default holds back every package \" +\n \"published in the last 24 hours so a compromised release has time to be caught and pulled. Nothing is wrong \" +\n \"with these versions other than their age.\";\n\nconst RELEASE_AGE_REMEDY =\n \"Wait for them to clear that window and install again, or allow the versions pnpm named. They belong at the \" +\n \"top level of pnpm-workspace.yaml, as a sibling of packages: and allowBuilds: rather than nested inside \" +\n \"either of them:\";\n\nconst RELEASE_AGE_REMEDY_WITHOUT_VERSIONS =\n \"Wait for them to clear that window and install again, or list the versions pnpm reported under a top-level \" +\n \"minimumReleaseAgeExclude key in pnpm-workspace.yaml.\";\n\nconst RELEASE_AGE_PARTIAL_LIST =\n \"pnpm reports only the versions the command it stopped on had to resolve, so a later install can name more. \" +\n \"Add each one to the same list.\";\n\nconst RELEASE_AGE_OPT_OUT =\n 'Listing exact versions keeps the policy on for every other package. Setting \"minimumReleaseAge: 0\" in the ' +\n \"same file turns it off for all of them, so prefer the list above. npm and yarn apply no such policy.\";\n\nconst getBlockedVersions = (message: string): string[] => {\n const matches = Array.from(message.matchAll(BLOCKED_VERSION_PATTERN), (match) => match[1] ?? \"\");\n\n return [...new Set(matches.filter(Boolean))];\n};\n\nconst formatExcludeBlock = (versions: string[]): string =>\n [\"minimumReleaseAgeExclude:\", ...versions.map((version) => ` - '${version}'`)].join(\"\\n\");\n\nconst describeReleaseAge = (message: string): string => {\n const versions = getBlockedVersions(message);\n\n if (versions.length === 0) {\n return [RELEASE_AGE_POLICY, RELEASE_AGE_REMEDY_WITHOUT_VERSIONS].join(\"\\n\\n\");\n }\n\n return [\n RELEASE_AGE_POLICY,\n RELEASE_AGE_REMEDY,\n formatExcludeBlock(versions),\n RELEASE_AGE_PARTIAL_LIST,\n RELEASE_AGE_OPT_OUT,\n ].join(\"\\n\\n\");\n};\n\nconst getInstallHint = (message: string): string | undefined =>\n RELEASE_AGE_PATTERN.test(message) ? describeReleaseAge(message) : undefined;\n\nexport { getInstallHint };\n"]}
|
package/src/install-hints.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
const RELEASE_AGE_PATTERN = /ERR_PNPM_(?:MINIMUM_RELEASE_AGE_VIOLATION|NO_MATURE_MATCHING_VERSION)/;
|
|
2
|
-
const BLOCKED_VERSION_PATTERN = /^[ \t]*(\S+) was published at .+ within the minimumReleaseAge cutoff/gm;
|
|
3
|
-
|
|
4
|
-
const RELEASE_AGE_POLICY =
|
|
5
|
-
"pnpm refused the install under its minimumReleaseAge policy, which by default holds back every package " +
|
|
6
|
-
"published in the last 24 hours so a compromised release has time to be caught and pulled. Nothing is wrong " +
|
|
7
|
-
"with these versions other than their age.";
|
|
8
|
-
|
|
9
|
-
const RELEASE_AGE_REMEDY =
|
|
10
|
-
"Wait for them to clear that window and install again, or allow the versions pnpm named. They belong at the " +
|
|
11
|
-
"top level of pnpm-workspace.yaml, as a sibling of packages: and allowBuilds: rather than nested inside " +
|
|
12
|
-
"either of them:";
|
|
13
|
-
|
|
14
|
-
const RELEASE_AGE_REMEDY_WITHOUT_VERSIONS =
|
|
15
|
-
"Wait for them to clear that window and install again, or list the versions pnpm reported under a top-level " +
|
|
16
|
-
"minimumReleaseAgeExclude key in pnpm-workspace.yaml.";
|
|
17
|
-
|
|
18
|
-
const RELEASE_AGE_PARTIAL_LIST =
|
|
19
|
-
"pnpm reports only the versions the command it stopped on had to resolve, so a later install can name more. " +
|
|
20
|
-
"Add each one to the same list.";
|
|
21
|
-
|
|
22
|
-
const RELEASE_AGE_OPT_OUT =
|
|
23
|
-
'Listing exact versions keeps the policy on for every other package. Setting "minimumReleaseAge: 0" in the ' +
|
|
24
|
-
"same file turns it off for all of them, so prefer the list above. npm and yarn apply no such policy.";
|
|
25
|
-
|
|
26
|
-
const getBlockedVersions = (message: string): string[] => {
|
|
27
|
-
const matches = Array.from(message.matchAll(BLOCKED_VERSION_PATTERN), (match) => match[1] ?? "");
|
|
28
|
-
|
|
29
|
-
return [...new Set(matches.filter(Boolean))];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const formatExcludeBlock = (versions: string[]): string =>
|
|
33
|
-
["minimumReleaseAgeExclude:", ...versions.map((version) => ` - '${version}'`)].join("\n");
|
|
34
|
-
|
|
35
|
-
const describeReleaseAge = (message: string): string => {
|
|
36
|
-
const versions = getBlockedVersions(message);
|
|
37
|
-
|
|
38
|
-
if (versions.length === 0) {
|
|
39
|
-
return [RELEASE_AGE_POLICY, RELEASE_AGE_REMEDY_WITHOUT_VERSIONS].join("\n\n");
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return [
|
|
43
|
-
RELEASE_AGE_POLICY,
|
|
44
|
-
RELEASE_AGE_REMEDY,
|
|
45
|
-
formatExcludeBlock(versions),
|
|
46
|
-
RELEASE_AGE_PARTIAL_LIST,
|
|
47
|
-
RELEASE_AGE_OPT_OUT,
|
|
48
|
-
].join("\n\n");
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const getInstallHint = (message: string): string | undefined =>
|
|
52
|
-
RELEASE_AGE_PATTERN.test(message) ? describeReleaseAge(message) : undefined;
|
|
53
|
-
|
|
54
|
-
export { getInstallHint };
|