create-dovite 2.0.1 → 2.2.2
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 +20 -16
- package/index.js +10 -4
- package/package.json +8 -4
- package/src/files.js +40 -1
- package/src/prompts.js +2 -0
- package/src/setup.js +56 -33
- package/templates/react-js/public/thumbnail.png +0 -0
- package/templates/react-js/src/App.jsx +3 -9
- package/templates/react-js/src/pages/index.css +96 -0
- package/templates/react-js/src/pages/index.jsx +340 -0
- package/templates/react-ts/public/thumbnail.png +0 -0
- package/templates/react-ts/src/App.tsx +3 -9
- package/templates/react-ts/src/pages/index.css +96 -0
- package/templates/react-ts/src/pages/index.tsx +347 -0
- package/templates/vue-js/jsconfig.json +7 -0
- package/templates/vue-js/public/manifest.json +12 -0
- package/templates/vue-js/public/thumbnail.png +0 -0
- package/templates/vue-js/src/API/currentUserContext.js +61 -0
- package/templates/vue-js/src/API/dataApi.js +238 -0
- package/templates/vue-js/src/API/domoAPI.js +311 -0
- package/templates/vue-js/src/App.vue +9 -0
- package/templates/vue-js/src/index.css +1 -0
- package/templates/vue-js/src/main.js +6 -0
- package/templates/vue-js/src/pages/index.vue +699 -0
- package/templates/vue-js/vite.config.js +40 -0
- package/templates/vue-ts/public/manifest.json +12 -0
- package/templates/vue-ts/public/thumbnail.png +0 -0
- package/templates/vue-ts/src/API/currentUserContext.ts +76 -0
- package/templates/vue-ts/src/API/dataApi.ts +284 -0
- package/templates/vue-ts/src/API/domoAPI.ts +340 -0
- package/templates/vue-ts/src/App.vue +9 -0
- package/templates/vue-ts/src/index.css +1 -0
- package/templates/vue-ts/src/main.ts +6 -0
- package/templates/vue-ts/src/pages/index.vue +706 -0
- package/templates/vue-ts/tsconfig.app.json +31 -0
- package/templates/vue-ts/tsconfig.json +17 -0
- package/templates/vue-ts/vite.config.ts +43 -0
package/README.md
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
# create-dovite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- a detailed description of the package with all the features -->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**create-dovite** is a CLI tool designed to jumpstart the development of Domo Custom Apps. It provides a modern developer experience by combining the speed of **Vite** with the utility-first approach of **Tailwind CSS**. This starter kit comes pre-integrated with **shadcn/ui** for accessible components and includes built-in configurations for the **Domo Integrations**, ensuring a smooth transition from local development to production.
|
|
6
|
+
|
|
7
|
+
# Features
|
|
8
|
+
|
|
9
|
+
- ⚡️ Vite for fast development
|
|
10
|
+
- ⚛️ React and Vue support
|
|
11
|
+
- 📘 TypeScript and JavaScript support
|
|
12
|
+
- 🎨 Tailwind CSS for styling
|
|
13
|
+
- 🎯 shadcn/ui components
|
|
14
|
+
- 🔄 DOMO integration
|
|
15
|
+
- 📦 Preconfigured build setup
|
|
6
16
|
|
|
7
17
|
## Prerequisites
|
|
8
18
|
|
|
19
|
+
> **Note:** This package requires yarn and the DOMO CLI to be installed before use.
|
|
20
|
+
|
|
9
21
|
```bash
|
|
10
|
-
# Install yarn if you don't have
|
|
11
|
-
npm install -g yarn
|
|
22
|
+
# Install yarn and DOMO CLI if you don't have them
|
|
23
|
+
npm install -g yarn ryuu
|
|
12
24
|
```
|
|
13
25
|
|
|
14
|
-
# For DOMO CLI installation, refer to:
|
|
15
|
-
|
|
16
|
-
[DOMO CLI](https://developer.domo.com/portal/6hlzv1hinkq19-setup-and-installation)
|
|
17
|
-
|
|
18
26
|
## Usage
|
|
19
27
|
|
|
20
28
|
```bash
|
|
@@ -25,19 +33,15 @@ yarn create dovite my-app
|
|
|
25
33
|
npx create-dovite my-app
|
|
26
34
|
```
|
|
27
35
|
|
|
28
|
-
## Features
|
|
29
|
-
|
|
30
|
-
- ⚡️ Vite for fast development
|
|
31
|
-
- 🎨 Tailwind CSS for styling
|
|
32
|
-
- 🎯 shadcn/ui components
|
|
33
|
-
- 🔄 DOMO integration
|
|
34
|
-
- 📦 Preconfigured build setup
|
|
35
|
-
|
|
36
36
|
## Requirements
|
|
37
37
|
|
|
38
38
|
- Node.js 16.x or higher
|
|
39
39
|
- npm or yarn
|
|
40
40
|
|
|
41
|
+
## For DOMO CLI installation, refer to:
|
|
42
|
+
|
|
43
|
+
[DOMO CLI](https://developer.domo.com/portal/6hlzv1hinkq19-setup-and-installation)
|
|
44
|
+
|
|
41
45
|
## Inspirations
|
|
42
46
|
|
|
43
47
|
- [DOMO Starter Kits](https://developer.domo.com/portal/u8w475o2245yp-starter-kits)
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
const { getProjectDetails } = require("./src/prompts");
|
|
3
3
|
const {
|
|
4
4
|
createViteProject,
|
|
@@ -7,7 +7,11 @@ const {
|
|
|
7
7
|
initializeShadcn,
|
|
8
8
|
initializeGit,
|
|
9
9
|
} = require("./src/setup");
|
|
10
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
copyTemplateFiles,
|
|
12
|
+
updateManifest,
|
|
13
|
+
cleanupViteDefaults,
|
|
14
|
+
} = require("./src/files");
|
|
11
15
|
|
|
12
16
|
async function main() {
|
|
13
17
|
try {
|
|
@@ -21,13 +25,15 @@ async function main() {
|
|
|
21
25
|
// We pass projectName so they can resolve paths correctly relative to CWD
|
|
22
26
|
updatePackageJson(projectName, templateType);
|
|
23
27
|
|
|
24
|
-
installDependencies(projectName);
|
|
28
|
+
installDependencies(projectName, templateType);
|
|
25
29
|
|
|
26
30
|
copyTemplateFiles(projectName, templateType);
|
|
27
31
|
|
|
32
|
+
cleanupViteDefaults(projectName, templateType);
|
|
33
|
+
|
|
28
34
|
updateManifest(projectName);
|
|
29
35
|
|
|
30
|
-
initializeShadcn(projectName);
|
|
36
|
+
initializeShadcn(projectName, templateType);
|
|
31
37
|
|
|
32
38
|
initializeGit(projectName);
|
|
33
39
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-dovite",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Vite template featuring
|
|
3
|
+
"version": "2.2.2",
|
|
4
|
+
"description": "Vite template featuring React, Vue, TailwindCSS, ShadCN, and DOMO integration.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-dovite": "index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"templates",
|
|
10
|
+
"templates/react-js",
|
|
11
|
+
"templates/react-ts",
|
|
12
|
+
"templates/vue-js",
|
|
13
|
+
"templates/vue-ts",
|
|
11
14
|
"src",
|
|
12
15
|
"index.js"
|
|
13
16
|
],
|
|
@@ -18,13 +21,14 @@
|
|
|
18
21
|
"shadcn",
|
|
19
22
|
"domo",
|
|
20
23
|
"react",
|
|
24
|
+
"vue",
|
|
21
25
|
"create-vite"
|
|
22
26
|
],
|
|
23
27
|
"author": "Ajay B",
|
|
24
28
|
"license": "MIT",
|
|
25
29
|
"repository": {
|
|
26
30
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/Ajay-Balu/create-dovite"
|
|
31
|
+
"url": "git+https://github.com/Ajay-Balu/create-dovite.git"
|
|
28
32
|
},
|
|
29
33
|
"dependencies": {
|
|
30
34
|
"prompts": "^2.4.2"
|
package/src/files.js
CHANGED
|
@@ -69,4 +69,43 @@ function updateManifest(projectName) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
function cleanupViteDefaults(projectName, templateType) {
|
|
73
|
+
const isVue = templateType === "vue-js" || templateType === "vue-ts";
|
|
74
|
+
|
|
75
|
+
if (isVue) {
|
|
76
|
+
// Clean up default style.css created by Vite Vue template
|
|
77
|
+
// Remove body/#app styles that conflict with our landing page
|
|
78
|
+
const styleCssPath = path.join(projectName, "src", "style.css");
|
|
79
|
+
if (fs.existsSync(styleCssPath)) {
|
|
80
|
+
console.log("Cleaning up default style.css...");
|
|
81
|
+
let content = fs.readFileSync(styleCssPath, "utf8");
|
|
82
|
+
|
|
83
|
+
// Remove body styles block
|
|
84
|
+
content = content.replace(
|
|
85
|
+
/body\s*\{[^}]*display:\s*flex[^}]*place-items:\s*center[^}]*\}/gs,
|
|
86
|
+
""
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// Remove #app styles block
|
|
90
|
+
content = content.replace(
|
|
91
|
+
/#app\s*\{[^}]*max-width:\s*1280px[^}]*\}/gs,
|
|
92
|
+
""
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
// Clean up extra whitespace
|
|
96
|
+
content = content.replace(/\n{3,}/g, "\n\n").trim();
|
|
97
|
+
|
|
98
|
+
// Write back the cleaned content (or empty string if nothing left)
|
|
99
|
+
fs.writeFileSync(styleCssPath, content + "\n");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Remove App.css if it exists (created by Vite React template)
|
|
104
|
+
const appCssPath = path.join(projectName, "src", "App.css");
|
|
105
|
+
if (fs.existsSync(appCssPath)) {
|
|
106
|
+
console.log("Removing default App.css...");
|
|
107
|
+
fs.unlinkSync(appCssPath);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
module.exports = { copyTemplateFiles, updateManifest, cleanupViteDefaults };
|
package/src/prompts.js
CHANGED
|
@@ -22,6 +22,8 @@ async function getProjectDetails(initialProjectName) {
|
|
|
22
22
|
choices: [
|
|
23
23
|
{ title: "React JavaScript", value: "react-js" },
|
|
24
24
|
{ title: "React TypeScript", value: "react-ts" },
|
|
25
|
+
{ title: "Vue JavaScript", value: "vue-js" },
|
|
26
|
+
{ title: "Vue TypeScript", value: "vue-ts" },
|
|
25
27
|
],
|
|
26
28
|
initial: 0,
|
|
27
29
|
});
|
package/src/setup.js
CHANGED
|
@@ -7,7 +7,15 @@ function createViteProject(projectName, templateType) {
|
|
|
7
7
|
`Creating new project: ${projectName} with template ${templateType}`
|
|
8
8
|
);
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// Map our template types to Vite's template names
|
|
11
|
+
const viteTemplateMap = {
|
|
12
|
+
"react-js": "react",
|
|
13
|
+
"react-ts": "react-ts",
|
|
14
|
+
"vue-js": "vue",
|
|
15
|
+
"vue-ts": "vue-ts",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const viteTemplate = viteTemplateMap[templateType] || "react";
|
|
11
19
|
execSync(
|
|
12
20
|
`yarn create vite ${projectName} --template ${viteTemplate} --no-interactive`,
|
|
13
21
|
{
|
|
@@ -23,10 +31,21 @@ function updatePackageJson(projectName, templateType) {
|
|
|
23
31
|
|
|
24
32
|
packageJson.name = projectName;
|
|
25
33
|
|
|
34
|
+
// TypeScript templates need tsc build step
|
|
35
|
+
const isTypeScript = templateType === "react-ts" || templateType === "vue-ts";
|
|
36
|
+
const buildCommand = isTypeScript ? "vue-tsc -b && vite build" : "vite build";
|
|
37
|
+
// React-ts uses tsc, Vue-ts uses vue-tsc
|
|
38
|
+
const tsBuildCommand =
|
|
39
|
+
templateType === "react-ts" ? "tsc -b && vite build" : buildCommand;
|
|
40
|
+
|
|
26
41
|
packageJson.scripts = {
|
|
27
42
|
...packageJson.scripts,
|
|
28
43
|
dev: "vite",
|
|
29
|
-
build:
|
|
44
|
+
build: isTypeScript
|
|
45
|
+
? templateType === "react-ts"
|
|
46
|
+
? "tsc -b && vite build"
|
|
47
|
+
: "vue-tsc -b && vite build"
|
|
48
|
+
: "vite build",
|
|
30
49
|
lint: "eslint .",
|
|
31
50
|
preview: "vite preview",
|
|
32
51
|
upload: "yarn run build && cd dist && domo publish && cd ..",
|
|
@@ -35,51 +54,55 @@ function updatePackageJson(projectName, templateType) {
|
|
|
35
54
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
36
55
|
}
|
|
37
56
|
|
|
38
|
-
function installDependencies(projectName) {
|
|
57
|
+
function installDependencies(projectName, templateType) {
|
|
39
58
|
console.log("Installing dependencies...");
|
|
40
|
-
// We need to run this inside the project directory
|
|
41
|
-
// But since we are passing projectName, we can use cwd option or chdir before calling this.
|
|
42
|
-
// However, the original script chdir'd into the project.
|
|
43
|
-
// Let's assume the caller will handle chdir or we pass cwd.
|
|
44
|
-
// To keep it simple and consistent with original flow, let's assume we are IN the project dir
|
|
45
|
-
// OR we pass the cwd to execSync.
|
|
46
|
-
// The original script did `process.chdir(projectName)`.
|
|
47
|
-
|
|
48
|
-
// Let's stick to the original flow where we chdir in the main script,
|
|
49
|
-
// OR we can make these functions robust.
|
|
50
|
-
// For now, let's assume we are inside the directory for these commands to work easily
|
|
51
|
-
// without passing cwd everywhere, BUT `updatePackageJson` used `path.join`.
|
|
52
|
-
// Let's make `updatePackageJson` work with relative path, and these commands too.
|
|
53
|
-
|
|
54
|
-
// Actually, `yarn` needs to run in the project dir.
|
|
55
|
-
|
|
56
59
|
const options = { stdio: "inherit", cwd: projectName };
|
|
60
|
+
const isVue = templateType === "vue-js" || templateType === "vue-ts";
|
|
57
61
|
|
|
58
62
|
execSync("yarn", options);
|
|
59
63
|
|
|
60
64
|
console.log("Installing additional dependencies...");
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
|
|
66
|
+
// Common dependencies for all templates
|
|
67
|
+
const commonDeps =
|
|
68
|
+
"tailwindcss @tailwindcss/vite @domoinc/ryuu-proxy ryuu.js tailwind-merge";
|
|
69
|
+
|
|
70
|
+
if (isVue) {
|
|
71
|
+
// Vue-specific dependencies
|
|
72
|
+
execSync(`yarn add ${commonDeps}`, options);
|
|
73
|
+
} else {
|
|
74
|
+
// React-specific dependencies
|
|
75
|
+
execSync(`yarn add ${commonDeps} react-icons`, options);
|
|
76
|
+
}
|
|
77
|
+
|
|
65
78
|
execSync("yarn add -D @types/node", options);
|
|
66
79
|
}
|
|
67
80
|
|
|
68
|
-
function initializeShadcn(projectName) {
|
|
81
|
+
function initializeShadcn(projectName, templateType) {
|
|
69
82
|
console.log("Initializing shadcn...");
|
|
70
83
|
const options = { stdio: "inherit", cwd: projectName };
|
|
71
|
-
|
|
72
|
-
execSync("npx shadcn@latest init", options);
|
|
84
|
+
const isVue = templateType === "vue-js" || templateType === "vue-ts";
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
try {
|
|
87
|
+
if (isVue) {
|
|
88
|
+
// Shadcn-vue uses a different initialization
|
|
89
|
+
execSync("npx shadcn-vue@latest init", options);
|
|
90
|
+
console.log("Installing final dependencies...");
|
|
91
|
+
execSync("yarn", options);
|
|
92
|
+
execSync("npx shadcn-vue@latest add button", options);
|
|
93
|
+
} else {
|
|
94
|
+
// React uses standard shadcn
|
|
95
|
+
execSync("npx shadcn@latest init", options);
|
|
96
|
+
console.log("Installing final dependencies...");
|
|
97
|
+
execSync("yarn", options);
|
|
98
|
+
execSync("npx shadcn@latest add button", options);
|
|
99
|
+
}
|
|
80
100
|
} catch (error) {
|
|
101
|
+
const shadcnCmd = isVue
|
|
102
|
+
? "npx shadcn-vue@latest init"
|
|
103
|
+
: "npx shadcn@latest init";
|
|
81
104
|
console.log(
|
|
82
|
-
|
|
105
|
+
`Note: You may need to run "${shadcnCmd}" manually if initialization failed.`
|
|
83
106
|
);
|
|
84
107
|
}
|
|
85
108
|
}
|
|
Binary file
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import "./App.css";
|
|
1
|
+
import DefaultPage from "./pages/index";
|
|
2
|
+
|
|
4
3
|
function App() {
|
|
5
|
-
|
|
6
|
-
return (
|
|
7
|
-
<div className="App">
|
|
8
|
-
<Button onClick={() => setCount(count + 1)}>Count: {count}</Button>
|
|
9
|
-
</div>
|
|
10
|
-
);
|
|
4
|
+
return <DefaultPage />;
|
|
11
5
|
}
|
|
12
6
|
|
|
13
7
|
export default App;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* Landing Page Background */
|
|
2
|
+
.landing-page {
|
|
3
|
+
background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* Logo Icon Base Styles */
|
|
7
|
+
.logo-icon {
|
|
8
|
+
height: 4rem;
|
|
9
|
+
width: 4rem;
|
|
10
|
+
padding: 0.5rem;
|
|
11
|
+
will-change: filter, transform;
|
|
12
|
+
transition: filter 300ms, transform 300ms;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Logo Hover Effects with Glow */
|
|
16
|
+
.logo-vite:hover {
|
|
17
|
+
filter: drop-shadow(0 0 2em rgba(189, 52, 254, 0.667));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.logo-react:hover {
|
|
21
|
+
filter: drop-shadow(0 0 2em rgba(97, 218, 251, 0.667));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.logo-domo:hover {
|
|
25
|
+
filter: drop-shadow(0 0 2em rgba(0, 181, 226, 0.667));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.logo-tailwind:hover {
|
|
29
|
+
filter: drop-shadow(0 0 2em rgba(6, 182, 212, 0.667));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.logo-shadcn {
|
|
33
|
+
color: #27272a;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.logo-shadcn:hover {
|
|
37
|
+
filter: drop-shadow(0 0 2em rgba(161, 161, 170, 0.667));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* React Logo Spin Animation */
|
|
41
|
+
@keyframes logo-spin {
|
|
42
|
+
from {
|
|
43
|
+
transform: rotate(0deg);
|
|
44
|
+
}
|
|
45
|
+
to {
|
|
46
|
+
transform: rotate(360deg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
51
|
+
.logo-react {
|
|
52
|
+
animation: logo-spin infinite 20s linear;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Gradient Text Animation */
|
|
57
|
+
.gradient-text {
|
|
58
|
+
background: linear-gradient(
|
|
59
|
+
135deg,
|
|
60
|
+
#bd34fe 0%,
|
|
61
|
+
#41d1ff 25%,
|
|
62
|
+
#0072bc 50%,
|
|
63
|
+
#06b6d4 75%,
|
|
64
|
+
#a1a1aa 100%
|
|
65
|
+
);
|
|
66
|
+
background-size: 200% auto;
|
|
67
|
+
background-clip: text;
|
|
68
|
+
-webkit-background-clip: text;
|
|
69
|
+
-webkit-text-fill-color: transparent;
|
|
70
|
+
animation: gradient-shift 5s ease infinite;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@keyframes gradient-shift {
|
|
74
|
+
0%,
|
|
75
|
+
100% {
|
|
76
|
+
background-position: 0% 50%;
|
|
77
|
+
}
|
|
78
|
+
50% {
|
|
79
|
+
background-position: 100% 50%;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Responsive Logo Sizes */
|
|
84
|
+
@media (max-width: 768px) {
|
|
85
|
+
.logo-icon {
|
|
86
|
+
height: 3rem;
|
|
87
|
+
width: 3rem;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (max-width: 480px) {
|
|
92
|
+
.logo-icon {
|
|
93
|
+
height: 2.5rem;
|
|
94
|
+
width: 2.5rem;
|
|
95
|
+
}
|
|
96
|
+
}
|