@solfacil/girassol 0.1.9 → 0.2.0

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 (87) hide show
  1. package/cli/bin/{girassol → girassol-cli} +0 -0
  2. package/cli/build/cli.js +68 -0
  3. package/cli/build/commands/create:component.js +124 -0
  4. package/cli/build/commands/generate:plugin.js +89 -0
  5. package/cli/build/commands/generate:types.js +76 -0
  6. package/cli/build/commands/girassol-cli.js +52 -0
  7. package/cli/build/extensions/cli-extension.js +17 -0
  8. package/cli/build/templates/components.d.ts.ejs +1 -0
  9. package/cli/build/templates/nuxt-plugin.ejs +8 -0
  10. package/cli/build/templates/vue-plugin.ejs +5 -0
  11. package/cli/{src → build}/templates/windi.config.ts.ejs +0 -0
  12. package/cli/build/types/cli.d.ts +1 -0
  13. package/cli/build/types/commands/create:component.d.ts +1 -0
  14. package/cli/build/types/commands/generate:plugin.d.ts +1 -0
  15. package/cli/build/types/commands/generate:types.d.ts +7 -0
  16. package/cli/build/types/commands/girassol-cli.d.ts +1 -0
  17. package/cli/build/types/extensions/cli-extension.d.ts +1 -0
  18. package/cli/build/types/types.d.ts +0 -0
  19. package/cli/build/types.js +2 -0
  20. package/dist/README.md.d.ts +2 -0
  21. package/dist/cli/readme.md.d.ts +2 -0
  22. package/dist/cli/src/cli.d.ts +1 -0
  23. package/dist/cli/src/commands/create:component.d.ts +1 -0
  24. package/dist/cli/src/commands/generate:plugin.d.ts +1 -0
  25. package/dist/cli/src/commands/generate:types.d.ts +7 -0
  26. package/dist/cli/src/commands/girassol-cli.d.ts +1 -0
  27. package/dist/cli/src/extensions/cli-extension.d.ts +1 -0
  28. package/dist/cli/src/types.d.ts +0 -0
  29. package/dist/components.d.ts +22 -0
  30. package/dist/components.json +1 -0
  31. package/dist/girassol.es.js +611 -261
  32. package/dist/girassol.umd.js +5 -5
  33. package/dist/style.css +1 -1
  34. package/dist/theme/solfacil/colors.d.ts +23 -5
  35. package/dist/theme/solfacil/effects.d.ts +5 -3
  36. package/dist/theme/solfacil/typography.d.ts +1 -2
  37. package/dist/types/components/accordion/Accordion.vue.d.ts +97 -0
  38. package/dist/types/components/accordion/accordion.spec.d.ts +1 -0
  39. package/dist/types/components/accordion/index.d.ts +2 -0
  40. package/dist/types/components/dropdown/Dropdown.vue.d.ts +188 -31
  41. package/dist/types/components/forms/button/Button.vue.d.ts +86 -12
  42. package/dist/types/components/forms/checkbox/Checkbox.vue.d.ts +77 -11
  43. package/dist/types/components/forms/checkbox/CheckboxGroup.vue.d.ts +114 -19
  44. package/dist/types/components/forms/input/Input.vue.d.ts +76 -10
  45. package/dist/types/components/forms/radio/Radio.vue.d.ts +77 -11
  46. package/dist/types/components/forms/radio/RadioGroup.vue.d.ts +114 -19
  47. package/dist/types/components/forms/select/ListOption.vue.d.ts +149 -0
  48. package/dist/types/components/forms/select/Select.vue.d.ts +298 -27
  49. package/dist/types/components/forms/switch/Switch.vue.d.ts +83 -13
  50. package/dist/types/components/forms/textarea/Textarea.vue.d.ts +108 -19
  51. package/dist/types/components/forms/textfield/Textfield.vue.d.ts +101 -17
  52. package/dist/types/components/forms/textfield/TextfieldPassword.vue.d.ts +71 -9
  53. package/dist/types/components/informations/chip/Chip.vue.d.ts +94 -15
  54. package/dist/types/composables/use-toast/Toast.vue.d.ts +130 -24
  55. package/dist/types/composables/use-toast/index.d.ts +1 -1
  56. package/dist/types/index.d.ts +2723 -2
  57. package/dist/vite-modules/generate-component-types.d.ts +3 -0
  58. package/dist/windi.config.d.ts +1 -1
  59. package/package.json +52 -42
  60. package/theme/solfacil/borders.ts +2 -1
  61. package/theme/solfacil/colors.ts +36 -23
  62. package/theme/solfacil/effects.ts +6 -4
  63. package/theme/solfacil/typography.ts +2 -4
  64. package/vite.config.ts +4 -0
  65. package/windi.config.ts +31 -1
  66. package/cli/.eslintrc.js +0 -18
  67. package/cli/LICENSE +0 -21
  68. package/cli/docs/commands.md +0 -3
  69. package/cli/docs/plugins.md +0 -47
  70. package/cli/package.json +0 -53
  71. package/cli/readme.md +0 -26
  72. package/cli/src/cli.ts +0 -25
  73. package/cli/src/commands/create:component.ts +0 -93
  74. package/cli/src/commands/generate:plugin.ts +0 -68
  75. package/cli/src/commands/generate:types.ts +0 -38
  76. package/cli/src/commands/girassol.ts +0 -12
  77. package/cli/src/extensions/cli-extension.ts +0 -17
  78. package/cli/src/templates/components/component.spec.ts.ejs +0 -20
  79. package/cli/src/templates/components/component.stories.mdx.ejs +0 -74
  80. package/cli/src/templates/components/component.vue.ejs +0 -23
  81. package/cli/src/templates/components/index.ts.ejs +0 -10
  82. package/cli/src/templates/components.d.ts.ejs +0 -10
  83. package/cli/src/templates/nuxt-plugin.ejs +0 -7
  84. package/cli/src/templates/vue-plugin.ejs +0 -5
  85. package/cli/src/types.ts +0 -1
  86. package/cli/tsconfig.json +0 -28
  87. package/cli/yarn.lock +0 -1804
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from 'vite';
2
+ declare const _default: () => Plugin;
3
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("windicss/types/interfaces").FullConfig;
1
+ declare const _default: import("vite-plugin-windicss").WindiCssOptions;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solfacil/girassol",
3
3
  "description": "Girassol design system",
