@solfacil/girassol 0.1.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.
- package/.vscode/extensions.json +17 -0
- package/.vscode/settings.json +21 -0
- package/README.md +15 -0
- package/cli/.eslintrc.js +18 -0
- package/cli/LICENSE +21 -0
- package/cli/__tests__/cli-integration.test.ts +29 -0
- package/cli/bin/girassol +21 -0
- package/cli/docs/commands.md +3 -0
- package/cli/docs/plugins.md +47 -0
- package/cli/package.json +63 -0
- package/cli/readme.md +26 -0
- package/cli/src/cli.ts +25 -0
- package/cli/src/commands/generate:plugin.ts +58 -0
- package/cli/src/commands/generate:types.ts +37 -0
- package/cli/src/commands/girassol.ts +12 -0
- package/cli/src/extensions/cli-extension.ts +17 -0
- package/cli/src/templates/components.d.ts.ejs +10 -0
- package/cli/src/templates/nuxt-plugin.ejs +7 -0
- package/cli/src/templates/vue-plugin.ejs +5 -0
- package/cli/src/types.ts +1 -0
- package/cli/tsconfig.json +28 -0
- package/cli/yarn.lock +4633 -0
- package/dist/favicon.ico +0 -0
- package/dist/fonts/lato/Lato-Bold.ttf +0 -0
- package/dist/fonts/lato/Lato-Medium.ttf +0 -0
- package/dist/fonts/lato/Lato-Regular.ttf +0 -0
- package/dist/fonts/roboto-slab/RobotoSlab.ttf +0 -0
- package/dist/fonts/rubik/Rubik-Bold.ttf +0 -0
- package/dist/fonts/rubik/Rubik-Medium.ttf +0 -0
- package/dist/fonts/rubik/Rubik-Regular.ttf +0 -0
- package/dist/girassol.es.js +508 -0
- package/dist/girassol.svg +3 -0
- package/dist/girassol.umd.js +5 -0
- package/dist/logo.svg +24 -0
- package/dist/main.css +41 -0
- package/dist/storybook.ico +0 -0
- package/dist/storybook.png +0 -0
- package/dist/storybook.svg +3 -0
- package/dist/style.css +1 -0
- package/dist/theme/solfacil/borders.d.ts +19 -0
- package/dist/theme/solfacil/colors.d.ts +39 -0
- package/dist/theme/solfacil/effects.d.ts +14 -0
- package/dist/theme/solfacil/index.d.ts +10 -0
- package/dist/theme/solfacil/miscs.d.ts +13 -0
- package/dist/theme/solfacil/spacing.d.ts +48 -0
- package/dist/theme/solfacil/typography.d.ts +42 -0
- package/dist/theme/solfacil/utilities.d.ts +1 -0
- package/dist/types/components/forms/button/Button.vue.d.ts +38 -0
- package/dist/types/components/forms/button/index.d.ts +2 -0
- package/dist/types/components/forms/checkbox/Checkbox.vue.d.ts +30 -0
- package/dist/types/components/forms/checkbox/CheckboxGroup.vue.d.ts +51 -0
- package/dist/types/components/forms/checkbox/checkbox-type.d.ts +9 -0
- package/dist/types/components/forms/checkbox/index.d.ts +3 -0
- package/dist/types/components/forms/input/Input.vue.d.ts +25 -0
- package/dist/types/components/forms/input/index.d.ts +2 -0
- package/dist/types/components/forms/radio/Radio.vue.d.ts +30 -0
- package/dist/types/components/forms/radio/RadioGroup.vue.d.ts +51 -0
- package/dist/types/components/forms/radio/index.d.ts +3 -0
- package/dist/types/components/forms/radio/radio-type.d.ts +9 -0
- package/dist/types/components/forms/textfield/Textfield.vue.d.ts +45 -0
- package/dist/types/components/forms/textfield/TextfieldPassword.vue.d.ts +31 -0
- package/dist/types/components/forms/textfield/index.d.ts +3 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/windi.config.d.ts +2 -0
- package/package.json +82 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/lato/Lato-Bold.ttf +0 -0
- package/public/fonts/lato/Lato-Medium.ttf +0 -0
- package/public/fonts/lato/Lato-Regular.ttf +0 -0
- package/public/fonts/roboto-slab/RobotoSlab.ttf +0 -0
- package/public/fonts/rubik/Rubik-Bold.ttf +0 -0
- package/public/fonts/rubik/Rubik-Medium.ttf +0 -0
- package/public/fonts/rubik/Rubik-Regular.ttf +0 -0
- package/public/girassol.svg +3 -0
- package/public/logo.svg +24 -0
- package/public/main.css +41 -0
- package/public/storybook.ico +0 -0
- package/public/storybook.png +0 -0
- package/public/storybook.svg +3 -0
- package/theme/solfacil/borders.ts +20 -0
- package/theme/solfacil/colors.ts +43 -0
- package/theme/solfacil/effects.ts +15 -0
- package/theme/solfacil/index.ts +22 -0
- package/theme/solfacil/miscs.ts +14 -0
- package/theme/solfacil/spacing.ts +56 -0
- package/theme/solfacil/typography.ts +51 -0
- package/theme/solfacil/utilities.ts +15 -0
- package/vite.config.ts +64 -0
- package/windi.config.ts +30 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"antfu.vite",
|
|
4
|
+
"johnsoncodehk.volar",
|
|
5
|
+
"dbaeumer.vscode-eslint",
|
|
6
|
+
"voorjaar.windicss-intellisense",
|
|
7
|
+
"csstools.postcss",
|
|
8
|
+
"snyk-security.snyk-vulnerability-scanner",
|
|
9
|
+
"esbenp.prettier-vscode",
|
|
10
|
+
"vivaxy.vscode-conventional-commits",
|
|
11
|
+
"aaron-bond.better-comments",
|
|
12
|
+
"formulahendry.auto-close-tag",
|
|
13
|
+
"wix.vscode-import-cost",
|
|
14
|
+
"syler.sass-indented",
|
|
15
|
+
"streetsidesoftware.code-spell-checker"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": [
|
|
3
|
+
"antfu",
|
|
4
|
+
"attributify",
|
|
5
|
+
"solfacil",
|
|
6
|
+
"Solfácil",
|
|
7
|
+
"textfield",
|
|
8
|
+
"Textfield",
|
|
9
|
+
"vitejs",
|
|
10
|
+
"vueuse",
|
|
11
|
+
"windicss",
|
|
12
|
+
"theming",
|
|
13
|
+
"iconify",
|
|
14
|
+
"unplugin",
|
|
15
|
+
"esnext"
|
|
16
|
+
],
|
|
17
|
+
"prettier.enable": true,
|
|
18
|
+
"editor.codeActionsOnSave": {
|
|
19
|
+
"source.fixAll.eslint": true,
|
|
20
|
+
},
|
|
21
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/solfacil/components-ui/main/public/logo-solfacil-color.svg" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
Biblioteca de componentes
|
|
6
|
+
|
|
7
|
+
# Documentação
|
|
8
|
+
|
|
9
|
+
# Instalação
|
|
10
|
+
|
|
11
|
+
# Licença
|
|
12
|
+
|
|
13
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/npm/l/buefy.svg?logo=github" /></a>
|
|
14
|
+
|
|
15
|
+
Released under the MIT [License](https://opensource.org/licenses/MIT). Copyright (c) Solfácil.
|
package/cli/.eslintrc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { system, filesystem } from 'gluegun'
|
|
2
|
+
|
|
3
|
+
const src = filesystem.path(__dirname, '..')
|
|
4
|
+
|
|
5
|
+
const cli = async (cmd) =>
|
|
6
|
+
system.run('node ' + filesystem.path(src, 'bin', 'girassol') + ` ${cmd}`)
|
|
7
|
+
|
|
8
|
+
test('outputs version', async () => {
|
|
9
|
+
const output = await cli('--version')
|
|
10
|
+
expect(output).toContain('0.0.1')
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('outputs help', async () => {
|
|
14
|
+
const output = await cli('--help')
|
|
15
|
+
expect(output).toContain('0.0.1')
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
test('generates file', async () => {
|
|
19
|
+
const output = await cli('generate foo')
|
|
20
|
+
|
|
21
|
+
expect(output).toContain('Generated file at models/foo-model.ts')
|
|
22
|
+
const foomodel = filesystem.read('models/foo-model.ts')
|
|
23
|
+
|
|
24
|
+
expect(foomodel).toContain(`module.exports = {`)
|
|
25
|
+
expect(foomodel).toContain(`name: 'foo'`)
|
|
26
|
+
|
|
27
|
+
// cleanup artifact
|
|
28
|
+
filesystem.remove('models')
|
|
29
|
+
})
|
package/cli/bin/girassol
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
// check if we're running in dev mode
|
|
6
|
+
var devMode = require('fs').existsSync(`${__dirname}/../src`)
|
|
7
|
+
// or want to "force" running the compiled version with --compiled-build
|
|
8
|
+
var wantsCompiled = process.argv.indexOf('--compiled-build') >= 0
|
|
9
|
+
|
|
10
|
+
if (wantsCompiled || !devMode) {
|
|
11
|
+
// this runs from the compiled javascript source
|
|
12
|
+
require(`${__dirname}/../build/cli`).run(process.argv)
|
|
13
|
+
} else {
|
|
14
|
+
// this runs from the typescript source (for dev only)
|
|
15
|
+
// hook into ts-node so we can run typescript on the fly
|
|
16
|
+
require('ts-node').register({ project: `${__dirname}/../tsconfig.json` })
|
|
17
|
+
// run the CLI with the current process arguments
|
|
18
|
+
require(`${__dirname}/../src/cli`).run(process.argv)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
"test": "jest",
|
|
18
|
+
"watch": "jest --watch",
|
|
19
|
+
"snapupdate": "jest --updateSnapshot",
|
|
20
|
+
"coverage": "jest --coverage"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"build",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"readme.md",
|
|
26
|
+
"docs",
|
|
27
|
+
"bin"
|
|
28
|
+
],
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"gluegun": "latest"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^12.7.11",
|
|
35
|
+
"@types/jest": "^26.0.20",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^4.17.0",
|
|
37
|
+
"@typescript-eslint/parser": "^4.17.0",
|
|
38
|
+
"ts-jest": "^26.5.3",
|
|
39
|
+
"ts-node": "^9.1.1",
|
|
40
|
+
"typescript": "^4.2.3",
|
|
41
|
+
"copyfiles": "^2.4.1",
|
|
42
|
+
"eslint": "^7.22.0",
|
|
43
|
+
"eslint-config-prettier": "^8.1.0",
|
|
44
|
+
"eslint-plugin-prettier": "^3.3.1",
|
|
45
|
+
"husky": "^5.1.3",
|
|
46
|
+
"jest": "^26.6.3",
|
|
47
|
+
"prettier": "^2.2.1",
|
|
48
|
+
"pretty-quick": "^3.1.0"
|
|
49
|
+
},
|
|
50
|
+
"jest": {
|
|
51
|
+
"preset": "ts-jest",
|
|
52
|
+
"testEnvironment": "node"
|
|
53
|
+
},
|
|
54
|
+
"prettier": {
|
|
55
|
+
"semi": false,
|
|
56
|
+
"singleQuote": true
|
|
57
|
+
},
|
|
58
|
+
"husky": {
|
|
59
|
+
"hooks": {
|
|
60
|
+
"pre-commit": "pretty-quick --staged"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
package/cli/readme.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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 }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { 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}components.d.ts`,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
spinnerPlugin.succeed('Plugin created!')
|
|
25
|
+
const spinnerTypes = spin('Setting types')
|
|
26
|
+
|
|
27
|
+
await template.generate({
|
|
28
|
+
template: 'components.d.ts.ejs',
|
|
29
|
+
target: `${RELATIVE_ROOT_PROJECT}components.d.ts`,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
spinnerTypes.succeed('Global types created!')
|
|
33
|
+
} else {
|
|
34
|
+
const spinnerPlugin = spin('Setting plugin')
|
|
35
|
+
|
|
36
|
+
await template.generate({
|
|
37
|
+
template: 'vue-plugin.ejs',
|
|
38
|
+
target: `${RELATIVE_ROOT_PROJECT}/src/plugins/girassol.ts`,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
spinnerPlugin.succeed('Plugin created!')
|
|
42
|
+
|
|
43
|
+
const spinnerTypes = spin('Setting types')
|
|
44
|
+
|
|
45
|
+
await template.generate({
|
|
46
|
+
template: 'components.d.ts.ejs',
|
|
47
|
+
props: { componentsNames },
|
|
48
|
+
target: `${RELATIVE_ROOT_PROJECT}/src/components.d.ts`,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
spinnerTypes.succeed('Global types created!')
|
|
52
|
+
|
|
53
|
+
info('Please, add command below to src/main.ts')
|
|
54
|
+
highlight(`import girassol from 'plugins/girassol'`)
|
|
55
|
+
highlight(`createApp(App).use(girassol)`)
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { 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
|
+
template: 'components.d.ts.ejs',
|
|
21
|
+
target: `${RELATIVE_ROOT_PROJECT}components.d.ts`,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
spinnerTypes.succeed('Global types created!')
|
|
25
|
+
} else {
|
|
26
|
+
const spinnerTypes = spin('Setting types')
|
|
27
|
+
|
|
28
|
+
await template.generate({
|
|
29
|
+
template: 'components.d.ts.ejs',
|
|
30
|
+
props: { componentsNames },
|
|
31
|
+
target: `${RELATIVE_ROOT_PROJECT}/src/components.d.ts`,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
spinnerTypes.succeed('Global types created!')
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { 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
|
+
}
|
package/cli/src/types.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// export types
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowSyntheticDefaultImports": false,
|
|
4
|
+
"experimentalDecorators": true,
|
|
5
|
+
"lib": [
|
|
6
|
+
"es2015",
|
|
7
|
+
"scripthost",
|
|
8
|
+
"es2015.promise",
|
|
9
|
+
"es2015.generator",
|
|
10
|
+
"es2015.iterable",
|
|
11
|
+
"dom"
|
|
12
|
+
],
|
|
13
|
+
"module": "commonjs",
|
|
14
|
+
"moduleResolution": "node",
|
|
15
|
+
"noImplicitAny": false,
|
|
16
|
+
"noImplicitThis": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"sourceMap": false,
|
|
19
|
+
"inlineSourceMap": true,
|
|
20
|
+
"outDir": "build",
|
|
21
|
+
"strict": false,
|
|
22
|
+
"target": "es5",
|
|
23
|
+
"declaration": true,
|
|
24
|
+
"declarationDir": "build/types"
|
|
25
|
+
},
|
|
26
|
+
"include": ["src/**/*"],
|
|
27
|
+
"exclude": ["node_modules"]
|
|
28
|
+
}
|