@citruslime/create-boilerplate 0.1.2 → 0.1.3
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 +13 -18
- package/hooks/common.sh +7 -0
- package/hooks/post-checkout +11 -0
- package/hooks/post-merge +11 -0
- package/hooks/pre-commit +11 -0
- package/main.mjs +395 -0
- package/package.json +12 -13
- package/{boilerplate-app → template}/.vscode/extensions.json +3 -4
- package/{boilerplate-app → template}/.vscode/settings.json +9 -13
- package/{boilerplate-app/.vscode/boilerplate-app.code-workspace → template/.vscode/template.code-workspace} +13 -18
- package/template/README.md +11 -0
- package/{boilerplate-app → template}/_editorconfig +0 -0
- package/{boilerplate-app → template}/_eslintignore +0 -0
- package/template/_eslintrc.js +3 -0
- package/{boilerplate-app → template}/_gitignore +1 -0
- package/{boilerplate-app → template}/_lintstagedrc.json +1 -1
- package/{boilerplate-app → template}/_stylelintignore +0 -0
- package/template/_stylelintrc.js +3 -0
- package/{boilerplate-app → template}/index.html +1 -1
- package/template/package.json +13 -0
- package/template/postcss.config.js +6 -0
- package/{boilerplate-app → template}/public/favicon.ico +0 -0
- package/template/src/app.vue +31 -0
- package/template/src/env.d.ts +9 -0
- package/template/src/main.ts +17 -0
- package/{boilerplate-app → template}/src/router/index.ts +2 -1
- package/template/src/state/authentication/index.ts +9 -0
- package/template/src/state/index.ts +1 -0
- package/template/src/views/dasboard/index.vue +28 -0
- package/template/tailwind.config.js +7 -0
- package/{boilerplate-app → template}/tsconfig.json +10 -10
- package/template/vite.config.ts +71 -0
- package/boilerplate-app/_eslintrc.js +0 -4
- package/boilerplate-app/_stylelintrc.js +0 -3
- package/boilerplate-app/package.json +0 -55
- package/boilerplate-app/postcss.config.js +0 -8
- package/boilerplate-app/public/site.webmanifest +0 -8
- package/boilerplate-app/public/web.config +0 -7
- package/boilerplate-app/src/app.css +0 -9
- package/boilerplate-app/src/app.ts +0 -5
- package/boilerplate-app/src/app.vue +0 -7
- package/boilerplate-app/src/main.ts +0 -23
- package/boilerplate-app/src/shims-vue.d.ts +0 -7
- package/boilerplate-app/src/state/index.ts +0 -1
- package/boilerplate-app/src/state/utils/index.ts +0 -1
- package/boilerplate-app/src/views/dashboard/index.ts +0 -5
- package/boilerplate-app/src/views/dashboard/index.vue +0 -11
- package/boilerplate-app/src/vite-env.d.ts +0 -2
- package/boilerplate-app/tailwind.config.js +0 -16
- package/boilerplate-app/vite.config.ts +0 -50
- package/index.js +0 -250
package/README.md
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
# Citrus-Lime UI Library Boilerplate
|
|
1
|
+
# Citrus-Lime UI Library Create Boilerplate Script
|
|
2
|
+
|
|
3
|
+
A create package for initialising Citrus-Lime web apps.
|
|
2
4
|
|
|
3
5
|

|
|
4
6
|

|
|
5
|
-