4
- "version": "0.1.9",
4
+ "version": "0.2.0",
5
5
  "authors": [
6
6
  {
7
7
  "name": "Kevin Martin",
@@ -17,9 +17,13 @@
17
17
  "dist",
18
18
  "public/",
19
19
  "theme/",
20
- "cli/",
20
+ "cli/bin",
21
+ "cli/build",
21
22
  "*.ts"
22
23
  ],
24
+ "bin": {
25
+ "girassol-cli": "./cli/bin/girassol-cli"
26
+ },
23
27
  "main": "./dist/girassol.umd.js",
24
28
  "module": "./dist/girassol.es.js",
25
29
  "exports": {
@@ -33,77 +37,83 @@
33
37
  "types": "./dist/types/index.d.ts",
34
38
  "scripts": {
35
39
  "dev": "vite --port 3333 --host",
36
- "build:cli": "cd cli/ && yarn build",
37
40
  "build:lib": "vue-tsc --noEmit && vite build",
38
41
  "build:lib:ts": "vite build && vue-tsc --emitDeclarationOnly && mv dist/src dist/types",
39
42
  "preview": "vite preview",
40
43
  "lint": "eslint src/ --resolve-plugins-relative-to .",
41
44
  "lint:fix": "eslint src/ --fix --resolve-plugins-relative-to .",
42
- "girassol": "girassol",
45
+ "girassol-cli": "cli/bin/girassol-cli",
43
46
  "test": "vitest run",
44
47
  "test:w": "vitest watch --silent ",
45
48
  "test:coverage": "vitest run --silent --coverage",
46
49
  "storybook": "start-storybook -p 6006 --ci",
50
+ "build-storybook": "build-storybook",
51
+ "cli:clean-build": "rm -rf ./cli/build",
52
+ "cli:compile": "tsc -p ./cli",
53
+ "cli:copy-templates": "copyfiles -f ./cli/src/templates/* ./cli/build/templates",
54
+ "cli:build": "yarn cli:clean-build && yarn cli:compile && yarn cli:copy-templates",
47
55
  "prepare": "husky install",
48
56
  "commit": "cz",
49
- "pre-commit": "./.husky/run-staged-tests.js",
50
- "build-storybook": "build-storybook"
57
+ "pre-commit": "./.husky/run-staged-tests.js"
51
58
  },
52
59
  "dependencies": {
53
- "@vueuse/core": "^8.5.0",
54
- "vue": "^3.2.36"
60
+ "@vueuse/core": "^8.7.5",
61
+ "gluegun": "latest",
62
+ "vue": "^3.2.37"
55
63
  },
56
64
  "devDependencies": {
57
- "@antfu/eslint-config": "^0.23.1",
58
- "@babel/core": "^7.18.2",
59
- "@babel/preset-env": "^7.18.2",
60
- "@commitlint/cli": "^17.0.1",
61
- "@commitlint/config-conventional": "^17.0.0",
62
- "@iconify/json": "^2.1.28",
63
- "@storybook/addon-a11y": "^6.5.5",
64
- "@storybook/addon-actions": "^6.5.5",
65
- "@storybook/addon-essentials": "^6.5.5",
66
- "@storybook/addon-links": "^6.5.5",
67
- "@storybook/builder-vite": "^0.1.35",
68
- "@storybook/theming": "^6.5.5",
69
- "@storybook/vue3": "^6.5.5",
65
+ "@antfu/eslint-config": "^0.25.2",
66
+ "@babel/core": "^7.18.6",
67
+ "@babel/preset-env": "^7.18.6",
68
+ "@commitlint/cli": "^17.0.3",
69
+ "@commitlint/config-conventional": "^17.0.3",
70
+ "@iconify/json": "^2.1.70",
71
+ "@storybook/addon-a11y": "^6.5.9",
72
+ "@storybook/addon-actions": "^6.5.9",
73
+ "@storybook/addon-essentials": "^6.5.9",
74
+ "@storybook/addon-links": "^6.5.9",
75
+ "@storybook/builder-vite": "^0.1.38",
76
+ "@storybook/theming": "^6.5.9",
77
+ "@storybook/vue3": "^6.5.9",
70
78
  "@testing-library/jest-dom": "^5.16.4",
71
- "@testing-library/user-event": "^14.2.0",
72
- "@testing-library/vue": "^6.5.1",
73
- "@types/jest-axe": "^3.5.3",
74
- "@types/node": "^17.0.35",
75
- "@typescript-eslint/eslint-plugin": "^5.26.0",
76
- "@typescript-eslint/parser": "^5.26.0",
79
+ "@testing-library/user-event": "^14.2.1",
80
+ "@testing-library/vue": "^6.6.0",
81
+ "@types/jest-axe": "^3.5.4",
82
+ "@types/node": "^17.0.41",
83
+ "@typescript-eslint/eslint-plugin": "^5.30.0",
84
+ "@typescript-eslint/parser": "^5.30.0",
77
85
  "@vitejs/plugin-vue": "^2.3.3",
78
86
  "babel-loader": "^8.2.5",
79
87
  "c8": "^7.11.3",
80
88
  "cli-spinner": "^0.2.10",
81
89
  "commitizen": "^4.2.4",
90
+ "copyfiles": "^2.4.1",
82
91
  "critters": "^0.0.16",
83
- "eslint": "^8.14.0",
92
+ "eslint": "^8.18.0",
84
93
  "eslint-config-prettier": "^8.5.0",
85
94
  "eslint-plugin-html": "^6.2.0",
86
- "eslint-plugin-prettier": "^4.0.0",
95
+ "eslint-plugin-prettier": "^4.2.1",
87
96
  "eslint-plugin-vue": "^8.7.1",
88
- "eslint-plugin-vuejs-accessibility": "^1.1.1",
97
+ "eslint-plugin-vuejs-accessibility": "^1.2.0",
89
98
  "husky": "^8.0.1",
90
99
  "jest-axe": "^5.0.1",
91
- "jsdom": "^19.0.0",
100
+ "jsdom": "^20.0.0",
92
101
  "sass": "^1.50.0",
93
- "storybook-addon-designs": "^6.2.1",
94
- "stylelint": "^14.8.2",
102
+ "storybook-addon-designs": "^6.3.1",
103
+ "stylelint": "^14.9.1",
95
104
  "stylelint-config-prettier": "^9.0.3",
96
105
  "stylelint-config-property-sort-order-smacss": "^9.0.0",
97
106
  "stylelint-order": "^5.0.0",
98
- "typescript": "^4.6.3",
99
- "unplugin-icons": "^0.14.3",
100
- "vite": "^2.9.9",
101
- "vite-plugin-inspect": "^0.5.0",
102
- "vite-plugin-windicss": "^1.8.4",
103
- "vitest": "^0.12.9",
107
+ "ts-node": "^10.8.1",
108
+ "typescript": "^4.7.4",
109
+ "unplugin-icons": "^0.14.7",
110
+ "vite": "^2.9.13",
111
+ "vite-plugin-inspect": "^0.5.1",
112
+ "vite-plugin-windicss": "^1.8.6",
113
+ "vitest": "^0.16.0",
104
114
  "vue-loader": "^17.0.0",
105
- "vue-tsc": "^0.34.15",
106
- "windicss": "^3.5.4"
115
+ "vue-tsc": "^0.38.2",
116
+ "windicss": "^3.5.6"
107
117
  },
108
118
  "repository": {
109
119
  "type": "git",
@@ -126,4 +136,4 @@
126
136
  "path": "./node_modules/cz-conventional-changelog"
127
137
  }
128
138
  }
129
- }
139
+ }
@@ -4,7 +4,8 @@ export default {
4
4
  sm: '0.25rem',
5
5
  md: '0.5rem',
6
6
  lg: '1rem',
7
- full: '40rem',
7
+ full: '80rem',
8
+
8
9
  half: '50%',
9
10
  fully: '100%',
10
11
  },
