@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.
Files changed (51) hide show
  1. package/README.md +13 -18
  2. package/hooks/common.sh +7 -0
  3. package/hooks/post-checkout +11 -0
  4. package/hooks/post-merge +11 -0
  5. package/hooks/pre-commit +11 -0
  6. package/main.mjs +395 -0
  7. package/package.json +12 -13
  8. package/{boilerplate-app → template}/.vscode/extensions.json +3 -4
  9. package/{boilerplate-app → template}/.vscode/settings.json +9 -13
  10. package/{boilerplate-app/.vscode/boilerplate-app.code-workspace → template/.vscode/template.code-workspace} +13 -18
  11. package/template/README.md +11 -0
  12. package/{boilerplate-app → template}/_editorconfig +0 -0
  13. package/{boilerplate-app → template}/_eslintignore +0 -0
  14. package/template/_eslintrc.js +3 -0
  15. package/{boilerplate-app → template}/_gitignore +1 -0
  16. package/{boilerplate-app → template}/_lintstagedrc.json +1 -1
  17. package/{boilerplate-app → template}/_stylelintignore +0 -0
  18. package/template/_stylelintrc.js +3 -0
  19. package/{boilerplate-app → template}/index.html +1 -1
  20. package/template/package.json +13 -0
  21. package/template/postcss.config.js +6 -0
  22. package/{boilerplate-app → template}/public/favicon.ico +0 -0
  23. package/template/src/app.vue +31 -0
  24. package/template/src/env.d.ts +9 -0
  25. package/template/src/main.ts +17 -0
  26. package/{boilerplate-app → template}/src/router/index.ts +2 -1
  27. package/template/src/state/authentication/index.ts +9 -0
  28. package/template/src/state/index.ts +1 -0
  29. package/template/src/views/dasboard/index.vue +28 -0
  30. package/template/tailwind.config.js +7 -0
  31. package/{boilerplate-app → template}/tsconfig.json +10 -10
  32. package/template/vite.config.ts +71 -0
  33. package/boilerplate-app/_eslintrc.js +0 -4
  34. package/boilerplate-app/_stylelintrc.js +0 -3
  35. package/boilerplate-app/package.json +0 -55
  36. package/boilerplate-app/postcss.config.js +0 -8
  37. package/boilerplate-app/public/site.webmanifest +0 -8
  38. package/boilerplate-app/public/web.config +0 -7
  39. package/boilerplate-app/src/app.css +0 -9
  40. package/boilerplate-app/src/app.ts +0 -5
  41. package/boilerplate-app/src/app.vue +0 -7
  42. package/boilerplate-app/src/main.ts +0 -23
  43. package/boilerplate-app/src/shims-vue.d.ts +0 -7
  44. package/boilerplate-app/src/state/index.ts +0 -1
  45. package/boilerplate-app/src/state/utils/index.ts +0 -1
  46. package/boilerplate-app/src/views/dashboard/index.ts +0 -5
  47. package/boilerplate-app/src/views/dashboard/index.vue +0 -11
  48. package/boilerplate-app/src/vite-env.d.ts +0 -2
  49. package/boilerplate-app/tailwind.config.js +0 -16
  50. package/boilerplate-app/vite.config.ts +0 -50
  51. package/index.js +0 -250
File without changes
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: [ require.resolve('@citruslime/config/stylelint') ]
3
+ };
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" href="/favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>boilerplate-app</title>
7
+ <title>Citrus-Lime</title>
8
8
  </head>
9
9
  <body>
10
10
  <div id="app"></div>
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "[[PACKAGE_NAME]]",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "vue-tsc --noEmit --skipLibCheck && vite build",
8
+ "serve": "vite preview",
9
+ "lint": "eslint . --ext .js,.ts,.vue --fix && stylelint **/*.{css,vue} --fix",
10
+ "pre-commit-lint": "yarn lint-staged",
11
+ "prepare": "cd [[REPOSITORY_ROOT]] && husky install"
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {}
5
+ }
6
+ };
File without changes
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import { useRoute } from 'vue-router';
3
+
4
+ const route = useRoute();
5
+ </script>
6
+
7
+ <style lang="postcss">
8
+ @import '@citruslime/ui/style';
9
+
10
+ @tailwind base;
11
+ @tailwind components;
12
+ @tailwind utilities;
13
+
14
+ body {
15
+ @apply bg-off-white min-h-screen w-full;
16
+ }
17
+ </style>
18
+
19
+ <template>
20
+ <cl-ui-app>
21
+ <template #header>
22
+ <cl-ui-header />
23
+ </template>
24
+
25
+ <template #navigation>
26
+ <cl-ui-navigation />
27
+ </template>
28
+
29
+ <router-view :key="route.fullPath" />
30
+ </cl-ui-app>
31
+ </template>
@@ -0,0 +1,9 @@
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="vite-plugin-pages/client" />
3
+
4
+ declare module '*.vue' {
5
+ import type { DefineComponent } from 'vue';
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
7
+ const component: DefineComponent<{}, {}, any>;
8
+ export default component;
9
+ }
@@ -0,0 +1,17 @@
1
+ import ui from '@citruslime/ui';
2
+ import { createPinia } from 'pinia';
3
+ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
4
+ import { createApp } from 'vue';
5
+
6
+ import app from './app.vue';
7
+ import router from './router';
8
+
9
+ const pinia = createPinia();
10
+
11
+ pinia.use(piniaPluginPersistedstate);
12
+
13
+ createApp(app)
14
+ .use(router)
15
+ .use(ui)
16
+ .use(pinia)
17
+ .mount('#app');
@@ -1,5 +1,6 @@
1
1
  import generatedRoutes from 'virtual:generated-pages';
