@solfacil/girassol 0.1.7 → 0.1.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 (64) hide show
  1. package/.vscode/settings.json +1 -0
  2. package/README.md +46 -3
  3. package/cli/bin/{girassol → girassol-cli} +0 -0
  4. package/cli/build/cli.js +68 -0
  5. package/cli/build/commands/create:component.js +124 -0
  6. package/cli/build/commands/generate:plugin.js +89 -0
  7. package/cli/build/commands/generate:types.js +76 -0
  8. package/cli/build/commands/girassol-cli.js +52 -0
  9. package/cli/build/extensions/cli-extension.js +17 -0
  10. package/cli/build/templates/components.d.ts.ejs +1 -0
  11. package/cli/build/templates/nuxt-plugin.ejs +8 -0
  12. package/cli/build/templates/vue-plugin.ejs +5 -0
  13. package/cli/{src → build}/templates/windi.config.ts.ejs +0 -0
  14. package/cli/build/types/cli.d.ts +1 -0
  15. package/cli/build/types/commands/create:component.d.ts +1 -0
  16. package/cli/build/types/commands/generate:plugin.d.ts +1 -0
  17. package/cli/build/types/commands/generate:types.d.ts +7 -0
  18. package/cli/build/types/commands/girassol-cli.d.ts +1 -0
  19. package/cli/build/types/extensions/cli-extension.d.ts +1 -0
  20. package/cli/build/types/types.d.ts +0 -0
  21. package/cli/build/types.js +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 +21 -0
  30. package/dist/components.json +1 -0
  31. package/dist/girassol.es.js +283 -198
  32. package/dist/girassol.umd.js +5 -5
  33. package/dist/style.css +1 -1
  34. package/dist/types/components/dropdown/Dropdown.vue.d.ts +4 -0
  35. package/dist/types/components/forms/select/Select.vue.d.ts +6 -5
  36. package/dist/types/components/informations/chip/Chip.vue.d.ts +41 -0
  37. package/dist/types/components/informations/chip/chip.spec.d.ts +1 -0
  38. package/dist/types/components/informations/chip/index.d.ts +2 -0
  39. package/dist/types/index.d.ts +841 -2
  40. package/dist/vite-modules/generate-component-types.d.ts +3 -0
  41. package/package.json +45 -22
  42. package/vite.config.ts +4 -0
  43. package/cli/.eslintrc.js +0 -18
  44. package/cli/LICENSE +0 -21
  45. package/cli/docs/commands.md +0 -3
  46. package/cli/docs/plugins.md +0 -47
  47. package/cli/package.json +0 -53
  48. package/cli/readme.md +0 -26
  49. package/cli/src/cli.ts +0 -25
  50. package/cli/src/commands/create:component.ts +0 -91
  51. package/cli/src/commands/generate:plugin.ts +0 -68
  52. package/cli/src/commands/generate:types.ts +0 -38
  53. package/cli/src/commands/girassol.ts +0 -12
  54. package/cli/src/extensions/cli-extension.ts +0 -17
  55. package/cli/src/templates/components/component.spec.ts.ejs +0 -20
  56. package/cli/src/templates/components/component.stories.mdx.ejs +0 -74
  57. package/cli/src/templates/components/component.vue.ejs +0 -23
  58. package/cli/src/templates/components/index.ts.ejs +0 -10
  59. package/cli/src/templates/components.d.ts.ejs +0 -10
  60. package/cli/src/templates/nuxt-plugin.ejs +0 -7
  61. package/cli/src/templates/vue-plugin.ejs +0 -5
  62. package/cli/src/types.ts +0 -1
  63. package/cli/tsconfig.json +0 -28
  64. 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;
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.7",
4
+ "version": "0.1.10",
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,45 +37,57 @@
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",
47
- "build-storybook": "build-storybook"
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",
55
+ "prepare": "husky install",
56
+ "commit": "cz",
57
+ "pre-commit": "./.husky/run-staged-tests.js"
48
58
  },
49
59
  "dependencies": {
50
- "@vueuse/core": "^8.5.0",
51
- "vue": "^3.2.36"
60
+ "@vueuse/core": "^8.6.0",
61
+ "gluegun": "latest",
62
+ "vue": "^3.2.37"
52
63
  },
