create-dig-app 0.1.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/LICENSE +21 -0
- package/README.md +217 -0
- package/bin/create-dig-app.js +17 -0
- package/lib/cli.js +438 -0
- package/lib/index.js +235 -0
- package/lib/nft-cli.js +265 -0
- package/lib/nft-metadata.js +515 -0
- package/lib/substitute.js +47 -0
- package/lib/templates.js +185 -0
- package/package.json +51 -0
- package/templates/dapp-window-chia/README.md +63 -0
- package/templates/dapp-window-chia/_env.example +7 -0
- package/templates/dapp-window-chia/_gitignore +10 -0
- package/templates/dapp-window-chia/dig.toml +17 -0
- package/templates/dapp-window-chia/index.html +12 -0
- package/templates/dapp-window-chia/package.json +24 -0
- package/templates/dapp-window-chia/src/App.jsx +91 -0
- package/templates/dapp-window-chia/src/main.jsx +10 -0
- package/templates/dapp-window-chia/src/styles.css +71 -0
- package/templates/dapp-window-chia/src/wallet.js +47 -0
- package/templates/dapp-window-chia/vite.config.js +14 -0
- package/templates/next-static/README.md +41 -0
- package/templates/next-static/_gitignore +6 -0
- package/templates/next-static/app/globals.css +49 -0
- package/templates/next-static/app/layout.jsx +14 -0
- package/templates/next-static/app/page.jsx +18 -0
- package/templates/next-static/dig.toml +17 -0
- package/templates/next-static/next.config.mjs +11 -0
- package/templates/next-static/package.json +16 -0
- package/templates/nft-collection/README.md +119 -0
- package/templates/nft-collection/_env.example +5 -0
- package/templates/nft-collection/_gitignore +9 -0
- package/templates/nft-collection/assets/banner.svg +11 -0
- package/templates/nft-collection/assets/icon.svg +10 -0
- package/templates/nft-collection/collection.json +14 -0
- package/templates/nft-collection/dig.toml +23 -0
- package/templates/nft-collection/images/sample-1.svg +5 -0
- package/templates/nft-collection/images/sample-2.svg +5 -0
- package/templates/nft-collection/licenses/.gitkeep +1 -0
- package/templates/nft-collection/metadata/.gitkeep +2 -0
- package/templates/nft-collection/package.json +18 -0
- package/templates/nft-collection/scripts/dig-nft.mjs +479 -0
- package/templates/nft-collection/src/mint.js +72 -0
- package/templates/nft-collection/src/styles.css +64 -0
- package/templates/nft-collection/traits.csv +3 -0
- package/templates/nft-drop/README.md +71 -0
- package/templates/nft-drop/_env.example +7 -0
- package/templates/nft-drop/_gitignore +10 -0
- package/templates/nft-drop/dig.toml +18 -0
- package/templates/nft-drop/index.html +12 -0
- package/templates/nft-drop/package.json +24 -0
- package/templates/nft-drop/src/App.jsx +91 -0
- package/templates/nft-drop/src/main.jsx +10 -0
- package/templates/nft-drop/src/mint.js +72 -0
- package/templates/nft-drop/src/styles.css +70 -0
- package/templates/nft-drop/vite.config.js +13 -0
- package/templates/static-site/README.md +41 -0
- package/templates/static-site/_gitignore +5 -0
- package/templates/static-site/dig.toml +19 -0
- package/templates/static-site/package.json +10 -0
- package/templates/static-site/scripts/build.mjs +14 -0
- package/templates/static-site/src/index.html +20 -0
- package/templates/static-site/src/styles.css +49 -0
- package/templates/vite-react/README.md +42 -0
- package/templates/vite-react/_gitignore +5 -0
- package/templates/vite-react/dig.toml +17 -0
- package/templates/vite-react/index.html +12 -0
- package/templates/vite-react/package.json +20 -0
- package/templates/vite-react/src/App.jsx +18 -0
- package/templates/vite-react/src/main.jsx +10 -0
- package/templates/vite-react/src/styles.css +49 -0
- package/templates/vite-react/vite.config.js +9 -0
- package/templates-ts/dapp-window-chia/README.md +67 -0
- package/templates-ts/dapp-window-chia/_env.example +7 -0
- package/templates-ts/dapp-window-chia/_gitignore +10 -0
- package/templates-ts/dapp-window-chia/dig.toml +17 -0
- package/templates-ts/dapp-window-chia/index.html +12 -0
- package/templates-ts/dapp-window-chia/package.json +28 -0
- package/templates-ts/dapp-window-chia/src/App.tsx +93 -0
- package/templates-ts/dapp-window-chia/src/main.tsx +13 -0
- package/templates-ts/dapp-window-chia/src/styles.css +71 -0
- package/templates-ts/dapp-window-chia/src/vite-env.d.ts +11 -0
- package/templates-ts/dapp-window-chia/src/wallet.ts +62 -0
- package/templates-ts/dapp-window-chia/tsconfig.json +20 -0
- package/templates-ts/dapp-window-chia/vite.config.ts +14 -0
- package/templates-ts/next-static/README.md +43 -0
- package/templates-ts/next-static/_gitignore +7 -0
- package/templates-ts/next-static/app/globals.css +49 -0
- package/templates-ts/next-static/app/layout.tsx +16 -0
- package/templates-ts/next-static/app/page.tsx +18 -0
- package/templates-ts/next-static/dig.toml +17 -0
- package/templates-ts/next-static/next-env.d.ts +5 -0
- package/templates-ts/next-static/next.config.mjs +11 -0
- package/templates-ts/next-static/package.json +23 -0
- package/templates-ts/next-static/tsconfig.json +21 -0
- package/templates-ts/nft-drop/README.md +74 -0
- package/templates-ts/nft-drop/_env.example +7 -0
- package/templates-ts/nft-drop/_gitignore +10 -0
- package/templates-ts/nft-drop/dig.toml +18 -0
- package/templates-ts/nft-drop/index.html +12 -0
- package/templates-ts/nft-drop/package.json +28 -0
- package/templates-ts/nft-drop/src/App.tsx +93 -0
- package/templates-ts/nft-drop/src/main.tsx +13 -0
- package/templates-ts/nft-drop/src/mint.ts +86 -0
- package/templates-ts/nft-drop/src/styles.css +70 -0
- package/templates-ts/nft-drop/src/vite-env.d.ts +11 -0
- package/templates-ts/nft-drop/tsconfig.json +20 -0
- package/templates-ts/nft-drop/vite.config.ts +13 -0
- package/templates-ts/vite-react/README.md +44 -0
- package/templates-ts/vite-react/_gitignore +5 -0
- package/templates-ts/vite-react/dig.toml +17 -0
- package/templates-ts/vite-react/index.html +12 -0
- package/templates-ts/vite-react/package.json +24 -0
- package/templates-ts/vite-react/src/App.tsx +18 -0
- package/templates-ts/vite-react/src/main.tsx +13 -0
- package/templates-ts/vite-react/src/styles.css +49 -0
- package/templates-ts/vite-react/src/vite-env.d.ts +1 -0
- package/templates-ts/vite-react/tsconfig.json +20 -0
- package/templates-ts/vite-react/vite.config.ts +9 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__APP_NAME__",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "__DISPLAY_NAME__ — a React + TypeScript app on the DIG Network, built with Vite.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"build": "tsc --noEmit && vite build",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"typecheck": "tsc --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"react": "^18.3.1",
|
|
15
|
+
"react-dom": "^18.3.1"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/react": "^18.3.12",
|
|
19
|
+
"@types/react-dom": "^18.3.1",
|
|
20
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
21
|
+
"typescript": "^5.6.3",
|
|
22
|
+
"vite": "^5.4.11"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default function App() {
|
|
2
|
+
return (
|
|
3
|
+
<main className="wrap">
|
|
4
|
+
<h1>__DISPLAY_NAME__</h1>
|
|
5
|
+
<p>
|
|
6
|
+
A React app on the <strong>DIG Network</strong> — served from a network no host can read,
|
|
7
|
+
change, or take down.
|
|
8
|
+
</p>
|
|
9
|
+
<p className="muted">
|
|
10
|
+
Build and preview for <strong>free</strong>. You only spend $DIG when you publish.
|
|
11
|
+
</p>
|
|
12
|
+
<pre>
|
|
13
|
+
<code>{`digstore dev # preview, free
|
|
14
|
+
digstore deploy # publish a capsule ($DIG)`}</code>
|
|
15
|
+
</pre>
|
|
16
|
+
</main>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import App from "./App.tsx";
|
|
4
|
+
import "./styles.css";
|
|
5
|
+
|
|
6
|
+
const rootEl = document.getElementById("root");
|
|
7
|
+
if (!rootEl) throw new Error("Root element #root not found");
|
|
8
|
+
|
|
9
|
+
createRoot(rootEl).render(
|
|
10
|
+
<React.StrictMode>
|
|
11
|
+
<App />
|
|
12
|
+
</React.StrictMode>,
|
|
13
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light dark;
|
|
3
|
+
--fg: #0f172a;
|
|
4
|
+
--muted: #64748b;
|
|
5
|
+
--bg: #f8fafc;
|
|
6
|
+
--error: #dc2626;
|
|
7
|
+
|
|
8
|
+
/* DIG brand accent — violet -> magenta (SYSTEM.md visual theme; matches dig.net/hub/status). */
|
|
9
|
+
--dig-violet: #5800D6;
|
|
10
|
+
--dig-magenta: #FF00DE;
|
|
11
|
+
--accent: var(--dig-violet);
|
|
12
|
+
--grad-brand: linear-gradient(115deg, #5800D6 0%, #FF00DE 100%);
|
|
13
|
+
|
|
14
|
+
/* DIG brand fonts — named first, system stack as the offline/no-fetch fallback so a scaffolded
|
|
15
|
+
capsule never depends on an external font host (keeps the site self-contained + offline-safe). */
|
|
16
|
+
--dig-font: "Space Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
|
|
17
|
+
--dig-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
18
|
+
}
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
:root { --fg: #e2e8f0; --muted: #94a3b8; --bg: #0b1120; }
|
|
21
|
+
}
|
|
22
|
+
* { box-sizing: border-box; }
|
|
23
|
+
body {
|
|
24
|
+
margin: 0;
|
|
25
|
+
min-height: 100vh;
|
|
26
|
+
display: grid;
|
|
27
|
+
place-items: center;
|
|
28
|
+
font: 16px/1.6 var(--dig-font);
|
|
29
|
+
color: var(--fg);
|
|
30
|
+
background: var(--bg);
|
|
31
|
+
}
|
|
32
|
+
.wrap { max-width: 40rem; padding: 2rem; }
|
|
33
|
+
h1 {
|
|
34
|
+
font-size: 2.25rem;
|
|
35
|
+
margin: 0 0 0.5rem;
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
background: var(--grad-brand);
|
|
38
|
+
-webkit-background-clip: text;
|
|
39
|
+
background-clip: text;
|
|
40
|
+
color: transparent;
|
|
41
|
+
}
|
|
42
|
+
.muted { color: var(--muted); }
|
|
43
|
+
pre {
|
|
44
|
+
font-family: var(--dig-mono);
|
|
45
|
+
background: rgba(127, 127, 127, 0.12);
|
|
46
|
+
padding: 1rem;
|
|
47
|
+
border-radius: 0.5rem;
|
|
48
|
+
overflow-x: auto;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"jsx": "react-jsx",
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true
|
|
18
|
+
},
|
|
19
|
+
"include": ["src", "vite.config.ts"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
|
|
4
|
+
// Relative base so the built site works from any path on a *.on.dig.net subdomain (and chia://).
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
base: "./",
|
|
7
|
+
plugins: [react()],
|
|
8
|
+
build: { outDir: "dist" },
|
|
9
|
+
});
|