2
- import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
2
+ import type { RouteRecordRaw } from 'vue-router';
3
+ import { createRouter, createWebHashHistory } from 'vue-router';
3
4
 
4
5
  export const routes: RouteRecordRaw[] = [
5
6
  ...generatedRoutes,
@@ -0,0 +1,9 @@
1
+ import { defineStore } from 'pinia';
2
+
3
+ export const useAuthStore = defineStore('auth', {
4
+ state: () => ({
5
+ username: 'Nobody',
6
+ loginDate: null as Date | null
7
+ }),
8
+ persist: true
9
+ });
@@ -0,0 +1 @@
1
+ export * from './authentication';
@@ -0,0 +1,28 @@
1
+ <route>
2
+ {
3
+ path: '/'
4
+ }
5
+ </route>
6
+
7
+ <script setup lang="ts">
8
+ import { setLocaleMessages } from '@citruslime/ui';
9
+ import { storeToRefs } from 'pinia';
10
+ import { useI18n } from 'vue-i18n';
11
+
12
+ import { useAuthStore } from '@/state';
13
+
14
+ const { username } = storeToRefs(useAuthStore());
15
+ const { t } = useI18n();
16
+
17
+ setLocaleMessages('en-GB', {
18
+ messages: {
19
+ greeting: 'Hello, {name}!'
20
+ }
21
+ });
22
+ </script>
23
+
24
+ <template>
25
+ <div>
26
+ {{ t('messages.greeting', { name: username }) }}
27
+ </div>
28
+ </template>
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ presets: [ require('@citruslime/theme') ],
3
+ content: [
4
+ './index.html',
5
+ './src/**/*.{vue,js,ts,jsx,tsx}'
6
+ ]
7
+ };
@@ -1,29 +1,29 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "esnext",
4
+ "useDefineForClassFields": true,
4
5
  "module": "esnext",
5
6
  "moduleResolution": "node",
6
7
  "strict": true,
8
+ "jsx": "preserve",
7
9
  "sourceMap": true,
8
10
  "resolveJsonModule": true,
9
11
  "esModuleInterop": true,
10
- "isolatedModules": true,
12
+ "strictNullChecks": true,
11
13
  "lib": [
12
14
  "esnext",
13
15
  "dom"
14
16
  ],
15
- "types": [
16
- "vite/client"
17
- ],
18
- "plugins": [
19
- {
20
- "name": "typescript-vue-plugin"
21
- }
22
- ]
17
+ "paths": {
18
+ "@/*": [
19
+ "./src/*"
20
+ ]
21
+ }
23
22
  },
24
23
  "include": [
25
24
  "src/**/*.ts",
26
25
  "src/**/*.d.ts",
27
- "src/**/*.vue"
26
+ "src/**/*.vue",
27
+ "./components.d.ts"
28
28
  ]
29
29
  }
