@getcortexlabs/create-mavis 0.1.0-alpha.8 → 0.1.0-rc.11.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/README.md +31 -6
- package/package.json +7 -2
- package/src/add-target.mjs +378 -0
- package/src/cli.mjs +231 -107
- package/src/doctor.mjs +9 -0
- package/src/package-manager.mjs +105 -0
- package/src/portability.mjs +460 -0
- package/src/presets.mjs +25 -7
- package/src/reference.mjs +45 -0
- package/src/scaffold.mjs +124 -32
- package/src/shared-api.mjs +57 -0
- package/src/ui.mjs +276 -0
- package/templates/directory/mobile/src/App.vue +4 -0
- package/templates/directory/mobile/src/app.ts +32 -0
- package/templates/directory/nuxt/app/app.vue +1 -0
- package/templates/directory/nuxt/app/pages/entries/[id]/edit.vue +5 -0
- package/templates/directory/nuxt/app/pages/entries/[id]/index.vue +5 -0
- package/templates/directory/nuxt/app/pages/index.vue +4 -0
- package/templates/directory/nuxt/app/plugins/mavis.ts +34 -0
- package/templates/directory/shared/Details.vue +26 -0
- package/templates/directory/shared/Directory.vue +51 -0
- package/templates/directory/shared/Edit.vue +99 -0
- package/templates/directory/shared/directory-store.ts +82 -0
- package/templates/directory/shared/routes.ts +9 -0
- package/templates/directory/vite/src/App.vue +4 -0
- package/templates/directory/vite/src/main.ts +34 -0
- package/templates/mobile/src/App.vue +1 -3
- package/templates/mobile/src/mavis.ts +84 -0
- package/templates/mobile/tsconfig.json +9 -2
- package/templates/mobile/webpack.config.js +2 -0
- package/templates/nuxt/app/mavis.ts +84 -0
- package/templates/nuxt/nuxt.config.ts +5 -0
- package/templates/shared/Welcome.vue +114 -32
- package/templates/vite/src/mavis.ts +84 -0
- package/templates/vite/tsconfig.json +5 -1
- package/templates/vite/vite.config.ts +8 -1
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
MAlert,
|
|
5
|
+
MBadge,
|
|
6
|
+
MStack,
|
|
7
|
+
MProgress,
|
|
8
|
+
MSeparator,
|
|
9
|
+
MButton,
|
|
10
|
+
MCard,
|
|
11
|
+
MColumn,
|
|
12
|
+
MIcon,
|
|
13
|
+
MInput,
|
|
14
|
+
MReveal,
|
|
15
|
+
MRow,
|
|
16
|
+
MScreen,
|
|
17
|
+
MText,
|
|
18
|
+
useMavisTheme,
|
|
19
|
+
} from '#mavis'
|
|
4
20
|
import { useProjectService } from './services'
|
|
5
21
|
|
|
6
22
|
const { theme, setAppearance } = useMavisTheme()
|
|
@@ -9,6 +25,32 @@ const name = ref('A new beginning')
|
|
|
9
25
|
const saving = ref(false)
|
|
10
26
|
const saved = ref(false)
|
|
11
27
|
const error = ref('')
|
|
28
|
+
const done = ref(['imagine'])
|
|
29
|
+
const milestones = [
|
|
30
|
+
{
|
|
31
|
+
id: 'imagine',
|
|
32
|
+
title: 'Find the spark',
|
|
33
|
+
detail: 'One idea worth making room for.',
|
|
34
|
+
icon: 'sparkles',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'shape',
|
|
38
|
+
title: 'Give it a shape',
|
|
39
|
+
detail: 'A name, a direction, a first draft.',
|
|
40
|
+
icon: 'pencil',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'share',
|
|
44
|
+
title: 'Put it into the world',
|
|
45
|
+
detail: 'Small steps become something real.',
|
|
46
|
+
icon: 'send',
|
|
47
|
+
},
|
|
48
|
+
] as const
|
|
49
|
+
function toggle(id: string) {
|
|
50
|
+
done.value = done.value.includes(id)
|
|
51
|
+
? done.value.filter((value) => value !== id)
|
|
52
|
+
: [...done.value, id]
|
|
53
|
+
}
|
|
12
54
|
const canSave = computed(() => name.value.trim().length > 0)
|
|
13
55
|
async function save() {
|
|
14
56
|
if (!canSave.value || saving.value) return
|
|
@@ -43,39 +85,79 @@ async function save() {
|
|
|
43
85
|
/>
|
|
44
86
|
</m-row>
|
|
45
87
|
<m-column paddingY="xl" gap="md">
|
|
46
|
-
<m-text variant="overline" tone="accent">
|
|
47
|
-
<m-text as="h1" variant="display">
|
|
48
|
-
<m-text tone="muted"
|
|
49
|
-
|
|
50
|
-
<m-card gap="lg">
|
|
51
|
-
<m-row justify="between" gap="sm">
|
|
52
|
-
<m-text variant="heading">Start something</m-text>
|
|
53
|
-
<m-icon name="sparkles" tone="primary" />
|
|
54
|
-
</m-row>
|
|
55
|
-
<m-input
|
|
56
|
-
v-model="name"
|
|
57
|
-
label="Project name"
|
|
58
|
-
name="project-name"
|
|
59
|
-
autocomplete="off"
|
|
60
|
-
helperText="A small beginning is still a beginning."
|
|
61
|
-
@update:modelValue="saved = false"
|
|
62
|
-
@submit="save"
|
|
63
|
-
/>
|
|
64
|
-
<m-alert v-if="error" tone="error" title="Let’s try again" :description="error" />
|
|
65
|
-
<m-button
|
|
66
|
-
:disabled="!canSave"
|
|
67
|
-
:loading="saving"
|
|
68
|
-
loadingText="Saving…"
|
|
69
|
-
icon="arrow-right"
|
|
70
|
-
@click="save"
|
|
71
|
-
>Create project</m-button
|
|
88
|
+
<m-text variant="overline" tone="accent">YOUR PERSONAL CREATIVE SPACE.</m-text>
|
|
89
|
+
<m-text as="h1" variant="display">Good things start here.</m-text>
|
|
90
|
+
<m-text tone="muted"
|
|
91
|
+
>Collect an idea, find your rhythm, and make a little progress every day.</m-text
|
|
72
92
|
>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
93
|
+
</m-column>
|
|
94
|
+
<m-stack
|
|
95
|
+
direction="column"
|
|
96
|
+
:responsive="{ at: 800, direction: 'row', align: 'start' }"
|
|
97
|
+
gap="lg"
|
|
98
|
+
>
|
|
99
|
+
<m-column :grow="1" :shrink="1" gap="lg">
|
|
100
|
+
<m-card :backgroundColor="theme.colors.primarySoft" gap="lg">
|
|
101
|
+
<m-row justify="between" gap="sm" wrap>
|
|
102
|
+
<m-badge text="IN THE MAKING" tone="primary" />
|
|
103
|
+
<m-icon name="sunrise" :size="36" tone="primary" />
|
|
104
|
+
</m-row>
|
|
105
|
+
<m-text variant="title">{{ name.trim() || 'Your next chapter' }}</m-text>
|
|
106
|
+
<m-text tone="muted">A little momentum goes a long way.</m-text>
|
|
107
|
+
<m-progress label="Your momentum" :value="done.length" :max="3" />
|
|
108
|
+
</m-card>
|
|
109
|
+
<m-column gap="sm">
|
|
110
|
+
<m-row justify="between"
|
|
111
|
+
><m-text variant="heading">Make a little room.</m-text
|
|
112
|
+
><m-badge :text="`${done.length} / 3`"
|
|
113
|
+
/></m-row>
|
|
114
|
+
<m-card v-for="step in milestones" :key="step.id" padding="md" gap="sm">
|
|
115
|
+
<m-row gap="md" align="center">
|
|
116
|
+
<m-button
|
|
117
|
+
:icon="done.includes(step.id) ? 'check' : step.icon"
|
|
118
|
+
:variant="done.includes(step.id) ? 'primary' : 'secondary'"
|
|
119
|
+
:accessibilityLabel="`${done.includes(step.id) ? 'Undo' : 'Complete'}: ${step.title}`"
|
|
120
|
+
@click="toggle(step.id)"
|
|
121
|
+
/>
|
|
122
|
+
<m-column :grow="1" :shrink="1" gap="xs"
|
|
123
|
+
><m-text weight="600">{{ step.title }}</m-text
|
|
124
|
+
><m-text variant="caption" tone="muted">{{ step.detail }}</m-text></m-column
|
|
125
|
+
>
|
|
126
|
+
</m-row>
|
|
127
|
+
</m-card>
|
|
128
|
+
</m-column>
|
|
129
|
+
</m-column>
|
|
130
|
+
<m-card :grow="1" :shrink="1" gap="lg">
|
|
131
|
+
<m-row justify="between" gap="sm">
|
|
132
|
+
<m-text variant="heading">Start something</m-text>
|
|
133
|
+
<m-icon name="sparkles" tone="primary" />
|
|
134
|
+
</m-row>
|
|
135
|
+
<m-input
|
|
136
|
+
v-model="name"
|
|
137
|
+
label="Project name"
|
|
138
|
+
name="project-name"
|
|
139
|
+
autocomplete="off"
|
|
140
|
+
helperText="A small beginning is still a beginning."
|
|
141
|
+
@update:modelValue="saved = false"
|
|
142
|
+
@submit="save"
|
|
143
|
+
/>
|
|
144
|
+
<m-alert v-if="error" tone="error" title="Let’s try again" :description="error" />
|
|
145
|
+
<m-button
|
|
146
|
+
:disabled="!canSave"
|
|
147
|
+
:loading="saving"
|
|
148
|
+
loadingText="Saving…"
|
|
149
|
+
icon="arrow-right"
|
|
150
|
+
@click="save"
|
|
151
|
+
>Create project</m-button
|
|
76
152
|
>
|
|
77
|
-
|
|
78
|
-
|
|
153
|
+
<m-reveal :show="saved">
|
|
154
|
+
<m-text tone="success"
|
|
155
|
+
>Your draft is ready. Connect the host service to make it yours.</m-text
|
|
156
|
+
>
|
|
157
|
+
</m-reveal>
|
|
158
|
+
</m-card>
|
|
159
|
+
</m-stack>
|
|
160
|
+
<m-separator />
|
|
79
161
|
<m-row gap="sm" wrap>
|
|
80
162
|
<m-icon name="layers" tone="accent" />
|
|
81
163
|
<m-text variant="caption" tone="muted">One screen. Your theme. Your platform.</m-text>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Resolved by this host. Shared screens import from #mavis.
|
|
2
|
+
export {
|
|
3
|
+
MThemeProvider,
|
|
4
|
+
MPlatform,
|
|
5
|
+
MPopover,
|
|
6
|
+
MMenu,
|
|
7
|
+
MAppBar,
|
|
8
|
+
MTabBar,
|
|
9
|
+
MTimePicker,
|
|
10
|
+
MVirtualList,
|
|
11
|
+
MDataTable,
|
|
12
|
+
MCarousel,
|
|
13
|
+
MRangeSlider,
|
|
14
|
+
MCalendar,
|
|
15
|
+
MRating,
|
|
16
|
+
MTreeView,
|
|
17
|
+
MCommandPalette,
|
|
18
|
+
MNavigationRail,
|
|
19
|
+
MBreadcrumb,
|
|
20
|
+
MTooltip,
|
|
21
|
+
MTimeline,
|
|
22
|
+
MChart,
|
|
23
|
+
MImageViewer,
|
|
24
|
+
MSortableList,
|
|
25
|
+
MSwipeActions,
|
|
26
|
+
MNumberFlow,
|
|
27
|
+
MResizablePanels,
|
|
28
|
+
MImageCompare,
|
|
29
|
+
MSpan,
|
|
30
|
+
MScreen,
|
|
31
|
+
MBox,
|
|
32
|
+
MRow,
|
|
33
|
+
MColumn,
|
|
34
|
+
MStack,
|
|
35
|
+
MGrid,
|
|
36
|
+
MLink,
|
|
37
|
+
MCard,
|
|
38
|
+
MText,
|
|
39
|
+
MButton,
|
|
40
|
+
MSlider,
|
|
41
|
+
MSwitch,
|
|
42
|
+
MCheckbox,
|
|
43
|
+
MRadioGroup,
|
|
44
|
+
MSelect,
|
|
45
|
+
MToast,
|
|
46
|
+
MDialog,
|
|
47
|
+
MTabs,
|
|
48
|
+
MSkeleton,
|
|
49
|
+
MChip,
|
|
50
|
+
MEmptyState,
|
|
51
|
+
MProgress,
|
|
52
|
+
MAccordion,
|
|
53
|
+
MSegmentedControl,
|
|
54
|
+
MAlert,
|
|
55
|
+
MListItem,
|
|
56
|
+
MSeparator,
|
|
57
|
+
MAvatar,
|
|
58
|
+
MBadge,
|
|
59
|
+
MInput,
|
|
60
|
+
MIcon,
|
|
61
|
+
MReveal,
|
|
62
|
+
MSheet,
|
|
63
|
+
MDatePicker,
|
|
64
|
+
MDateRangePicker,
|
|
65
|
+
MNumberInput,
|
|
66
|
+
MMultiSelect,
|
|
67
|
+
MImage,
|
|
68
|
+
MCombobox,
|
|
69
|
+
MFilePicker,
|
|
70
|
+
MFormGroup,
|
|
71
|
+
MFormErrors,
|
|
72
|
+
MSteps,
|
|
73
|
+
MPagination,
|
|
74
|
+
useMavisPlatform,
|
|
75
|
+
useMavisListMotion,
|
|
76
|
+
useMavisTheme,
|
|
77
|
+
useToast,
|
|
78
|
+
useFormController,
|
|
79
|
+
useFormField,
|
|
80
|
+
useFileSelection,
|
|
81
|
+
useMavisNavigation,
|
|
82
|
+
} from '@getcortexlabs/mavis-web'
|
|
83
|
+
export * from '@getcortexlabs/mavis-core'
|
|
84
|
+
export { formatDateTime, dateTimeToCivilDate } from '@getcortexlabs/mavis-web/date-format'
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
"strict": true,
|
|
7
7
|
"skipLibCheck": true,
|
|
8
8
|
"lib": ["ES2023", "DOM"],
|
|
9
|
-
"types": ["vite/client"]
|
|
9
|
+
"types": ["vite/client", "node"],
|
|
10
|
+
"paths": {
|
|
11
|
+
"#mavis": ["./src/mavis.ts"],
|
|
12
|
+
"#shared-ui/*": ["__MAVIS_SHARED_ROOT__/*"]
|
|
13
|
+
}
|
|
10
14
|
},
|
|
11
15
|
"include": ["src", "../../shared", "vite.config.ts"]
|
|
12
16
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { defineConfig } from 'vite'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
2
3
|
import vue from '@vitejs/plugin-vue'
|
|
3
4
|
export default defineConfig({
|
|
4
5
|
plugins: [vue()],
|
|
5
|
-
resolve: {
|
|
6
|
+
resolve: {
|
|
7
|
+
alias: {
|
|
8
|
+
'#shared-ui': fileURLToPath(new URL('__MAVIS_SHARED_ROOT__', import.meta.url)),
|
|
9
|
+
'#mavis': fileURLToPath(new URL('./src/mavis.ts', import.meta.url)),
|
|
10
|
+
},
|
|
11
|
+
dedupe: ['vue', '@vue/runtime-core', '@vue/reactivity', '@vue/shared'],
|
|
12
|
+
},
|
|
6
13
|
})
|