@sequenceholdings/artifact-studio 0.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/api.d.ts +14 -0
- package/dist/api.js +49 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +129 -0
- package/dist/build.d.ts +12 -0
- package/dist/build.js +134 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +475 -0
- package/dist/config.d.ts +23 -0
- package/dist/config.js +48 -0
- package/dist/hash.d.ts +10 -0
- package/dist/hash.js +36 -0
- package/dist/manifest.d.ts +44 -0
- package/dist/manifest.js +45 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.js +34 -0
- package/dist/project.d.ts +14 -0
- package/dist/project.js +76 -0
- package/dist/sdk.d.ts +60 -0
- package/dist/sdk.js +4 -0
- package/dist/templates/react-vite/CLAUDE.md +55 -0
- package/dist/templates/react-vite/artifact.bundle.yml +30 -0
- package/dist/templates/react-vite/index.html +12 -0
- package/dist/templates/react-vite/package.json +27 -0
- package/dist/templates/react-vite/src/App.tsx +54 -0
- package/dist/templates/react-vite/src/lib/api.ts +13 -0
- package/dist/templates/react-vite/src/main.tsx +18 -0
- package/dist/templates/react-vite/src/styles.css +3 -0
- package/dist/templates/react-vite/vite.config.ts +7 -0
- package/package.json +50 -0
- package/templates/react-vite/CLAUDE.md +55 -0
- package/templates/react-vite/artifact.bundle.yml +30 -0
- package/templates/react-vite/index.html +12 -0
- package/templates/react-vite/package.json +27 -0
- package/templates/react-vite/src/App.tsx +54 -0
- package/templates/react-vite/src/lib/api.ts +13 -0
- package/templates/react-vite/src/main.tsx +18 -0
- package/templates/react-vite/src/styles.css +3 -0
- package/templates/react-vite/vite.config.ts +7 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { seq } from '@sequenceholdings/artifact-studio'
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Card,
|
|
5
|
+
CardHeader,
|
|
6
|
+
CardTitle,
|
|
7
|
+
CardContent,
|
|
8
|
+
Badge,
|
|
9
|
+
} from '@sequenceholdings/atlas-ui'
|
|
10
|
+
|
|
11
|
+
const CARDS = [
|
|
12
|
+
{ label: 'Source model', value: 'Vite React' },
|
|
13
|
+
{ label: 'Runtime', value: 'Atlas iframe' },
|
|
14
|
+
{ label: 'Release mode', value: 'Immutable' },
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
export default function App() {
|
|
18
|
+
async function pingAtlas() {
|
|
19
|
+
const response = await seq.api.get<{ ok?: boolean }>('/api/health')
|
|
20
|
+
alert(`Atlas responded: ${JSON.stringify(response)}`)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<main className="min-h-screen bg-background p-10">
|
|
25
|
+
<p className="text-xs font-extrabold tracking-widest uppercase text-primary mb-2">
|
|
26
|
+
Artifact Studio
|
|
27
|
+
</p>
|
|
28
|
+
<h1 className="text-lg font-bold tracking-tight">Build on Atlas</h1>
|
|
29
|
+
<p className="text-muted-foreground leading-relaxed max-w-2xl mt-2">
|
|
30
|
+
This app uses Atlas's shared UI component library. Import any
|
|
31
|
+
component from <code className="text-sm font-mono">@sequenceholdings/atlas-ui</code>.
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
<div className="grid grid-cols-1 sm:grid-cols-3 gap-sm mt-7 max-w-3xl">
|
|
35
|
+
{CARDS.map((card) => (
|
|
36
|
+
<Card key={card.label}>
|
|
37
|
+
<CardHeader>
|
|
38
|
+
<CardTitle className="text-sm text-muted-foreground">
|
|
39
|
+
{card.label}
|
|
40
|
+
</CardTitle>
|
|
41
|
+
</CardHeader>
|
|
42
|
+
<CardContent>
|
|
43
|
+
<Badge variant="secondary">{card.value}</Badge>
|
|
44
|
+
</CardContent>
|
|
45
|
+
</Card>
|
|
46
|
+
))}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<Button className="mt-6" onClick={pingAtlas}>
|
|
50
|
+
Test Atlas API bridge
|
|
51
|
+
</Button>
|
|
52
|
+
</main>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { seq } from '@sequenceholdings/artifact-studio'
|
|
2
|
+
|
|
3
|
+
export async function unwrap<T>(p: Promise<unknown>): Promise<T> {
|
|
4
|
+
const json = await p
|
|
5
|
+
if (json && typeof json === 'object' && 'success' in json && 'data' in json) {
|
|
6
|
+
const env = json as { success: boolean; data: T; error?: string }
|
|
7
|
+
if (!env.success) throw new Error(env.error ?? 'API call failed')
|
|
8
|
+
return env.data
|
|
9
|
+
}
|
|
10
|
+
return json as T
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { seq }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { createRoot } from 'react-dom/client'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
+
import { PortalContainerProvider } from '@sequenceholdings/atlas-ui'
|
|
5
|
+
import App from './App'
|
|
6
|
+
import './styles.css'
|
|
7
|
+
|
|
8
|
+
const queryClient = new QueryClient()
|
|
9
|
+
|
|
10
|
+
createRoot(document.getElementById('root')!).render(
|
|
11
|
+
<React.StrictMode>
|
|
12
|
+
<QueryClientProvider client={queryClient}>
|
|
13
|
+
<PortalContainerProvider>
|
|
14
|
+
<App />
|
|
15
|
+
</PortalContainerProvider>
|
|
16
|
+
</QueryClientProvider>
|
|
17
|
+
</React.StrictMode>,
|
|
18
|
+
)
|