@@ -1,43 +1,56 @@
1
1
  export default {
2
2
  brand: {
3
3
  primary: {
4
- light: '#FFF8EB',
5
- medium: '#FFCD70',
6
- pure: '#FFB01F',
4
+ medium: '#BFFF00',
5
+ light: '#EFFFC1',
6
+ pure: '#00B569',
7
+ dark: '#008859',
7
8
  },
8
9
  },
9
-
10
+ highlight: {
11
+ pure: '#8250DF',
12
+ light: '#E6DCF9',
13
+ medium: '#C0A7EF',
14
+ dark: '#342059',
15
+ },
10
16
  neutral: {
11
17
  low: {
12
- light: '#8f8f8f',
13
- medium: '#525252',
14
- pure: '#292929',
18
+ pure: '#000000',
19
+ light: '#888888',
20
+ medium: '#555555',
21
+ dark: '#222222',
15
22
  },
16
-
17
23
  high: {
18
- light: '#FFFFFF',
19
- medium: '#F5F5F5',
20
- pure: '#E0E0E0',
24
+ pure: '#ffffff',
25
+ light: '#F5f5f5',
26
+ medium: '#e0e0e0',
27
+ dark: '#cccccc',
21
28
  },
22
29
  },
23
-
24
30
  feedback: {
25
31
  positive: {
26
- light: '#eefbf6',
27
- medium: '#8ae5bf',
28
- pure: '#47d79a',
32
+ pure: '#1CA36F',
33
+ light: '#D2EDE2',
34
+ medium: '#8DD1B7',
35
+ dark: '#0B412C',
36
+ },
37
+ warning: {
38
+ pure: '#FFB300',
39
+ light: '#FFF0CC',
40
+ medium: '#FFD97F',
41
+ dark: '#664800',
29
42
  },
30
-
31
43
  informative: {
32
- light: '#ebf8ff',
33
- medium: '#70cbff',
34
- pure: '#1faeff',
44
+ pure: '#1976D2',
45
+ light: '#D1E4F6',
46
+ medium: '#8CBAE8',
47
+ dark: '#0A2F54',
35
48
  },
36
-
37
49
  negative: {
38
- light: '#ffebeb',
39
- medium: '#ff7470',
40
- pure: '#ff251f',
50
+ pure: '#D0382D',
51
+ light: '#F6D7D5',
52
+ medium: '#E79B96',
53
+ dark: '#531612',
41
54
  },
42
55
  },
43
56
  }
