@hitch42/applet 0.1.1-beta.13 → 0.1.1-beta.15

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/applet.js CHANGED
@@ -99,23 +99,23 @@ async function main() {
99
99
  const noLogFlags = values.run === void 0 && values.filter === void 0 && values.level === void 0 && values.limit === void 0 && values.live === void 0 && values.search === void 0 && values.since === void 0;
100
100
  const noModeFlags = values["client-only"] === void 0 && values["server-only"] === void 0;
101
101
  if (positionals.length === 1 && positionals[0] === "bootstrap" && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
102
- await (await import("./init-CD-xOYWV.js")).runBootstrap({ install: values["no-install"] !== true });
102
+ await (await import("./init-Dw7GEI5v.js")).runBootstrap({ install: values["no-install"] !== true });
103
103
  return;
104
104
  }
105
105
  if (positionals.length === 1 && positionals[0] === "generate" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
106
- await (await import("./generate-CtbF9Zxd.js")).runGenerate();
106
+ await (await import("./generate-WYS-jtPH.js")).runGenerate();
107
107
  return;
108
108
  }
109
109
  if (positionals.length === 1 && positionals[0] === "build" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
110
- await (await import("./build-CeRZYhM9.js")).runBuild();
110
+ await (await import("./build-D7FDW8iC.js")).runBuild();
111
111
  return;
112
112
  }
113
113
  if (positionals.length === 1 && positionals[0] === "deploy" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
114
- await (await import("./deploy-CaGPhe2h.js")).runDeploy({});
114
+ await (await import("./deploy-D5SBBd-j.js")).runDeploy({});
115
115
  return;
116
116
  }
117
117
  if (positionals.length === 2 && positionals[0] === "init" && noModeFlags && noVariableFlags && noLogFlags) {
118
- await (await import("./init-CD-xOYWV.js")).runInit(positionals[1], {
118
+ await (await import("./init-Dw7GEI5v.js")).runInit(positionals[1], {
119
119
  commit: values["no-commit"] !== true,
120
120
  git: values["no-git"] !== true,
121
121
  install: values["no-install"] !== true
@@ -123,7 +123,7 @@ async function main() {
123
123
  return;
124
124
  }
125
125
  if (positionals.length === 2 && positionals[0] === "new" && noGitFlags && noVariableFlags && noLogFlags) {
126
- await (await import("./init-CD-xOYWV.js")).runNew({
126
+ await (await import("./init-Dw7GEI5v.js")).runNew({
127
127
  code: positionals[1],
128
128
  clientOnly: values["client-only"],
129
129
  install: values["no-install"] !== true,
@@ -1,4 +1,4 @@
1
- import { i as prepareAppletProjects, r as prepareAppletProject } from "./project-z7x0omdw.js";
1
+ import { i as prepareAppletProjects, r as prepareAppletProject } from "./project-NcWw8SwL.js";
2
2
  import { rm } from "node:fs/promises";
3
3
  import { resolve } from "node:path";
4
4
  import { spawn } from "node:child_process";
@@ -0,0 +1,2 @@
1
+ import { i as runBuild } from "./build-BkhBHdMs.js";
2
+ export { runBuild };
@@ -1,6 +1,6 @@
1
1
  import { i as readWorkspaceConfig, n as fetchWithOrgAuth } from "./workspace-D0dnnlxL.js";
2
2
  import { a as loadGitHubActionsSources, n as githubActionsContext, r as hitchResponseError, t as fetchWithGitHubActions } from "./ci-BKw14X2h.js";
3
- import { n as buildPreparedApplet, r as prepareWorkspaceBuild, t as buildApplet } from "./build-CwOM9C0W.js";
3
+ import { n as buildPreparedApplet, r as prepareWorkspaceBuild, t as buildApplet } from "./build-BkhBHdMs.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { createHash } from "node:crypto";
6
6
  import { existsSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import { f as resolveInstanceUrl, l as organizationInstanceUrl, n as fetchWithOrgAuth } from "./workspace-D0dnnlxL.js";
2
2
  import { i as loadGitHubActionsBuildInputs, n as githubActionsContext } from "./ci-BKw14X2h.js";
3
- import { r as prepareAppletProject } from "./project-z7x0omdw.js";
3
+ import { r as prepareAppletProject } from "./project-NcWw8SwL.js";
4
4
  import { t as loadAppletConfig } from "./load-config-BeQZ2yOa.js";
5
5
  import { createRequire } from "node:module";
6
6
  import { existsSync } from "node:fs";
@@ -0,0 +1,2 @@
1
+ import { n as runGenerate } from "./generate-MWjUbZnO.js";
2
+ export { runGenerate };
@@ -1,7 +1,7 @@
1
1
  import { a as ORG_CODE_PATTERN, i as APPLET_CODE_PATTERN } from "./manifest-CuY3ICpN.js";
2
2
  import { d as resolveAuthForOrg, f as resolveInstanceUrl, i as readWorkspaceConfig } from "./workspace-D0dnnlxL.js";
3
- import { n as runGenerate } from "./generate-CORu1X2X.js";
4
- import { a as writeAppletSupport, n as loadCliManifest, o as writeWorkspaceSupport, t as assertWorkspaceCli } from "./project-z7x0omdw.js";
3
+ import { n as runGenerate } from "./generate-MWjUbZnO.js";
4
+ import { a as writeAppletSupport, n as loadCliManifest, o as writeWorkspaceSupport, t as assertWorkspaceCli } from "./project-NcWw8SwL.js";
5
5
  import { n as loadAppletSourceDefinition } from "./load-config-BeQZ2yOa.js";
6
6
  import { access, cp, mkdir, readdir, writeFile } from "node:fs/promises";
7
7
  import { relative, resolve } from "node:path";
@@ -140,7 +140,7 @@ function workspacePackage(org) {
140
140
  scripts: {
141
141
  lint: "oxlint",
142
142
  fmt: "oxfmt",
143
- check: "oxfmt --check && oxlint"
143
+ check: "oxfmt --check; s=$?; oxlint && exit $s"
144
144
  },
145
145
  devDependencies: {
146
146
  "@hitch42/applet": "catalog:",
@@ -375,7 +375,7 @@ function appletPackage(definition, options) {
375
375
  typecheck: "tsc --noEmit",
376
376
  lint: "oxlint",
377
377
  fmt: "oxfmt",
378
- check: "oxfmt --check && oxlint"
378
+ check: "oxfmt --check; s=$?; oxlint && exit $s"
379
379
  },
380
380
  dependencies: sortedByName({
381
381
  "@hitch42/applet": "catalog:",
package/dist/vite.js CHANGED
@@ -4,7 +4,7 @@ import { a as openQueryCacheDatabase } from "./query-cache-CXmAyLv3.js";
4
4
  import { d as HITCH_USER_HEADER, u as HITCH_SESSION_HEADER } from "./headers-DkNr9MLJ.js";
5
5
  import { a as workflowOutcomeSchema, n as runWorkflowJournal } from "./workflow-engine-BOTzURKM.js";
6
6
  import { c as bearerToken, d as resolveAuthForOrg, f as resolveInstanceUrl, l as organizationInstanceUrl, t as resolveWorkspaceOrg, u as rejectEnvironmentKey } from "./workspace-D0dnnlxL.js";
7
- import { c as writeClientEntry, i as writeRegisterDeclaration, l as writeManifestGen, r as syncContract, s as writeAppletRoot, u as writeServerEntry } from "./generate-CORu1X2X.js";
7
+ import { c as writeClientEntry, i as writeRegisterDeclaration, l as writeManifestGen, r as syncContract, s as writeAppletRoot, u as writeServerEntry } from "./generate-MWjUbZnO.js";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
10
  import { appendFile, readdir, rm, writeFile } from "node:fs/promises";
@@ -296,16 +296,17 @@ function createDevWorkflows(options) {
296
296
  const APPLET_COMPATIBILITY_DATE = "2026-07-14";
297
297
  const APPLET_COMPATIBILITY_FLAGS = ["nodejs_compat"];
298
298
  let activeDevListener;
299
- function clientBootstrapScript(parentOrigin, appletCode) {
299
+ function clientBootstrapScript(parentOrigin, appletCode, cacheQueries) {
300
300
  return `(function () {
301
301
  var parentOrigin = ${parentOrigin === void 0 ? "null" : JSON.stringify(parentOrigin)};
302
302
  var appletCode = ${JSON.stringify(appletCode)};
303
303
  var appletCodePattern = ${APPLET_CODE_PATTERN.toString()};
304
+ var cacheQueries = ${cacheQueries} && window.parent !== window && parentOrigin !== null;
304
305
 
305
306
  Object.defineProperty(window, "__hitchCacheContext", {
306
307
  configurable: false,
307
308
  writable: false,
308
- value: window.parent !== window && parentOrigin !== null
309
+ value: cacheQueries
309
310
  ? fetch("/__applet/context/" + encodeURIComponent(appletCode), {
310
311
  credentials: "same-origin",
311
312
  headers: { accept: "application/json" }
@@ -324,7 +325,7 @@ function clientBootstrapScript(parentOrigin, appletCode) {
324
325
  Object.defineProperty(window, "__hitchCacheDatabase", {
325
326
  configurable: false,
326
327
  writable: false,
327
- value: window.parent !== window && parentOrigin !== null
328
+ value: cacheQueries
328
329
  ? (function () {
329
330
  var database = (${openQueryCacheDatabase.toString()})();
330
331
  database.catch(function () {});
@@ -568,8 +569,7 @@ function applet(sourceDefinition) {
568
569
  devContext = {
569
570
  person,
570
571
  proxy,
571
- orgUrl,
572
- cacheBuster: randomUUID()
572
+ orgUrl
573
573
  };
574
574
  if (hasServer && devListener === void 0) {
575
575
  if (activeDevListener?.listening) activeDevListener.close();
@@ -627,7 +627,7 @@ function applet(sourceDefinition) {
627
627
  configureServer(server) {
628
628
  if (devContext === void 0) return;
629
629
  const { manifest } = requireAppletConfig();
630
- const { person, proxy, orgUrl, cacheBuster } = devContext;
630
+ const { person, proxy, orgUrl } = devContext;
631
631
  const orgOrigin = new URL(orgUrl).origin;
632
632
  devLogger = server.config.logger;
633
633
  const skipSleep = process.env.HITCH_DEV_SKIP_SLEEP === "1";
@@ -685,24 +685,6 @@ function applet(sourceDefinition) {
685
685
  server.middlewares.use((request, response, next) => {
686
686
  if (request.url === mount || request.url?.startsWith(`${mount}?`)) request.url = `${mount}/${request.url.slice(mount.length)}`;
687
687
  const url = request.url ?? "";
688
- const pathname = url.split("?", 1)[0] ?? "";
689
- if (pathname.startsWith("/__applet/context/")) {
690
- if (pathname !== `/__applet/context/${manifest.code}` || request.method !== "GET") {
691
- response.writeHead(404).end();
692
- return;
693
- }
694
- if (refusesClient(request.headers, request.socket.remoteAddress)) {
695
- response.writeHead(403).end();
696
- return;
697
- }
698
- response.setHeader("Cache-Control", "no-store");
699
- response.setHeader("Content-Type", "application/json; charset=utf-8");
700
- response.end(JSON.stringify({
701
- cacheBuster,
702
- cacheScope: person.id
703
- }));
704
- return;
705
- }
706
688
  if (url === "/_hitch/client.js" || url.startsWith("/_hitch/client.js?")) {
707
689
  response.statusCode = 200;
708
690
  response.setHeader("Cache-Control", "no-store");
@@ -739,7 +721,7 @@ function applet(sourceDefinition) {
739
721
  },
740
722
  transformIndexHtml: {
741
723
  order: "post",
742
- handler(html) {
724
+ handler(html, { server }) {
743
725
  const parentOrigin = devContext?.orgUrl === void 0 ? themeStylesheetUrl === void 0 ? void 0 : new URL(themeStylesheetUrl).origin : new URL(devContext.orgUrl).origin;
744
726
  return {
745
727
  html: themeStylesheetUrl === void 0 ? html : html.replace("href=\"/theme.css\"", `href="${themeStylesheetUrl}"`),
@@ -753,7 +735,7 @@ function applet(sourceDefinition) {
753
735
  injectTo: "head-prepend"
754
736
  }, {
755
737
  tag: "script",
756
- children: clientBootstrapScript(parentOrigin, requireAppletConfig().manifest.code),
738
+ children: clientBootstrapScript(parentOrigin, requireAppletConfig().manifest.code, server === void 0),
757
739
  injectTo: "head-prepend"
758
740
  }]
759
741
  };
@@ -0,0 +1,92 @@
1
+ Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font creation
14
+ efforts of academic and linguistic communities, and to provide a free and
15
+ open framework in which fonts may be shared and improved in partnership
16
+ with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply
25
+ to any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software components as
36
+ distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to, deleting,
39
+ or substituting -- in part or in whole -- any of the components of the
40
+ Original Version, by changing formats or by porting the Font Software to a
41
+ new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION AND CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
49
+ redistribute, and sell modified and unmodified copies of the Font
50
+ Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components,
53
+ in Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the corresponding
64
+ Copyright Holder. This restriction only applies to the primary font name as
65
+ presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created
77
+ using the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
Binary file
Binary file
@@ -0,0 +1,81 @@
1
+ /* Inter 4.1 (https://github.com/rsms/inter, SIL Open Font License, see
2
+ inter/LICENSE.txt) with its weight and optical-size axes, cut into the same
3
+ per-script files as Fontsource so a page downloads only the scripts it
4
+ shows. The Google Fonts build that Fontsource ships drops Inter's
5
+ alternates; these keep the ones Hitch turns on, cv11 (single-storey a) and
6
+ ss01 (open digits), plus tnum, pnum, case and zero. Made with fonttools
7
+ from web/InterVariable.woff2 in the release zip:
8
+
9
+ pyftsubset InterVariable.woff2 --unicodes=<range below>
10
+ --layout-features+=cv11,ss01,tnum,pnum,case,zero
11
+ --flavor=woff2 --no-hinting --desubroutinize */
12
+
13
+ @font-face {
14
+ font-family: "Inter Variable";
15
+ font-style: normal;
16
+ font-display: swap;
17
+ font-weight: 100 900;
18
+ src: url(./inter/inter-cyrillic-ext.woff2) format("woff2");
19
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
20
+ }
21
+
22
+ @font-face {
23
+ font-family: "Inter Variable";
24
+ font-style: normal;
25
+ font-display: swap;
26
+ font-weight: 100 900;
27
+ src: url(./inter/inter-cyrillic.woff2) format("woff2");
28
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
29
+ }
30
+
31
+ @font-face {
32
+ font-family: "Inter Variable";
33
+ font-style: normal;
34
+ font-display: swap;
35
+ font-weight: 100 900;
36
+ src: url(./inter/inter-greek-ext.woff2) format("woff2");
37
+ unicode-range: U+1F00-1FFF;
38
+ }
39
+
40
+ @font-face {
41
+ font-family: "Inter Variable";
42
+ font-style: normal;
43
+ font-display: swap;
44
+ font-weight: 100 900;
45
+ src: url(./inter/inter-greek.woff2) format("woff2");
46
+ unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
47
+ }
48
+
49
+ @font-face {
50
+ font-family: "Inter Variable";
51
+ font-style: normal;
52
+ font-display: swap;
53
+ font-weight: 100 900;
54
+ src: url(./inter/inter-vietnamese.woff2) format("woff2");
55
+ unicode-range:
56
+ U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
57
+ U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
58
+ }
59
+
60
+ @font-face {
61
+ font-family: "Inter Variable";
62
+ font-style: normal;
63
+ font-display: swap;
64
+ font-weight: 100 900;
65
+ src: url(./inter/inter-latin-ext.woff2) format("woff2");
66
+ unicode-range:
67
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
68
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
69
+ U+A720-A7FF;
70
+ }
71
+
72
+ @font-face {
73
+ font-family: "Inter Variable";
74
+ font-style: normal;
75
+ font-display: swap;
76
+ font-weight: 100 900;
77
+ src: url(./inter/inter-latin.woff2) format("woff2");
78
+ unicode-range:
79
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
80
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
81
+ }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@hitch42/applet",
3
- "version": "0.1.1-beta.13",
3
+ "version": "0.1.1-beta.15",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "applet": "./dist/applet.js"
7
7
  },
8
8
  "files": [
9
9
  "dist",
10
+ "fonts",
10
11
  "scaffold"
11
12
  ],
12
13
  "type": "module",
@@ -35,6 +36,7 @@
35
36
  "source": "./src/vite.ts",
36
37
  "default": "./dist/vite.js"
37
38
  },
39
+ "./inter.css": "./fonts/inter.css",
38
40
  "./_internal/client": {
39
41
  "source": "./src/internal/client.ts",
40
42
  "default": "./dist/_internal/client.js"
@@ -1,7 +1,7 @@
1
1
  @import "tailwindcss";
2
2
  @import "tw-animate-css";
3
3
  @import "shadcn/tailwind.css";
4
- @import "@fontsource-variable/inter";
4
+ @import "@hitch42/applet/inter.css";
5
5
  @import "@fontsource-variable/geist-mono";
6
6
 
7
7
  @source "../../../node_modules/@hitch42/applet/dist/react.js";
@@ -14,6 +14,11 @@
14
14
  --font-heading: var(--font-sans);
15
15
  --font-sans: "Inter Variable", sans-serif;
16
16
  --font-mono: "Geist Mono Variable", monospace;
17
+ /* Inter's single-storey a and open digits, as in the Hitch dashboard. Geist
18
+ Mono maps the same tags to its own alternates, so mono text resets them. */
19
+ --font-sans--font-feature-settings: "cv11", "ss01";
20
+ --font-heading--font-feature-settings: "cv11", "ss01";
21
+ --font-mono--font-feature-settings: normal;
17
22
  --color-sidebar-ring: var(--sidebar-ring);
18
23
  --color-sidebar-border: var(--sidebar-border);
19
24
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@@ -1,2 +0,0 @@
1
- import { i as runBuild } from "./build-CwOM9C0W.js";
2
- export { runBuild };
@@ -1,2 +0,0 @@
1
- import { n as runGenerate } from "./generate-CORu1X2X.js";
2
- export { runGenerate };