@dasidev/dasi-ui 1.1.1-beta.0 → 1.1.1-beta.10

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 (50) hide show
  1. package/bin/cli.js +168 -0
  2. package/dist/assets/pdf.worker-WQTRJdrN.js +52 -0
  3. package/dist/dasi-ui.css +1 -1
  4. package/dist/dasi-ui.es.js +102 -33
  5. package/dist/dasi-ui.umd.js +3649 -3549
  6. package/dist/{index-CqxqSFfV.js → index-DlhSNoLQ.js} +57046 -55709
  7. package/dist/index.d.ts +3624 -10
  8. package/dist/{index.es-BZh3_u2U.js → index.es-s25NAd2M.js} +1 -1
  9. package/dist/{informasi-gudang-43OLeAD4.js → informasi-gudang-BQKoEp0w.js} +1 -1
  10. package/package.json +48 -9
  11. package/template/.editorconfig +8 -0
  12. package/template/.env.example +10 -0
  13. package/template/.gitattributes +1 -0
  14. package/template/.oxlintrc.json +10 -0
  15. package/template/.prettierrc.json +6 -0
  16. package/template/.vscode/extensions.json +11 -0
  17. package/template/README.md +73 -0
  18. package/template/e2e/tsconfig.json +4 -0
  19. package/template/e2e/vue.spec.ts +8 -0
  20. package/template/env.d.ts +1 -0
  21. package/template/eslint.config.ts +38 -0
  22. package/template/index.html +13 -0
  23. package/template/package-lock.json +12120 -0
  24. package/template/package.json +63 -0
  25. package/template/playwright.config.ts +110 -0
  26. package/template/public/favicon.ico +0 -0
  27. package/template/src/App.vue +5 -0
  28. package/template/src/assets/logo.svg +1 -0
  29. package/template/src/dasi-ui/pages/examples/test/config.ts +8 -0
  30. package/template/src/dasi-ui/pages/examples/test/schema.ts +116 -0
  31. package/template/src/layouts/AuthLayout.vue +14 -0
  32. package/template/src/layouts/DefaultLayout.vue +85 -0
  33. package/template/src/main.ts +23 -0
  34. package/template/src/router/index.ts +56 -0
  35. package/template/src/stores/counter.ts +12 -0
  36. package/template/src/tailwind.css +3 -0
  37. package/template/src/views/DasiUIPage.vue +74 -0
  38. package/template/src/views/DasiUIPageSimple.vue +26 -0
  39. package/template/src/views/DasiUIPageView.vue +48 -0
  40. package/template/src/views/HomeView.vue +501 -0
  41. package/template/src/views/NotFound.vue +7 -0
  42. package/template/src/views/auth/LoginView.vue +8 -0
  43. package/template/src/vueform.config.ts +17 -0
  44. package/template/tailwind.config.js +25 -0
  45. package/template/tsconfig.app.json +12 -0
  46. package/template/tsconfig.json +14 -0
  47. package/template/tsconfig.node.json +19 -0
  48. package/template/tsconfig.vitest.json +11 -0
  49. package/template/vite.config.ts +27 -0
  50. package/template/vitest.config.ts +14 -0