|
|
6
7
|
|
|
7
8
|
- ⚡ [NPM Package](https://www.npmjs.com/package/@citruslime/create-boilerplate)
|
|
8
9
|
- 📖 [Documentation & API](https://uilibrary.citruslime.com)
|
|
9
10
|
- 📌 [Citrus-Lime Ltd](https://www.citruslime.com)
|
|
10
11
|
|
|
11
|
-
## Running the script
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`npm init @citruslime/boilerplate TargetDirectory`
|
|
14
|
+
|
|
15
|
+
or
|
|
16
|
+
|
|
17
|
+
`yarn create @citruslime/boilerplate TargetDirectory`
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
- **TargetDirectory**
|
|
20
|
+
- A relative folder path for the script to create the boilerplate app
|
|
21
|
+
- *Optional* - will be prompted for, if not provided
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
- _A relative folder path for the script to create the boilerplate app_
|
|
20
|
-
- **PackageName**
|
|
21
|
-
- _Using a lower-kebab-cased naming convention_
|
|
22
|
-
- **FrontEndPortNumber**
|
|
23
|
-
- _The port in which the vite app will run_
|
|
24
|
-
- **BackendPortNumber**
|
|
25
|
-
- _The port in which the API project which drives the front-end api will run_
|
|
26
|
-
- **AutoRun**
|
|
27
|
-
- `true|false` _Run the app immediately after creating it_
|
|
23
|
+
e.g.
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
```yarn create @citruslime/boilerplate ./ui/customer app-customer-ui 3001 44531 true```
|
|
25
|
+
`yarn create @citruslime/boilerplate ./ui/customer`
|
package/hooks/common.sh
ADDED
package/hooks/post-merge
ADDED
package/hooks/pre-commit
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
. "$(dirname "$0")/_/husky.sh"
|
|
3
|
+
. "$(dirname "$0")/common.sh"
|
|
4
|
+
|
|
5
|
+
yarn_directory="$APPDATA\npm\node_modules\yarn\bin"
|
|
6
|
+
|
|
7
|
+
if ! command -v "$yarn_directory\yarn" -v; then
|
|
8
|
+
npm install --global yarn
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
"$yarn_directory\yarn" pre-commit-lint
|
package/main.mjs
ADDED
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'fs';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
import { lightBlue, green, red } from 'kolorist';
|
|
9
|
+
import parseArgs from 'minimist';
|
|
10
|
+
import prompts from 'prompts';
|
|
11
|
+
|
|
12
|
+
const argv = parseArgs(process.argv.slice(2));
|
|
13
|
+
const cwd = process.cwd();
|
|
14
|
+
const codeDir = fileURLToPath(dirname(import.meta.url));
|
|
15
|
+
|
|
16
|
+
const placeholdersToReplace = {
|
|
17
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
18
|
+
'[[PACKAGE_NAME]]': '',
|
|
19
|
+
'[[REPOSITORY_ROOT]]': '',
|
|
20
|
+
'[[HUSKY_DIR]]': '',
|
|
21
|
+
'[[BACKEND_PORT]]': 0,
|
|
22
|
+
'[[FRONTEND_PORT]]': 0,
|
|
23
|
+
'\n // eslint-disable-next-line array-bracket-spacing': ''
|
|
24
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const filesToRename = {
|
|
28
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
29
|
+
_gitignore: '.gitignore',
|
|
30
|
+
_editorconfig: '.editorconfig',
|
|
31
|
+
_eslintignore: '.eslintignore',
|
|
32
|
+
'_eslintrc.js': '.eslintrc.js',
|
|
33
|
+
'_lintstagedrc.json': '.lintstagedrc.json',
|
|
34
|
+
_stylelintignore: '.stylelintignore',
|
|
35
|
+
'_stylelintrc.js': '.stylelintrc.js',
|
|
36
|
+
'template.code-workspace': 'citrus-lime.code-workspace'
|
|
37
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const dependenciesToInstall = [
|
|
41
|
+
{
|
|
42
|
+
name: '@citruslime/ui'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: '@vueuse/core'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'flatpickr'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'pinia'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'pinia-plugin-persistedstate'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'vue'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'vue-i18n'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'vue-router'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: '@citruslime/config',
|
|
67
|
+
dev: true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: '@citruslime/theme',
|
|
71
|
+
dev: true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: '@types/node',
|
|
75
|
+
dev: true
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: '@vitejs/plugin-vue',
|
|
79
|
+
dev: true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: '@iconify/vue',
|
|
83
|
+
dev: true
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'husky',
|
|
87
|
+
dev: true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'lint-staged',
|
|
91
|
+
dev: true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'postcss',
|
|
95
|
+
dev: true
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'typescript',
|
|
99
|
+
dev: true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'unplugin-vue-components',
|
|
103
|
+
dev: true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'vite',
|
|
107
|
+
dev: true
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'vite-plugin-mkcert',
|
|
111
|
+
dev: true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'vite-plugin-pages',
|
|
115
|
+
dev: true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'vue-tsc',
|
|
119
|
+
dev: true
|
|
120
|
+
}
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Initialise the new package.
|
|
125
|
+
*/
|
|
126
|
+
async function init () {
|
|
127
|
+
let packageDir = argv._[0];
|
|
128
|
+
|
|
129
|
+
const {
|
|
130
|
+
packageName,
|
|
131
|
+
empty,
|
|
132
|
+
packageManager,
|
|
133
|
+
rootDir,
|
|
134
|
+
frontendPort,
|
|
135
|
+
backendPort
|
|
136
|
+
} = await prompts([
|
|
137
|
+
{
|
|
138
|
+
type: 'text',
|
|
139
|
+
name: 'packageName',
|
|
140
|
+
message: 'Enter a package name:',
|
|
141
|
+
validate: (value) => /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(value)
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: packageDir ? null : 'text',
|
|
145
|
+
name: 'packageDir',
|
|
146
|
+
message: 'Enter a directory for the package:',
|
|
147
|
+
onState: (state) => packageDir = state.value
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: () => !existsSync(packageDir) || readdirSync(packageDir).length === 0 ? null : 'confirm',
|
|
151
|
+
name: 'empty',
|
|
152
|
+
message: () => `${packageDir === '.' ? 'Current directory' : `Target directory "${packageDir}"`} is not empty. Remove existing files and continue?`
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type (_, { empty }) {
|
|
156
|
+
if (empty === false) {
|
|
157
|
+
cancel();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return null;
|
|
161
|
+
},
|
|
162
|
+
name: 'emptyConfirmation'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'select',
|
|
166
|
+
name: 'packageManager',
|
|
167
|
+
message: 'Select a package manager:',
|
|
168
|
+
choices: [
|
|
169
|
+
{
|
|
170
|
+
title: 'yarn',
|
|
171
|
+
value: 'yarn'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
title: 'npm',
|
|
175
|
+
value: 'npm'
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
initial: 0
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 'text',
|
|
182
|
+
name: 'rootDir',
|
|
183
|
+
message: 'Enter the relative path to the root of the repository:',
|
|
184
|
+
validate: (value) => value && value?.trim() !== ''
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'number',
|
|
188
|
+
name: 'frontendPort',
|
|
189
|
+
message: 'Enter the port for the dev server to run on:'
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: 'text',
|
|
193
|
+
name: 'backendPort',
|
|
194
|
+
message: 'Enter the port that the backend server runs on:'
|
|
195
|
+
}
|
|
196
|
+
], {
|
|
197
|
+
onCancel: () => cancel()
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
print(lightBlue('Initialising package...'), true);
|
|
201
|
+
|
|
202
|
+
packageDir = packageDir.toString();
|
|
203
|
+
|
|
204
|
+
setReplacements(packageName, rootDir, frontendPort, backendPort);
|
|
205
|
+
prepareDir(join(cwd, packageDir), empty);
|
|
206
|
+
copyTemplate(packageDir);
|
|
207
|
+
|
|
208
|
+
process.chdir(packageDir);
|
|
209
|
+
installDependencies(packageManager);
|
|
210
|
+
|
|
211
|
+
print(lightBlue('Creating hooks...'), true);
|
|
212
|
+
copyHooks(packageDir, rootDir);
|
|
213
|
+
|
|
214
|
+
print(green(`Package ${packageName} has been successfully initialised in ${packageDir}.`), true);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Set the dynamic values for the file renaming and placeholder replacements.
|
|
219
|
+
*
|
|
220
|
+
* @param {string} packageName The name of the package being created.
|
|
221
|
+
* @param {string} rootDir The relative path of the root of the repository.
|
|
222
|
+
* @param {number} frontendPort The port that the frontend dev server will run on.
|
|
223
|
+
* @param {number} backendPort The port that the backend server runs on.
|
|
224
|
+
*/
|
|
225
|
+
function setReplacements (packageName, rootDir, frontendPort, backendPort) {
|
|
226
|
+
filesToRename['template.code-workspace'] = `${packageName}.code-workspace`;
|
|
227
|
+
|
|
228
|
+
placeholdersToReplace['[[PACKAGE_NAME]]'] = packageName;
|
|
229
|
+
placeholdersToReplace['[[REPOSITORY_ROOT]]'] = rootDir;
|
|
230
|
+
placeholdersToReplace['[[HUSKY_DIR]]'] = join(rootDir, '.husky').replace('\\', '/');
|
|
231
|
+
placeholdersToReplace['[[FRONTEND_PORT]]'] = frontendPort;
|
|
232
|
+
placeholdersToReplace['[[BACKEND_PORT]]'] = backendPort;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Prepares the directory for the new package to be created in.
|
|
237
|
+
*
|
|
238
|
+
* @param {string} path The path of the directory to be prepared.
|
|
239
|
+
* @param {boolean} empty If the current contents needs to be emptied.
|
|
240
|
+
*/
|
|
241
|
+
function prepareDir (path, empty) {
|
|
242
|
+
if (empty) {
|
|
243
|
+
const options = {
|
|
244
|
+
recursive: true,
|
|
245
|
+
force: true
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
print(lightBlue('Emptying directory...'), true);
|
|
249
|
+
|
|
250
|
+
forEachInDir(path, (item) => rmSync(join(path, item), options));
|
|
251
|
+
}
|
|
252
|
+
else if (!existsSync(path)) {
|
|
253
|
+
print(lightBlue('Creating directory...'), true);
|
|
254
|
+
|
|
255
|
+
mkdirSync(path);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Copies the template directory into the new package directory.
|
|
261
|
+
*
|
|
262
|
+
* @param {string} packageDir The directory of the new package.
|
|
263
|
+
*/
|
|
264
|
+
function copyTemplate (packageDir) {
|
|
265
|
+
const templateDir = join(codeDir, 'template');
|
|
266
|
+
|
|
267
|
+
forEachInDir(templateDir, (item) => copy(templateDir, packageDir, item));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Copies the hooks directory into the husky directory for the repository.
|
|
272
|
+
*
|
|
273
|
+
* @param {string} packageDir The directory of the new package.
|
|
274
|
+
* @param {string} rootDir The relative path from the package directory to the root of the repository.
|
|
275
|
+
*/
|
|
276
|
+
function copyHooks (packageDir, rootDir) {
|
|
277
|
+
const hooksDir = join(codeDir, 'hooks');
|
|
278
|
+
const huskyDir = join(cwd, packageDir, rootDir, '.husky');
|
|
279
|
+
|
|
280
|
+
forEachInDir(hooksDir, (item) => copy(hooksDir, huskyDir, item));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Copies a file or directory from one location to another.
|
|
285
|
+
*
|
|
286
|
+
* @param {string} source The path of the item to copy.
|
|
287
|
+
* @param {string} destination The path of the new item.
|
|
288
|
+
* @param {string} item The item to copy.
|
|
289
|
+
*/
|
|
290
|
+
function copy (source, destination, item) {
|
|
291
|
+
const sourceItem = join(source, item);
|
|
292
|
+
const info = statSync(sourceItem);
|
|
293
|
+
|
|
294
|
+
if (info.isDirectory()) {
|
|
295
|
+
const destinationDir = join(destination, item);
|
|
296
|
+
|
|
297
|
+
mkdirSync(destinationDir, { recursive: true });
|
|
298
|
+
|
|
299
|
+
forEachInDir(sourceItem, (item) => copy(sourceItem, destinationDir, item));
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
const destinationFile = filesToRename[item] ? join(destination, filesToRename[item]) : join(destination, item);
|
|
303
|
+
|
|
304
|
+
if (existsSync(destinationFile)) {
|
|
305
|
+
print(lightBlue(`Skipping ${item}...`), true);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
const options = {
|
|
309
|
+
encoding: 'utf-8'
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
print(lightBlue(`Copying ${item}...`), true);
|
|
313
|
+
|
|
314
|
+
let contents = readFileSync(sourceItem, options);
|
|
315
|
+
|
|
316
|
+
for (const [
|
|
317
|
+
key,
|
|
318
|
+
value
|
|
319
|
+
] of Object.entries(placeholdersToReplace)) {
|
|
320
|
+
contents = contents.replace(key, value);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
writeFileSync(destinationFile, contents, options);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Installs the required dependencies for the template.
|
|
330
|
+
*
|
|
331
|
+
* @param {string} packageManager The package manager to use.
|
|
332
|
+
*/
|
|
333
|
+
function installDependencies (packageManager) {
|
|
334
|
+
const prefix = `${packageManager} ${packageManager === 'yarn' ? 'add' : 'install'}`;
|
|
335
|
+
|
|
336
|
+
print(lightBlue('Installing dev dependencies...'), true);
|
|
337
|
+
|
|
338
|
+
let devDependencies = '';
|
|
339
|
+
for (const dependency of dependenciesToInstall.filter(d => d.dev)) {
|
|
340
|
+
devDependencies += `${dependency.name}${dependency.next ? '@next' : '@latest'} `;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
print(lightBlue('Installing dependencies...'), true);
|
|
344
|
+
|
|
345
|
+
let dependencies = '';
|
|
346
|
+
for (const dependency of dependenciesToInstall.filter(d => !d.dev)) {
|
|
347
|
+
dependencies += `${dependency.name}${dependency.next ? '@next' : '@latest'} `;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
execSync(`${prefix} -D ${devDependencies}`);
|
|
351
|
+
execSync(`${prefix} ${dependencies}`);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Calls the callback for each item in a directory.
|
|
356
|
+
*
|
|
357
|
+
* @param {string} dir The directory to loop-through the contents of.
|
|
358
|
+
* @param {function(string): void} callback The callback to provide with each item.
|
|
359
|
+
*/
|
|
360
|
+
function forEachInDir (dir, callback) {
|
|
361
|
+
const items = readdirSync(dir);
|
|
362
|
+
|
|
363
|
+
for (const item of items) {
|
|
364
|
+
callback(item);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Throws an error to indicate that the current operation has been cancelled.
|
|
370
|
+
*/
|
|
371
|
+
function cancel () {
|
|
372
|
+
throw new Error('Operation was cancelled.');
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Prints a message to the console.
|
|
377
|
+
*
|
|
378
|
+
* @param {string} message The message to display.
|
|
379
|
+
* @param {boolean} clearPrevious Whether to clear the previous line before displaying the new one.
|
|
380
|
+
*/
|
|
381
|
+
function print (message, clearPrevious = false) {
|
|
382
|
+
if (clearPrevious) {
|
|
383
|
+
process.stdout.clearLine();
|
|
384
|
+
process.stdout.cursorTo(0);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
process.stdout.write(message);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
try {
|
|
391
|
+
await init();
|
|
392
|
+
}
|
|
393
|
+
catch (e) {
|
|
394
|
+
print(`\n${red(e.message)}`);
|
|
395
|
+
}
|
package/package.json
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citruslime/create-boilerplate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Citrus-Lime Ltd",
|
|
6
6
|
"url": "https://citruslime.com"
|
|
7
7
|
},
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"homepage": "https://uilibrary.citruslime.com/",
|
|
10
|
-
"repository": {
|
|
11
|
-
"url": "https://dev.azure.com/citruslime/FutureEcommerce/_git/CitrusLime.VueUiLibrary?version=GBrelease"
|
|
12
|
-
},
|
|
13
10
|
"publishConfig": {
|
|
14
11
|
"access": "public"
|
|
15
12
|
},
|
|
16
13
|
"files": [
|
|
17
|
-
"
|
|
18
|
-
"
|
|
14
|
+
"main.mjs",
|
|
15
|
+
"template",
|
|
16
|
+
"hooks"
|
|
19
17
|
],
|
|
20
|
-
"main": "
|
|
18
|
+
"main": "main.mjs",
|
|
21
19
|
"bin": {
|
|
22
|
-
"create-boilerplate": "
|
|
23
|
-
"cva": "index.js"
|
|
20
|
+
"create-boilerplate": "main.mjs"
|
|
24
21
|
},
|
|
25
22
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
23
|
+
"node": ">=14.0.0"
|
|
27
24
|
},
|
|
28
25
|
"dependencies": {
|
|
29
|
-
"
|
|
30
|
-
"kolorist": "^1.5.0",
|
|
26
|
+
"kolorist": "^1.5.1",
|
|
31
27
|
"minimist": "^1.2.5",
|
|
32
|
-
"prompts": "^2.4.
|
|
28
|
+
"prompts": "^2.4.2"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/prompts": "^2.0.14"
|
|
33
32
|
}
|
|
34
33
|
}
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
"dbaeumer.vscode-eslint",
|
|
5
5
|
"stylelint.vscode-stylelint",
|
|
6
6
|
"bradlc.vscode-tailwindcss",
|
|
7
|
-
"adrianwilczynski.csharp-to-typescript",
|
|
8
7
|
"eamodio.gitlens",
|
|
9
|
-
"ms-vsliveshare.vsliveshare",
|
|
10
8
|
"christian-kohler.npm-intellisense",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
9
|
+
"editorconfig.editorconfig",
|
|
10
|
+
"cpylua.language-postcss",
|
|
11
|
+
"antfu.iconify"
|
|
13
12
|
]
|
|
14
13
|
}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
"css.validate": false,
|
|
6
6
|
"diffEditor.ignoreTrimWhitespace": false,
|
|
7
7
|
"editor.codeActionsOnSave": {
|
|
8
|
+
"source.fixAll": true,
|
|
9
|
+
"source.fixAll.eslint": true,
|
|
10
|
+
"source.fixAll.stylelint": true,
|
|
8
11
|
"source.organizeImports": false
|
|
9
12
|
},
|
|
10
13
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
|
@@ -20,22 +23,15 @@
|
|
|
20
23
|
],
|
|
21
24
|
"files.encoding": "utf8",
|
|
22
25
|
"files.eol": "\n",
|
|
23
|
-
"files.exclude": {
|
|
24
|
-
"node_modules": true
|
|
25
|
-
},
|
|
26
26
|
"files.trimTrailingWhitespace": true,
|
|
27
|
-
"git.autofetch": true,
|
|
28
|
-
"git.autofetchPeriod": 60,
|
|
29
|
-
"git.enableSmartCommit": true,
|
|
30
|
-
"git.pruneOnFetch": true,
|
|
31
27
|
"npm-intellisense.scanDevDependencies": true,
|
|
32
28
|
"npm-intellisense.showBuildInLibs": true,
|
|
29
|
+
"stylelint.validate": [
|
|
30
|
+
"css",
|
|
31
|
+
"postcss",
|
|
32
|
+
"vue"
|
|
33
|
+
],
|
|
33
34
|
"tailwindCSS.includeLanguages": {
|
|
34
35
|
"vue": "html"
|
|
35
|
-
}
|
|
36
|
-
"typescript.preferences.quoteStyle": "single",
|
|
37
|
-
"typescript.tsdk": "node_modules\\typescript\\lib",
|
|
38
|
-
"typescript.updateImportsOnFileMove.enabled": "always",
|
|
39
|
-
"volar.tsPlugin": true,
|
|
40
|
-
"volar.tsPluginStatus": false
|
|
36
|
+
}
|
|
41
37
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "Hooks",
|
|
9
|
-
"path": "
|
|
9
|
+
"path": "../[[HUSKY_DIR]]"
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"settings": {
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"css.validate": false,
|
|
17
17
|
"diffEditor.ignoreTrimWhitespace": false,
|
|
18
18
|
"editor.codeActionsOnSave": {
|
|
19
|
+
"source.fixAll": true,
|
|
20
|
+
"source.fixAll.eslint": true,
|
|
21
|
+
"source.fixAll.stylelint": true,
|
|
19
22
|
"source.organizeImports": false
|
|
20
23
|
},
|
|
21
24
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
|
@@ -31,24 +34,17 @@
|
|
|
31
34
|
],
|
|
32
35
|
"files.encoding": "utf8",
|
|
33
36
|
"files.eol": "\n",
|
|
34
|
-
"files.exclude": {
|
|
35
|
-
"node_modules": true
|
|
36
|
-
},
|
|
37
37
|
"files.trimTrailingWhitespace": true,
|
|
38
|
-
"git.autofetch": true,
|
|
39
|
-
"git.autofetchPeriod": 60,
|
|
40
|
-
"git.enableSmartCommit": true,
|
|
41
|
-
"git.pruneOnFetch": true,
|
|
42
38
|
"npm-intellisense.scanDevDependencies": true,
|
|
43
39
|
"npm-intellisense.showBuildInLibs": true,
|
|
40
|
+
"stylelint.validate": [
|
|
41
|
+
"css",
|
|
42
|
+
"postcss",
|
|
43
|
+
"vue"
|
|
44
|
+
],
|
|
44
45
|
"tailwindCSS.includeLanguages": {
|
|
45
46
|
"vue": "html"
|
|
46
|
-
}
|
|
47
|
-
"typescript.preferences.quoteStyle": "single",
|
|
48
|
-
"typescript.tsdk": "node_modules\\typescript\\lib",
|
|
49
|
-
"typescript.updateImportsOnFileMove.enabled": "always",
|
|
50
|
-
"volar.tsPlugin": true,
|
|
51
|
-
"volar.tsPluginStatus": false
|
|
47
|
+
}
|
|
52
48
|
},
|
|
53
49
|
"extensions": {
|
|
54
50
|
"recommendations": [
|
|
@@ -56,12 +52,11 @@
|
|
|
56
52
|
"dbaeumer.vscode-eslint",
|
|
57
53
|
"stylelint.vscode-stylelint",
|
|
58
54
|
"bradlc.vscode-tailwindcss",
|
|
59
|
-
"adrianwilczynski.csharp-to-typescript",
|
|
60
55
|
"eamodio.gitlens",
|
|
61
|
-
"ms-vsliveshare.vsliveshare",
|
|
62
56
|
"christian-kohler.npm-intellisense",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
57
|
+
"editorconfig.editorconfig",
|
|
58
|
+
"cpylua.language-postcss",
|
|
59
|
+
"antfu.iconify"
|
|
65
60
|
]
|
|
66
61
|
}
|
|
67
62
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Citrus-Lime Boilerplate App
|
|
2
|
+
|
|
3
|
+
This boilerplate should provide a good basis for creating a new Citrus-Lime web app.
|
|
4
|
+
|
|
5
|
+
It makes use of the various @citruslime packages, as well as the current standards for a Vue 3 + TypeScript app and various helpful Vite plugins to make development easier.
|
|
6
|
+
|
|
7
|
+
Linting is provided by default by a combination of ESLint and StyleLint.
|
|
8
|
+
|
|
9
|
+
## Areas of Consideration
|
|
10
|
+
|
|
11
|
+
Example code is provided in the state and views folders. It should be deleted or replaced, once development is started.
|
|
File without changes
|
|
File without changes
|