@indietabletop/appkit 2.0.0 → 2.1.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/dist/client.d.ts +2 -2
- package/dist/client.js +1 -1
- package/dist/defineNetlifyConfig.d.ts +34 -0
- package/dist/defineNetlifyConfig.js +35 -0
- package/dist/external-link.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/use-async-op.d.ts +1 -1
- package/package.json +8 -4
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Failure, Success } from "@indietabletop/appkit/async-op";
|
|
2
|
-
import { Infer, Struct } from "superstruct";
|
|
3
|
-
import { CurrentUser, FailurePayload, SessionInfo } from "./types.js";
|
|
2
|
+
import { type Infer, Struct } from "superstruct";
|
|
3
|
+
import type { CurrentUser, FailurePayload, SessionInfo } from "./types.js";
|
|
4
4
|
export declare class IndieTabletopClient {
|
|
5
5
|
origin: string;
|
|
6
6
|
private onCurrentUser?;
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Failure, Success } from "@indietabletop/appkit/async-op";
|
|
2
|
-
import { mask, object, string } from "superstruct";
|
|
2
|
+
import { mask, object, string, Struct } from "superstruct";
|
|
3
3
|
import { currentUser, sessionInfo } from "./structs.js";
|
|
4
4
|
export class IndieTabletopClient {
|
|
5
5
|
constructor(props) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ConfigEnv, PluginOption, UserConfig } from "vite";
|
|
2
|
+
export declare function defineNetlifyConfig(props: {
|
|
3
|
+
/**
|
|
4
|
+
* The server port number.
|
|
5
|
+
*
|
|
6
|
+
* Game apps start from 8000, automation apps from 9000. So far, we got:
|
|
7
|
+
*
|
|
8
|
+
* - API: 8000
|
|
9
|
+
* - Hobgoblin: 8001
|
|
10
|
+
* - Eternol: 8002
|
|
11
|
+
* - Gregbot: 9000
|
|
12
|
+
*/
|
|
13
|
+
port: number;
|
|
14
|
+
/**
|
|
15
|
+
* By default, react and vanilla extract are always configured.
|
|
16
|
+
*/
|
|
17
|
+
additionalPlugins?: PluginOption[];
|
|
18
|
+
/**
|
|
19
|
+
* Can be used to import from `@` at the path specified here. Has to match
|
|
20
|
+
* tsconfig > compilerOptions > paths.
|
|
21
|
+
*
|
|
22
|
+
* Do not use this, just use relative imports.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
resolveAlias?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Determines whether input is "/index.html", or "index.html" or
|
|
29
|
+
* "/src/main.tsx" depnending on command.
|
|
30
|
+
*
|
|
31
|
+
* This is useful when using pre-rendered HTML as input.
|
|
32
|
+
*/
|
|
33
|
+
conditionalInput?: boolean;
|
|
34
|
+
}): ({ command }: ConfigEnv) => UserConfig;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { vanillaExtractPlugin as vanilla } from "@vanilla-extract/vite-plugin";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
export function defineNetlifyConfig(props) {
|
|
4
|
+
const { additionalPlugins = [], conditionalInput = false, resolveAlias, } = props;
|
|
5
|
+
return function configureVite({ command }) {
|
|
6
|
+
return {
|
|
7
|
+
define: {
|
|
8
|
+
// These vars are supplied by Netlify
|
|
9
|
+
BRANCH: JSON.stringify(process.env.BRANCH),
|
|
10
|
+
COMMIT_SHORTCODE: JSON.stringify(process.env.COMMIT_REF?.slice(0, 7)),
|
|
11
|
+
},
|
|
12
|
+
plugins: [react(), vanilla(), ...additionalPlugins],
|
|
13
|
+
esbuild: {
|
|
14
|
+
target: "es2022",
|
|
15
|
+
},
|
|
16
|
+
server: {
|
|
17
|
+
port: props.port,
|
|
18
|
+
},
|
|
19
|
+
resolve: {
|
|
20
|
+
alias: resolveAlias ? { "@": resolveAlias } : undefined,
|
|
21
|
+
},
|
|
22
|
+
build: {
|
|
23
|
+
sourcemap: true,
|
|
24
|
+
manifest: true,
|
|
25
|
+
rollupOptions: {
|
|
26
|
+
// During `build`, we want to only deal with JS files. Production HTML
|
|
27
|
+
// entrypoint is generated via the `build:entrypoint` package script.
|
|
28
|
+
input: conditionalInput && command === "build"
|
|
29
|
+
? "/src/main.tsx"
|
|
30
|
+
: "/index.html",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
package/dist/external-link.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnchorHTMLAttributes } from "react";
|
|
1
|
+
import type { AnchorHTMLAttributes } from "react";
|
|
2
2
|
type ExternalLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "rel" | "target">;
|
|
3
3
|
export declare function ExternalLink(props: ExternalLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Infer } from "superstruct";
|
|
1
|
+
import type { Infer } from "superstruct";
|
|
2
2
|
import { currentUser, sessionInfo } from "./structs.js";
|
|
3
3
|
export type CurrentUser = Infer<ReturnType<typeof currentUser>>;
|
|
4
4
|
export type SessionInfo = Infer<ReturnType<typeof sessionInfo>>;
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import { currentUser, sessionInfo } from "./structs.js";
|
package/dist/use-async-op.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indietabletop/appkit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A collection of modules used in apps built by Indie Tabletop Club",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -19,15 +19,19 @@
|
|
|
19
19
|
"repository": "github:indietabletop/appkit",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"react": "^18.0.0 || ^19.0.0"
|
|
22
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
23
|
+
"vite": "^6.0.0"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@types/react": "^19.0.8",
|
|
26
27
|
"np": "^10.1.0",
|
|
27
28
|
"typescript": "^5.7.2",
|
|
28
|
-
"vitest": "^
|
|
29
|
+
"vitest": "^3.0.5"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"
|
|
32
|
+
"@vanilla-extract/vite-plugin": "^5.0.0",
|
|
33
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
34
|
+
"superstruct": "^2.0.2",
|
|
35
|
+
"vite": "^6.1.0"
|
|
32
36
|
}
|
|
33
37
|
}
|