53
64
  "devDependencies": {
54
65
  "@antfu/eslint-config": "^0.23.1",
55
- "@babel/core": "^7.17.9",
56
- "@babel/preset-env": "^7.16.11",
57
- "@iconify/json": "^2.1.28",
58
- "@storybook/addon-a11y": "^6.5.3",
59
- "@storybook/addon-actions": "^6.5.3",
60
- "@storybook/addon-essentials": "^6.5.3",
61
- "@storybook/addon-links": "^6.5.3",
66
+ "@babel/core": "^7.18.2",
67
+ "@babel/preset-env": "^7.18.2",
68
+ "@commitlint/cli": "^17.0.2",
69
+ "@commitlint/config-conventional": "^17.0.2",
70
+ "@iconify/json": "^2.1.57",
71
+ "@storybook/addon-a11y": "^6.5.5",
72
+ "@storybook/addon-actions": "^6.5.5",
73
+ "@storybook/addon-essentials": "^6.5.5",
74
+ "@storybook/addon-links": "^6.5.5",
62
75
  "@storybook/builder-vite": "^0.1.35",
63
- "@storybook/theming": "^6.5.3",
64
- "@storybook/vue3": "^6.5.3",
76
+ "@storybook/theming": "^6.5.5",
77
+ "@storybook/vue3": "^6.5.5",
65
78
  "@testing-library/jest-dom": "^5.16.4",
66
79
  "@testing-library/user-event": "^14.2.0",
67
80
  "@testing-library/vue": "^6.5.1",
68
81
  "@types/jest-axe": "^3.5.3",
69
- "@types/node": "^17.0.24",
70
- "@typescript-eslint/eslint-plugin": "^5.25.0",
71
- "@typescript-eslint/parser": "^5.25.0",
82
+ "@types/node": "^17.0.35",
83
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
84
+ "@typescript-eslint/parser": "^5.26.0",
72
85
  "@vitejs/plugin-vue": "^2.3.3",
73
86
  "babel-loader": "^8.2.5",
74
- "c8": "^7.11.0",
87
+ "c8": "^7.11.3",
88
+ "cli-spinner": "^0.2.10",
89
+ "commitizen": "^4.2.4",
90
+ "copyfiles": "^2.4.1",
75
91
  "critters": "^0.0.16",
76
92
  "eslint": "^8.14.0",
77
93
  "eslint-config-prettier": "^8.5.0",
@@ -79,6 +95,7 @@
79
95
  "eslint-plugin-prettier": "^4.0.0",
80
96
  "eslint-plugin-vue": "^8.7.1",
81
97
  "eslint-plugin-vuejs-accessibility": "^1.1.1",
98
+ "husky": "^8.0.1",
82
99
  "jest-axe": "^5.0.1",
83
100
  "jsdom": "^19.0.0",
84
101
  "sass": "^1.50.0",
@@ -87,6 +104,7 @@
87
104
  "stylelint-config-prettier": "^9.0.3",
88
105
  "stylelint-config-property-sort-order-smacss": "^9.0.0",
89
106
  "stylelint-order": "^5.0.0",
107
+ "ts-node": "^10.8.1",
90
108
  "typescript": "^4.6.3",
91
109
  "unplugin-icons": "^0.14.3",
92
110
  "vite": "^2.9.9",
@@ -112,5 +130,10 @@
112
130
  "vue.js",
113
131
  "nuxt",
114
132
  "nuxt 3"
115
- ]
116
- }
133
+ ],
134
+ "config": {
135
+ "commitizen": {
136
+ "path": "./node_modules/cz-conventional-changelog"
137
+ }
138
+ }
139
+ }
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/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,91 +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
- print: { highlight, info, success, error },
19
- } = toolbox
20
-
21
- const askFolder = {
22
- type: 'input',
23
- name: 'folder',
24
- message: 'Gostaria de criar dentro de alguma pasta?',
25
- hint: 'forms | forms/specials',
26
- }
27
-
28
- const askName = {
29
- type: 'input',
30
- name: 'name',
31
- message: 'Qual o nome do componente?',
32
- hint: 'Textfield | Button',
33
- }
34
-
35
- const { folder, name } = await prompt.ask([askFolder, askName])
36
-
37
- const path = folder.endsWith('/')
38
- ? `${folder}${pascalToKebab(name)}`
39
- : `${folder}/${pascalToKebab(name)}`
40
-
41
- const fullPath = `${COMPONENTS_PATH_GIRASSOL}/${path}/`
42
-
43
- console.log(folder, name)
44
-
45
- info('Isto ira criar:')
46
-
47
- highlight(`
48
- components/
49
- ├── ${path}
50
- └── ${name}.vue
51
- └── ${pascalToKebab(name)}.spec.ts
52
- └── ${name}.stories.mdx
53
- └── index.ts
54
- `)
55
-
56
- try {
57
- const canWrite = await prompt.confirm('Esta configuração esta correta?')
58
-
59
- if (canWrite) {
60
- info('Gerando arquivos...')
61
- await template.generate({
62
- props: { name, folder, nameClass: pascalToKebab(name) },
63
- template: 'components/component.vue.ejs',
64
- target: `${fullPath}${name}.vue`,
65
- })
66
-
67
- await template.generate({
68
- props: { name, folder, nameClass: pascalToKebab(name) },
69
- template: 'components/component.spec.ts.ejs',
70
- target: `${fullPath}${pascalToKebab(name)}.spec.ts`,
71
- })
72
-
73
- await template.generate({
74
- props: { name, folder, nameClass: pascalToKebab(name) },
75
- template: 'components/component.stories.mdx.ejs',
76
- target: `${fullPath}${name}.stories.mdx`,
77
- })
78
-
79
- await template.generate({
80
- props: { name },
81
- template: 'components/index.ts.ejs',
82
- target: `${fullPath}index.ts`,
83
- })
84
-
85
- success('Arquivos gerados com sucesso!')
86
- }
87
- } catch (er) {
88
- error('Error inesperado')
89
- }
90
- },
91
- }
@@ -1,68 +0,0 @@
1
- import type { GluegunToolbox } from 'gluegun'
2
- const RELATIVE_ROOT_PROJECT = './'
3
-
4
- import { componentsNames } from '../../../dist/girassol.umd'
5
-
6
- module.exports = {
7
- name: 'generate:plugin',
8
- description: 'Setting girassol global plugin to nuxt/vue',
9
- run: async (toolbox: GluegunToolbox) => {
10
- const {
11
- parameters,
12
- template,
13
- print: { info, spin, highlight },
14
- } = toolbox
15
-
16
- if (parameters?.options?.nuxt) {
17
- const spinnerPlugin = spin('Setting plugin')
18
-
19
- await template.generate({
20
- template: 'nuxt-plugin.ejs',
21
- target: `${RELATIVE_ROOT_PROJECT}/plugins/girassol.ts`,
22
- })
23
-
24
- spinnerPlugin.succeed(`Plugin created in [/plugins/girassol.ts]!`)
25
- const spinnerTypes = spin('Setting types')
26
-
27
- await template.generate({
28
- props: { componentsNames },
29
- template: 'components.d.ts.ejs',
30
- target: `${RELATIVE_ROOT_PROJECT}components.d.ts`,
31
- })
32
-
33
- spinnerTypes.succeed('Global types created in [/components.d.ts]!')
34
- } else {
35
- const spinnerPlugin = spin('Setting plugin')
36
-
37
- await template.generate({
38
- template: 'vue-plugin.ejs',
39
- target: `${RELATIVE_ROOT_PROJECT}/src/plugins/girassol.ts`,
40
- })
41
-
42
- spinnerPlugin.succeed(`Plugin created in [/src/plugins/girassol.ts]!`)
43
-
44
- const spinnerTypes = spin('Setting types')
45
-
46
- await template.generate({
47
- props: { componentsNames },
48
- template: 'components.d.ts.ejs',
49
- target: `${RELATIVE_ROOT_PROJECT}/src/components.d.ts`,
50
- })
51
-
52
- spinnerTypes.succeed('Global types created in [/src/components.d.ts]!')
53
-
54
- info('Please, add command below to src/main.ts')
55
- highlight(`import girassol from 'plugins/girassol'`)
56
- highlight(`createApp(App).use(girassol)`)
57
- }
58
-
59
- const spinnerWindi = spin('Setting plugin')
60
-
61
- await template.generate({
62
- template: 'windi.config.ts.ejs',
63
- target: `${RELATIVE_ROOT_PROJECT}/windi.config.ts`,
64
- })
65
-
66
- spinnerWindi.succeed(`Windicss config created in [/windi.config.ts]!`)
67
- },
68
- }
@@ -1,38 +0,0 @@
1
- import type { GluegunToolbox } from 'gluegun'
2
- const RELATIVE_ROOT_PROJECT = './'
3
-
4
- import { componentsNames } from '../../../dist/girassol.umd'
5
-
6
- module.exports = {
7
- name: 'generate:plugin',
8
- description: 'Setting girassol global plugin to nuxt/vue',
9
- run: async (toolbox: GluegunToolbox) => {
10
- const {
11
- parameters,
12
- template,
13
- print: { spin },
14
- } = toolbox
15
-
16
- if (parameters?.options?.nuxt) {
17
- const spinnerTypes = spin('Setting types')
18
-
19
- await template.generate({
20
- props: { componentsNames },
21
- template: 'components.d.ts.ejs',
22
- target: `${RELATIVE_ROOT_PROJECT}components.d.ts`,
23
- })
24
-
25
- spinnerTypes.succeed(`Global types created in [/components.d.ts]!`)
26
- } else {
27
- const spinnerTypes = spin('Setting types')
28
-
29
- await template.generate({
30
- props: { componentsNames },
31
- template: 'components.d.ts.ejs',
32
- target: `${RELATIVE_ROOT_PROJECT}/src/components.d.ts`,
33
- })
34
-
35
- spinnerTypes.succeed('Global types created in [/src/components.d.ts]!')
36
- }
37
- },
38
- }
@@ -1,12 +0,0 @@
1
- import type { GluegunCommand } from 'gluegun'
2
-
3
- const command: GluegunCommand = {
4
- name: 'girassol',
5
- run: async (toolbox) => {
6
- const { print } = toolbox
7
-
8
- print.info('Welcome Girassol CLI')
9
- },
10
- }
11
-
12
- module.exports = command
@@ -1,17 +0,0 @@
1
- import type { GluegunToolbox } from 'gluegun'
2
-
3
- // add your CLI-specific functionality here, which will then be accessible
4
- // to your commands
5
- module.exports = (toolbox: GluegunToolbox) => {
6
- toolbox.foo = () => {
7
- toolbox.print.info('called foo extension')
8
- }
9
-
10
- // enable this if you want to read configuration in from
11
- // the current folder's package.json (in a "girassol" property),
12
- // girassol.config.json, etc.
13
- // toolbox.config = {
14
- // ...toolbox.config,
15
- // ...toolbox.config.loadConfig("girassol", process.cwd())
16
- // }
17
- }
@@ -1,20 +0,0 @@
1
- import '@testing-library/jest-dom'
2
- import userEvent from '@testing-library/user-event'
3
-
4
- import { render, screen } from '@testing-library/vue'
5
-
6
- import <%- props.name %> from './<%- props.name %>.vue'
7
-
8
- describe('[<%- props.folder %>] <%- props.name %>', () => {
9
- it('Renders text <%- props.name %> pass by label prop', () => {
10
- const label = 'awesome!'
11
-
12
- render(<%- props.name %>, {
13
- props: {
14
- label
15
- },
16
- })
17
-
18
- screen.getByText(label)
19
- })
20
- })
@@ -1,74 +0,0 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs'
2
- import { withDesign } from 'storybook-addon-designs'
3
-
4
- import <%- props.name %> from './<%- props.name %>.vue'
5
-
6
- <Meta
7
- title="Componentes/<%- props.folder %>/<%- props.name %>"
8
- component={<%- props.name %>}
9
- decorators={[withDesign]}
10
- parameters={{
11
- design: {
12
- type: 'figma',
13
- url: '',
14
- },
15
- }}
16
- argTypes={{
17
- label: 'hi!'
18
- }}
19
- />
20
-
21
- export const Template = ({ label,...args }) => ({
22
- components: { <%- props.name %> },
23
- setup() {
24
- return { args, label }
25
- },
26
- template: `<<%- props.name %> v-bind="args" id="teste"></<%- props.name %>>`,
27
- })
28
-
29
- # <%- props.name %>
30
-
31
- ## Melhores praticas
32
-
33
-
34
- ## Acessibilidade
35
-
36
-
37
- ## Importar localmente
38
-
39
- ```js dark
40
- import { Sol<%- props.name %> } from '@solfacil/girassol'
41
- ```
42
-
43
- ## Variants
44
- <Canvas>
45
- <Story
46
- name="Default"
47
- args={{
48
- label: 'default',
49
- }}
50
- >
51
- {Template.bind({})}
52
- </Story>
53
- </Canvas>
54
-
55
- ## Exemplos de uso
56
-
57
- ```html dark
58
- <Sol<%- props.name %> id="just-test">Awesome component!</Sol<%- props.name %>>
59
- ```
60
-
61
- ## Playground
62
-
63
- <Canvas>
64
- <Story
65
- name="Playground"
66
- args={{
67
- label: 'its work fine!',
68
- }}
69
- >
70
- {Template.bind({})}
71
- </Story>
72
- </Canvas>
73
-
74
- <ArgsTable story="Playground" />