@@ -0,0 +1,71 @@
1
+ import path from 'path';
2
+
3
+ import vue from '@vitejs/plugin-vue';
4
+ import { VueUseComponentsResolver } from 'unplugin-vue-components/resolvers';
5
+ import components from 'unplugin-vue-components/vite';
6
+ import { defineConfig } from 'vite';
7
+ import mkcert from 'vite-plugin-mkcert';
8
+ import pages from 'vite-plugin-pages';
9
+
10
+ export default defineConfig({
11
+ plugins: [
12
+ vue(),
13
+ pages({
14
+ pagesDir: 'src/views',
15
+ extensions: [ 'vue' ]
16
+ }),
17
+ components({
18
+ dirs: [
19
+ 'src/components',
20
+ 'src/pages'
21
+ ],
22
+ dts: true,
23
+ resolvers: [ VueUseComponentsResolver() ]
24
+ }),
25
+ mkcert()
26
+ ],
27
+ build: {
28
+ rollupOptions: {
29
+ output: {
30
+ manualChunks (id) {
31
+ if (id.includes('node_modules')) {
32
+ return id.toString().split('node_modules/')[1].split('/')[0].toString();
33
+ }
34
+ }
35
+ }
36
+ }
37
+ },
38
+ define: {
39
+ /* eslint-disable @typescript-eslint/naming-convention */
40
+ __VUE_I18N_FULL_INSTALL__: true,
41
+ __VUE_I18N_LEGACY_API__: false,
42
+ __INTLIFY_PROD_DEVTOOLS__: false
43
+ /* eslint-enable @typescript-eslint/naming-convention */
44
+ },
45
+ optimizeDeps: {
46
+ include: [ 'vue-i18n' ]
47
+ },
48
+ resolve: {
49
+ alias: {
50
+ /* eslint-disable @typescript-eslint/naming-convention */
51
+ '@': path.resolve(__dirname, 'src'),
52
+ 'vue-i18n': 'vue-i18n/dist/vue-i18n.esm-bundler.js'
53
+ /* eslint-enable @typescript-eslint/naming-convention */
54
+ }
55
+ },
56
+ server: {
57
+ open: true,
58
+ https: true,
59
+ // eslint-disable-next-line array-bracket-spacing
60
+ port: [[FRONTEND_PORT]],
61
+ proxy: {
62
+ /* eslint-disable @typescript-eslint/naming-convention */
63
+ '/api': {
64
+ target: 'https://localhost:[[BACKEND_PORT]]',
65
+ secure: false,
66
+ rewrite: (path) => path.replace('/api', '')
67
+ }
68
+ /* eslint-enable @typescript-eslint/naming-convention */
69
+ }
70
+ }
71
+ });
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: [ './node_modules/@citruslime/ui/dist/.eslintrc.js' ]
4
- };
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: [ './node_modules/@citruslime/ui/dist/.stylelintrc.js' ]
3
- };
@@ -1,55 +0,0 @@
1
- {
2
- "name": "boilerplate-app",
3
- "version": "0.0.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "vite",
7
- "build": "vue-tsc --noEmit && vite build",
8
- "serve": "vite preview",
9
- "lint": "eslint . --ext .js,.ts,.vue --fix && stylelint ./**/*.css --fix",
10
- "pre-commit-lint": "yarn lint-staged",
11
- "prepare": "cd .. && husky install"
12
- },
13
- "dependencies": {
14
- "@citruslime/ui": "^1.1.3",
15
- "@harlem/core": "^1.3.2",
16
- "@harlem/plugin-devtools": "^1.3.2",
17
- "@harlem/plugin-storage": "^1.3.2",
18
- "vue": "^3.1.4",
19
- "vue-router": "^4.0.10"
20
- },
21
- "devDependencies": {
22
- "@iconify/json": "^1.1.376",
23
- "@tailwindcss/forms": "^0.3.3",
24
- "@typescript-eslint/eslint-plugin": "^4.28.3",
25
- "@typescript-eslint/parser": "^4.28.3",
26
- "@vitejs/plugin-vue": "^1.2.5",
27
- "@vue/compiler-sfc": "^3.1.4",
28
- "@vue/eslint-config-typescript": "^7.0.0",
29
- "autoprefixer": "^10.3.1",
30
- "eslint": "^7.30.0",
31
- "eslint-plugin-import": "^2.23.4",
32
- "eslint-plugin-jsdoc": "^35.4.3",
33
- "eslint-plugin-vue": "^7.13.0",
34
- "husky": "^7.0.1",
35
- "lint-staged": "^11.0.1",
36
- "postcss": "^8.3.5",
37
- "postcss-combine-media-query": "^1.0.1",
38
- "postcss-discard-duplicates": "^5.0.1",
39
- "stylelint": "^13.13.1",
40
- "stylelint-config-idiomatic-order": "^8.1.0",
41
- "stylelint-config-standard": "^22.0.0",
42
- "stylelint-group-selectors": "^1.0.8",
43
- "stylelint-high-performance-animation": "^1.5.2",
44
- "stylelint-order": "^4.1.0",
45
- "tailwindcss": "^2.2.4",
46
- "typescript": "^4.3.5",
47
- "typescript-vue-plugin": "^0.26.2",
48
- "vite": "^2.4.2",
49
- "vite-plugin-components": "^0.13.0",
50
- "vite-plugin-icons": "^0.6.5",
51
- "vite-plugin-mkcert": "^1.3.2",
52
- "vite-plugin-pages": "^0.15.0",
53
- "vue-tsc": "^0.2.1"
54
- }
55
- }
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- 'postcss-discard-duplicates': {},
6
- 'postcss-combine-media-query': {}
7
- }
8
- };
@@ -1,8 +0,0 @@
1
- {
2
- "name": "",
3
- "short_name": "",
4
- "icons": [],
5
- "theme_color": "#637bc6",
6
- "background_color": "#9acd32",
7
- "display": "standalone"
8
- }
@@ -1,7 +0,0 @@
1
- <configuration>
2
- <system.webServer>
3
- <staticContent>
4
- <mimeMap fileExtension="webmanifest" mimeType="application/json" />
5
- </staticContent>
6
- </system.webServer>
7
- </configuration>
@@ -1,9 +0,0 @@
1
- @import '@citruslime/ui/dist/style.css';
2
-
3
- @tailwind base;
4
- @tailwind components;
5
- @tailwind utilities;
6
-
7
- body {
8
- @apply bg-off-white min-h-screen w-full;
9
- }
@@ -1,5 +0,0 @@
1
- import { defineComponent } from 'vue';
2
-
3
- export default defineComponent({
4
- name: 'App'
5
- });
@@ -1,7 +0,0 @@
1
- <script lang="ts" src="./app"></script>
2
-
3
- <style src="./app.css"></style>
4
-
5
- <template>
6
- <router-view />
7
- </template>
@@ -1,23 +0,0 @@
1
- import citrusLimeUi from '@citruslime/ui';
2
- import harlem from '@harlem/core';
3
- import createDevtoolsPlugin from '@harlem/plugin-devtools';
4
- import createStoragePlugin from '@harlem/plugin-storage';
5
- import { createApp } from 'vue';
6
-
7
- import app from './app.vue';
8
- import router from './router';
9
- import { prefix } from './state';
10
-
11
- createApp(app)
12
- .use(router)
13
- .use(citrusLimeUi)
14
- .use(harlem, {
15
- plugins: [
16
- createDevtoolsPlugin(),
17
- createStoragePlugin('*', {
18
- type: 'local',
19
- prefix
20
- })
21
- ]
22
- })
23
- .mount('#app');
@@ -1,7 +0,0 @@
1
- declare module '*.vue' {
2
- import { DefineComponent } from 'vue';
3
-
4
- const component: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
5
-
6
- export default component;
7
- }
@@ -1 +0,0 @@
1
- export { prefix } from './utils';
@@ -1 +0,0 @@
1
- export const prefix = 'boilerplate-app';
@@ -1,5 +0,0 @@
1
- import { defineComponent } from 'vue';
2
-
3
- export default defineComponent({
4
- name: 'Dashboard'
5
- });
@@ -1,11 +0,0 @@
1
- <script lang="ts" src="."></script>
2
-
3
- <route>
4
- {
5
- path: '/'
6
- }
7
- </route>
8
-
9
- <template>
10
- <div></div>
11
- </template>
@@ -1,2 +0,0 @@
1
- /// <reference types="vite/client" />
2
- /// <reference types="vite-plugin-pages/client" />
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- mode: 'jit',
3
- presets: [ require('@citruslime/ui/dist/theme') ],
4
- purge: [
5
- './index.html',
6
- './src/**/*.{vue,js,ts,jsx,tsx}'
7
- ],
8
- darkMode: false,
9
- theme: {
10
- extend: {}
11
- },
12
- variants: {
13
- extend: {}
14
- },
15
- plugins: []
16
- };
@@ -1,50 +0,0 @@
1
- import path from 'path';
2
-
3
- import vue from '@vitejs/plugin-vue';
4
- import { defineConfig } from 'vite';
5
- import components from 'vite-plugin-components';
6
- import icons, { ViteIconsResolver } from 'vite-plugin-icons';
7
- import mkcert from 'vite-plugin-mkcert';
8
- import pages from 'vite-plugin-pages';
9
-
10
- export default defineConfig({
11
- plugins: [
12
- vue(),
13
- pages({
14
- pagesDir: 'src/views',
15
- extensions: [ 'vue' ]
16
- }),
17
- components({
18
- customComponentResolvers: [ ViteIconsResolver({
19
- componentPrefix: ''
20
- }) ]
21
- }),
22
- icons(),
23
- mkcert()
24
- ],
25
- define: {
26
- /* eslint-disable @typescript-eslint/naming-convention */
27
- __VUE_I18N_FULL_INSTALL__: true,
28
- __VUE_I18N_LEGACY_API__: false,
29
- __INTLIFY_PROD_DEVTOOLS__: false
30
- /* eslint-enable @typescript-eslint/naming-convention */
31
- },
32
- resolve: {
33
- alias: {
34
- '@': path.resolve(__dirname, 'src'),
35
- 'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
36
- }
37
- },
38
- server: {
39
- open: true,
40
- https: true,
41
- port: 9999999999,
42
- proxy: {
43
- '/api': {
44
- target: 'https://localhost:[[PORTNUMBERBACKEND]]',
45
- secure: false,
46
- rewrite: (path) => path.replace('/api', '')
47
- }
48
- }
49
- }
50
- });