package/bin/cli.js ADDED
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env node
2
+ import { program } from 'commander';
3
+ import inquirer from 'inquirer';
4
+ import fs from 'fs-extra';
5
+ import path from 'path';
6
+ import chalk from 'chalk';
7
+ import ora from 'ora';
8
+ import { execa } from 'execa';
9
+ import { fileURLToPath } from 'url';
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+ program
13
+ .name('dasi-ui')
14
+ .description('DASI UI - Admin Dashboard Template')
15
+ .version('1.0.13');
16
+ program
17
+ .command('create [project-name]')
18
+ .description('Create a new DASI UI admin dashboard')
19
+ .action(async (projectName) => {
20
+ console.log(chalk.greenBright.bold('DASI UI Admin Template Setup\n'));
21
+ const answers = await inquirer.prompt([
22
+ {
23
+ type: 'input',
24
+ name: 'projectName',
25
+ message: 'Project name:',
26
+ default: projectName,
27
+ validate: (input) => (input ?? '').length > 0 || 'Project name is required'
28
+ },
29
+ {
30
+ type: 'input',
31
+ name: 'appTitle',
32
+ message: 'App title:',
33
+ default: projectName
34
+ ? projectName.charAt(0).toUpperCase() +
35
+ projectName.slice(1).replace(/-/g, ' ')
36
+ : 'DASI Admin Dashboard'
37
+ },
38
+ {
39
+ type: 'input',
40
+ name: 'appDescription',
41
+ message: 'App description:',
42
+ default: 'Complete admin dashboard built with DASI UI'
43
+ },
44
+ {
45
+ type: 'input',
46
+ name: 'author',
47
+ message: 'Author name:',
48
+ default: 'DASI Developer'
49
+ },
50
+ {
51
+ type: 'list',
52
+ name: 'packageManager',
53
+ message: 'Package manager:',
54
+ choices: ['npm', 'yarn', 'pnpm'],
55
+ default: 'npm'
56
+ },
57
+ {
58
+ type: 'input',
59
+ name: 'apiUrl',
60
+ message: 'API base URL:',
61
+ default: 'http://localhost:8080/api'
62
+ },
63
+ {
64
+ type: 'confirm',
65
+ name: 'darkMode',
66
+ message: 'Enable dark mode?',
67
+ default: true
68
+ },
69
+ {
70
+ type: 'confirm',
71
+ name: 'gitInit',
72
+ message: 'Initialize git repository?',
73
+ default: true
74
+ },
75
+ {
76
+ type: 'confirm',
77
+ name: 'installDeps',
78
+ message: 'Install dependencies now?',
79
+ default: true
80
+ }
81
+ ]);
82
+ const spinner = ora('Creating project...').start();
83
+ try {
84
+ const projectPath = path.join(process.cwd(), answers.projectName);
85
+ if (await fs.pathExists(projectPath)) {
86
+ spinner.fail('Project directory already exists');
87
+ process.exit(1);
88
+ }
89
+ // Create directory
90
+ await fs.mkdir(projectPath, { recursive: true });
91
+ // Copy template
92
+ spinner.text = 'Copying template files...';
93
+ const templatePath = path.join(__dirname, '../template');
94
+ if (!(await fs.pathExists(templatePath))) {
95
+ throw new Error('Template folder not found');
96
+ }
97
+ await fs.copy(templatePath, projectPath, {
98
+ filter: (src) => {
99
+ const relative = path.relative(templatePath, src);
100
+ const exclude = [
101
+ 'node_modules',
102
+ 'dist',
103
+ '.git',
104
+ 'package-lock.json',
105
+ 'yarn.lock',
106
+ '.DS_Store'
107
+ ];
108
+ return !exclude.some((pattern) => relative.includes(pattern));
109
+ }
110
+ });
111
+ // Setup package.json
112
+ spinner.text = 'Configuring project...';
113
+ const templatePkgPath = path.join(projectPath, 'package.json.template');
114
+ const pkgPath = path.join(projectPath, 'package.json');
115
+ if (await fs.pathExists(templatePkgPath)) {
116
+ await fs.move(templatePkgPath, pkgPath);
117
+ }
118
+ const mainPkg = await fs.readJson(path.join(__dirname, '../package.json'));
119
+ const pkg = await fs.readJson(pkgPath);
120
+ pkg.name = answers.projectName;
121
+ pkg.description = answers.appDescription;
122
+ pkg.author = answers.author;
123
+ pkg.version = '0.1.0';
124
+ pkg.dependencies['@dasidev/dasi-ui'] = `^${mainPkg.version}`;
125
+ await fs.writeJson(pkgPath, pkg, { spaces: 2 });
126
+ // Create .env
127
+ const envContent = `VITE_APP_NAME=${answers.appTitle}
128
+ VITE_APP_DESCRIPTION=${answers.appDescription}
129
+ VITE_APP_AUTHOR=${answers.author}
130
+ VITE_API_URL=${answers.apiUrl}
131
+ VITE_DARK_MODE=${answers.darkMode}`;
132
+ await fs.writeFile(path.join(projectPath, '.env.example'), envContent);
133
+ await fs.copyFile(path.join(projectPath, '.env.example'), path.join(projectPath, '.env'));
134
+ // Git init
135
+ if (answers.gitInit) {
136
+ spinner.text = 'Initializing git...';
137
+ try {
138
+ await execa('git', ['init'], { cwd: projectPath });
139
+ await execa('git', ['add', '.'], { cwd: projectPath });
140
+ await execa('git', ['commit', '-m', 'Initial commit'], { cwd: projectPath });
141
+ }
142
+ catch {
143
+ // ignore git errors
144
+ }
145
+ }
146
+ // Install deps
147
+ if (answers.installDeps) {
148
+ spinner.text = 'Installing dependencies...';
149
+ await execa(answers.packageManager, ['install'], {
150
+ cwd: projectPath,
151
+ stdio: 'inherit'
152
+ });
153
+ }
154
+ spinner.succeed('Project created successfully');
155
+ console.log('\nNext steps:');
156
+ console.log(chalk.greenBright(` cd ${answers.projectName}`));
157
+ if (!answers.installDeps) {
158
+ console.log(chalk.greenBright(` ${answers.packageManager} install`));
159
+ }
160
+ console.log(chalk.greenBright(` ${answers.packageManager} run dev`));
161
+ }
162
+ catch (error) {
163
+ spinner.fail('Setup failed');
164
+ console.error(error.message);
165
+ process.exit(1);
166
+ }
167
+ });
168
+ program.parse(process.argv);