@@ -1,15 +1,17 @@
1
1
  export default {
2
- opacity: {
2
+ opacity: {
3
3
  'DEFAULT': 1,
4
4
 
5
5
  strong: 0.8,
6
+ intense: 0.6,
6
7
  moderate: 0.32,
7
8
  weak: 0.16,
8
9
  },
9
10
 
10
11
  boxShadow: {
11
- soft: '0px 8px 16px rgba(41, 41, 41, 0.08)',
12
- medium: '0px 12px 24px rgba(41, 41, 41, 0.16)',
13
- large: '0px 16px 64px rgba(41, 41, 41, 0.24)',
12
+ weak: '0px 4px 8px rgba(41, 41, 41, 0.08)',
13
+ moderate: '0px 8px 24px rgba(41, 41, 41, 0.16)',
14
+ intense: '0px 16px 32px rgba(41, 41, 41, 0.24)',
15
+ strong: '0px 16px 48px rgba(41, 41, 41, 0.24)',
14
16
  },
15
17
  }
@@ -1,10 +1,8 @@
1
1
  export default {
2
2
  fontFamily: {
3
3
  sans: ['"Lato"', 'sans-serif'],
4
-
5
4
  base: ['"Lato"', 'sans-serif'],
6
- highlight: ['"Rubik"'],
7
- code: ['"Roboto Slab", "serif"'],
5
+ title: ['"Rubik"'],
8
6
  },
9
7
 
10
8
  fontSize: {
@@ -21,7 +19,7 @@ export default {
21
19
  '2xl': '3.5rem',
22
20
  '3xl': '4rem',
23
21
  'mega': '4.5rem',
24
- 'giga': '5.5rem',
22
+ 'giga': '5rem',
25
23
  },
26
24
 
27
25
  lineHeight: {
package/vite.config.ts CHANGED
@@ -8,6 +8,8 @@ import Icons from 'unplugin-icons/vite'
8
8
  import Inspect from 'vite-plugin-inspect'
9
9
  import WindiCSS from 'vite-plugin-windicss'
10
10
 
11
+ import GirassolComponentsTypes from './vite-modules/generate-component-types'
12
+
11
13
  const currentPath = path.resolve(__dirname)
12
14
 
13
15
  // https://vitejs.dev/config/
@@ -53,6 +55,8 @@ export default defineConfig({
53
55
  autoInstall: true,
54
56
  compiler: 'vue3',
55
57
  }),
58
+
59
+ GirassolComponentsTypes(),
56
60
  ],
57
61
 
58
62
  optimizeDeps: {
package/windi.config.ts CHANGED
@@ -4,13 +4,43 @@ import typography from 'windicss/plugin/typography'
4
4
 
5
5
  import { borders, colors, effects, misc, spacing, typography as typos, utilities } from './theme/solfacil/'
6
6
 
7
+ function range(size: number, startAt = 1) {
8
+ return Array.from(Array(size).keys()).map(i => i + startAt)
9
+ }
10
+
7
11
  export default defineConfig({
8
12
  darkMode: 'class',
9
13
  attributify: false,
10
14
  extract: {
11
- include: ['index.html', 'src/**/*'],
15
+ include: ['index.html', 'src/**/*', '*.mdx', '*.vue'],
12
16
  },
13
17
 
18
+ safelist: [
19
+ 'p-nano',
20
+ 'p-micro',
21
+ 'p-3xs',
22
+ 'p-2xs',
23
+ 'p-xs',
24
+ 'p-sm',
25
+ 'p-md',
26
+ 'p-lg',
27
+ 'm-nano',
28
+ 'm-micro',
29
+ 'm-3xs',
30
+ 'm-2xs',
31
+ 'm-xs',
32
+ 'm-sm',
33
+ 'm-md',
34
+ 'm-lg',
35
+ range(30).map(i => `grid-rows-${i}`),
36
+ range(30).map(i => `grid-cols-${i}`),
37
+ range(10).map(i => `gap-${i}`),
38
+ range(30).map(i => `row-start-${i}`),
39
+ range(30).map(i => `col-start-${i}`),
40
+ range(30).map(i => `row-span-${i}`),
41
+ range(30).map(i => `col-span-${i}`),
42
+ ],
43
+
14
44
  plugins: [
15
45
  typography(),
16
46
  utilities.outlinesForFocus,
package/cli/.eslintrc.js DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * @type {import("eslint").Linter.Config}
3
- */
4
- module.exports = {
5
- parser: '@typescript-eslint/parser',
6
-
7
- parserOptions: {
8
- ecmaVersion: 2020,
9
- sourceType: 'module',
10
- },
11
- extends: [
12
- 'plugin:@typescript-eslint/recommended',
13
-
14
- 'prettier',
15
- 'plugin:prettier/recommended',
16
- ],
17
- rules: {},
18
- }
package/cli/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,3 +0,0 @@
1
- # Command Reference for girassol
2
-
3
- TODO: Add your command reference here
@@ -1,47 +0,0 @@
1
- # Plugin guide for girassol
2
-
3
- Plugins allow you to add features to girassol, such as commands and
4
- extensions to the `toolbox` object that provides the majority of the functionality
5
- used by girassol.
6
-
7
- Creating a girassol plugin is easy. Just create a repo with two folders:
8
-
9
- ```
10
- commands/
11
- extensions/
12
- ```
13
-
14
- A command is a file that looks something like this:
15
-
16
- ```js
17
- // commands/foo.js
18
-
19
- module.exports = {
20
- run: (toolbox) => {
21
- const { print, filesystem } = toolbox
22
-
23
- const desktopDirectories = filesystem.subdirectories(`~/Desktop`)
24
- print.info(desktopDirectories)
25
- }
26
- }
27
- ```
28
-
29
- An extension lets you add additional features to the `toolbox`.
30
-
31
- ```js
32
- // extensions/bar-extension.js
33
-
34
- module.exports = (toolbox) => {
35
- const { print } = toolbox
36
-
37
- toolbox.bar = () => { print.info('Bar!') }
38
- }
39
- ```
40
-
41
- This is then accessible in your plugin's commands as `toolbox.bar`.
42
-
43
- # Loading a plugin
44
-
45
- To load a particular plugin (which has to start with `girassol-*`),
46
- install it to your project using `npm install --save-dev girassol-PLUGINNAME`,
47
- and girassol will pick it up automatically.
package/cli/package.json DELETED
@@ -1,53 +0,0 @@
1
- {
2
- "name": "girassol",
3
- "version": "0.0.1",
4
- "description": "girassol CLI",
5
- "private": true,
6
- "types": "build/types/types.d.ts",
7
- "bin": {
8
- "girassol": "bin/girassol"
9
- },
10
- "scripts": {
11
- "clean-build": "rm -rf ./build",
12
- "compile": "tsc -p .",
13
- "copy-templates": "copyfiles ./src/templates/* ./build/templates",
14
- "build": "yarn clean-build && yarn compile && yarn copy-templates",
15
- "prepublishOnly": "yarn build",
16
- "format": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix && prettier \"**/*.{js,jsx,ts,tsx,json}\" --write"
17
- },
18
- "files": [
19
- "build",
20
- "LICENSE",
21
- "readme.md",
22
- "docs",
23
- "bin"
24
- ],
25
- "license": "MIT",
26
- "dependencies": {
27
- "gluegun": "latest"
28
- },
29
- "devDependencies": {
30
- "@types/node": "^12.7.11",
31
- "@typescript-eslint/eslint-plugin": "^4.17.0",
32
- "@typescript-eslint/parser": "^4.17.0",
33
- "ts-node": "^9.1.1",
34
- "typescript": "^4.2.3",
35
- "copyfiles": "^2.4.1",
36
- "eslint": "^7.22.0",
37
- "eslint-config-prettier": "^8.1.0",
38
- "eslint-plugin-prettier": "^3.3.1",
39
- "husky": "^5.1.3",
40
- "prettier": "^2.2.1",
41
- "pretty-quick": "^3.1.0"
42
- },
43
-
44
- "prettier": {
45
- "semi": false,
46
- "singleQuote": true
47
- },
48
- "husky": {
49
- "hooks": {
50
- "pre-commit": "pretty-quick --staged"
51
- }
52
- }
53
- }
package/cli/readme.md DELETED
@@ -1,26 +0,0 @@
1
- # girassol CLI
2
-
3
- A CLI for girassol.
4
-
5
- ## Customizing your CLI
6
-
7
- Check out the documentation at https://github.com/infinitered/gluegun/tree/master/docs.
8
-
9
- ## Publishing to NPM
10
-
11
- To package your CLI up for NPM, do this:
12
-
13
- ```shell
14
- $ npm login
15
- $ npm whoami
16
- $ npm test
17
-
18
- $ npm run build
19
-
20
- $ npm publish
21
- ```
22
-
23
- # License
24
-
25
- MIT - see LICENSE
26
-
package/cli/src/cli.ts DELETED
@@ -1,25 +0,0 @@
1
- import { build } from 'gluegun'
2
-
3
- /**
4
- * Create the cli and kick it off
5
- */
6
- async function run(argv) {
7
- // create a CLI runtime
8
- const cli = build()
9
- .brand('girassol')
10
- .src(__dirname)
11
- .plugins('./node_modules', { matching: 'girassol-*', hidden: true })
12
- .help() // provides default for help, h, --help, -h
13
- .version() // provides default for version, v, --version, -v
14
- .create()
15
- // enable the following method if you'd like to skip loading one of these core extensions
16
- // this can improve performance if they're not necessary for your project:
17
- // .exclude(['meta', 'strings', 'print', 'filesystem', 'semver', 'system', 'prompt', 'http', 'template', 'patching', 'package-manager'])
18
- // and run it
19
- const toolbox = await cli.run(argv)
20
-
21
- // send it back (for testing, mostly)
22
- return toolbox
23
- }
24
-
25
- module.exports = { run }
@@ -1,93 +0,0 @@
1
- import type { GluegunToolbox } from 'gluegun'
2
- import { resolve } from 'path'
3
- const COMPONENTS_PATH_GIRASSOL = resolve(__dirname, '../../../src/components')
4
-
5
- const pascalToKebab = (str: string) =>
6
- str.replace(
7
- /[A-Z]/g,
8
- (letter, match) => `${match !== 0 ? '-' : ''}${letter.toLowerCase()}`
9
- )
10
-
11
- module.exports = {
12
- name: 'create:component',
13
- description: 'Create a component, unit test and docs file',
14
- run: async (toolbox: GluegunToolbox) => {
15
- const {
16
- prompt,
17
- template,
18
- parameters,
19
- print: { highlight, info, success, error },
20
- } = toolbox
21
-
22
- const askFolder = {
23
- type: 'input',
24
- name: 'folder',
25
- message: 'Gostaria de criar dentro de alguma pasta?',
26
- hint: 'forms | forms/specials',
27
- }
28
-
29
- const askName = {
30
- type: 'input',
31
- name: 'name',
32
- initial: parameters.string,
33
- message: 'Qual o nome do componente?',
34
- hint: 'Textfield | Button',
35
- }
36
-
37
- const { folder, name } = await prompt.ask([askFolder, askName])
38
-
39
- const path = folder.endsWith('/')
40
- ? `${folder}${pascalToKebab(name)}`
41
- : `${folder}/${pascalToKebab(name)}`
42
-
43
- const fullPath = `${COMPONENTS_PATH_GIRASSOL}/${path}/`
44
-
45
- console.log(folder, name)
46
-
47
- info('Isto ira criar:')
48
-
49
- highlight(`
50
- components/
51
- ├── ${path}
52
- └── ${name}.vue
53
- └── ${pascalToKebab(name)}.spec.ts
54
- └── ${name}.stories.mdx
55
- └── index.ts
56
- `)
57
-
58
- try {
59
- const canWrite = await prompt.confirm('Esta configuração esta correta?')
60
-
61
- if (canWrite) {
62
- info('Gerando arquivos...')
63
- await template.generate({
64
- props: { name, folder, nameClass: pascalToKebab(name) },
65
- template: 'components/component.vue.ejs',
66
- target: `${fullPath}${name}.vue`,
67
- })
68
-
69
- await template.generate({
70
- props: { name, folder, nameClass: pascalToKebab(name) },
71
- template: 'components/component.spec.ts.ejs',
72
- target: `${fullPath}${pascalToKebab(name)}.spec.ts`,
73
- })
74
-
75
- await template.generate({
76
- props: { name, folder, nameClass: pascalToKebab(name) },
77
- template: 'components/component.stories.mdx.ejs',
78
- target: `${fullPath}${name}.stories.mdx`,
79
- })
80
-
81
- await template.generate({
82
- props: { name },
83
- template: 'components/index.ts.ejs',
84
- target: `${fullPath}index.ts`,
85
- })
86
-
87
- success('Arquivos gerados com sucesso!')
88
- }
89
- } catch (er) {
90
- error('Error inesperado')
91
- }
92
- },
93
- }