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.
Files changed (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +217 -0
  3. package/bin/create-dig-app.js +17 -0
  4. package/lib/cli.js +438 -0
  5. package/lib/index.js +235 -0
  6. package/lib/nft-cli.js +265 -0
  7. package/lib/nft-metadata.js +515 -0
  8. package/lib/substitute.js +47 -0
  9. package/lib/templates.js +185 -0
  10. package/package.json +51 -0
  11. package/templates/dapp-window-chia/README.md +63 -0
  12. package/templates/dapp-window-chia/_env.example +7 -0
  13. package/templates/dapp-window-chia/_gitignore +10 -0
  14. package/templates/dapp-window-chia/dig.toml +17 -0
  15. package/templates/dapp-window-chia/index.html +12 -0
  16. package/templates/dapp-window-chia/package.json +24 -0
  17. package/templates/dapp-window-chia/src/App.jsx +91 -0
  18. package/templates/dapp-window-chia/src/main.jsx +10 -0
  19. package/templates/dapp-window-chia/src/styles.css +71 -0
  20. package/templates/dapp-window-chia/src/wallet.js +47 -0
  21. package/templates/dapp-window-chia/vite.config.js +14 -0
  22. package/templates/next-static/README.md +41 -0
  23. package/templates/next-static/_gitignore +6 -0
  24. package/templates/next-static/app/globals.css +49 -0
  25. package/templates/next-static/app/layout.jsx +14 -0
  26. package/templates/next-static/app/page.jsx +18 -0
  27. package/templates/next-static/dig.toml +17 -0
  28. package/templates/next-static/next.config.mjs +11 -0
  29. package/templates/next-static/package.json +16 -0
  30. package/templates/nft-collection/README.md +119 -0
  31. package/templates/nft-collection/_env.example +5 -0
  32. package/templates/nft-collection/_gitignore +9 -0
  33. package/templates/nft-collection/assets/banner.svg +11 -0
  34. package/templates/nft-collection/assets/icon.svg +10 -0
  35. package/templates/nft-collection/collection.json +14 -0
  36. package/templates/nft-collection/dig.toml +23 -0
  37. package/templates/nft-collection/images/sample-1.svg +5 -0
  38. package/templates/nft-collection/images/sample-2.svg +5 -0
  39. package/templates/nft-collection/licenses/.gitkeep +1 -0
  40. package/templates/nft-collection/metadata/.gitkeep +2 -0
  41. package/templates/nft-collection/package.json +18 -0
  42. package/templates/nft-collection/scripts/dig-nft.mjs +479 -0
  43. package/templates/nft-collection/src/mint.js +72 -0
  44. package/templates/nft-collection/src/styles.css +64 -0
  45. package/templates/nft-collection/traits.csv +3 -0
  46. package/templates/nft-drop/README.md +71 -0
  47. package/templates/nft-drop/_env.example +7 -0
  48. package/templates/nft-drop/_gitignore +10 -0
  49. package/templates/nft-drop/dig.toml +18 -0
  50. package/templates/nft-drop/index.html +12 -0
  51. package/templates/nft-drop/package.json +24 -0
  52. package/templates/nft-drop/src/App.jsx +91 -0
  53. package/templates/nft-drop/src/main.jsx +10 -0
  54. package/templates/nft-drop/src/mint.js +72 -0
  55. package/templates/nft-drop/src/styles.css +70 -0
  56. package/templates/nft-drop/vite.config.js +13 -0
  57. package/templates/static-site/README.md +41 -0
  58. package/templates/static-site/_gitignore +5 -0
  59. package/templates/static-site/dig.toml +19 -0
  60. package/templates/static-site/package.json +10 -0
  61. package/templates/static-site/scripts/build.mjs +14 -0
  62. package/templates/static-site/src/index.html +20 -0
  63. package/templates/static-site/src/styles.css +49 -0
  64. package/templates/vite-react/README.md +42 -0
  65. package/templates/vite-react/_gitignore +5 -0
  66. package/templates/vite-react/dig.toml +17 -0
  67. package/templates/vite-react/index.html +12 -0
  68. package/templates/vite-react/package.json +20 -0
  69. package/templates/vite-react/src/App.jsx +18 -0
  70. package/templates/vite-react/src/main.jsx +10 -0
  71. package/templates/vite-react/src/styles.css +49 -0
  72. package/templates/vite-react/vite.config.js +9 -0
  73. package/templates-ts/dapp-window-chia/README.md +67 -0
  74. package/templates-ts/dapp-window-chia/_env.example +7 -0
  75. package/templates-ts/dapp-window-chia/_gitignore +10 -0
  76. package/templates-ts/dapp-window-chia/dig.toml +17 -0
  77. package/templates-ts/dapp-window-chia/index.html +12 -0
  78. package/templates-ts/dapp-window-chia/package.json +28 -0
  79. package/templates-ts/dapp-window-chia/src/App.tsx +93 -0
  80. package/templates-ts/dapp-window-chia/src/main.tsx +13 -0
  81. package/templates-ts/dapp-window-chia/src/styles.css +71 -0
  82. package/templates-ts/dapp-window-chia/src/vite-env.d.ts +11 -0
  83. package/templates-ts/dapp-window-chia/src/wallet.ts +62 -0
  84. package/templates-ts/dapp-window-chia/tsconfig.json +20 -0
  85. package/templates-ts/dapp-window-chia/vite.config.ts +14 -0
  86. package/templates-ts/next-static/README.md +43 -0
  87. package/templates-ts/next-static/_gitignore +7 -0
  88. package/templates-ts/next-static/app/globals.css +49 -0
  89. package/templates-ts/next-static/app/layout.tsx +16 -0
  90. package/templates-ts/next-static/app/page.tsx +18 -0
  91. package/templates-ts/next-static/dig.toml +17 -0
  92. package/templates-ts/next-static/next-env.d.ts +5 -0
  93. package/templates-ts/next-static/next.config.mjs +11 -0
  94. package/templates-ts/next-static/package.json +23 -0
  95. package/templates-ts/next-static/tsconfig.json +21 -0
  96. package/templates-ts/nft-drop/README.md +74 -0
  97. package/templates-ts/nft-drop/_env.example +7 -0
  98. package/templates-ts/nft-drop/_gitignore +10 -0
  99. package/templates-ts/nft-drop/dig.toml +18 -0
  100. package/templates-ts/nft-drop/index.html +12 -0
  101. package/templates-ts/nft-drop/package.json +28 -0
  102. package/templates-ts/nft-drop/src/App.tsx +93 -0
  103. package/templates-ts/nft-drop/src/main.tsx +13 -0
  104. package/templates-ts/nft-drop/src/mint.ts +86 -0
  105. package/templates-ts/nft-drop/src/styles.css +70 -0
  106. package/templates-ts/nft-drop/src/vite-env.d.ts +11 -0
  107. package/templates-ts/nft-drop/tsconfig.json +20 -0
  108. package/templates-ts/nft-drop/vite.config.ts +13 -0
  109. package/templates-ts/vite-react/README.md +44 -0
  110. package/templates-ts/vite-react/_gitignore +5 -0
  111. package/templates-ts/vite-react/dig.toml +17 -0
  112. package/templates-ts/vite-react/index.html +12 -0
  113. package/templates-ts/vite-react/package.json +24 -0
  114. package/templates-ts/vite-react/src/App.tsx +18 -0
  115. package/templates-ts/vite-react/src/main.tsx +13 -0
  116. package/templates-ts/vite-react/src/styles.css +49 -0
  117. package/templates-ts/vite-react/src/vite-env.d.ts +1 -0
  118. package/templates-ts/vite-react/tsconfig.json +20 -0
  119. 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
+ });