@jobber/generators 0.6.1-pre.28 → 0.7.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/CHANGELOG.md +11 -0
- package/index.js +30 -1
- package/package.json +2 -2
- package/templates/component/{{name}}.stories.{{mdx}} +99 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,17 @@ menu: Changelog
|
|
|
8
8
|
All notable changes to this project will be documented in this file.
|
|
9
9
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
10
10
|
|
|
11
|
+
# [0.7.0](https://github.com/GetJobber/atlantis/compare/@jobber/generators@0.6.0...@jobber/generators@0.7.0) (2023-02-23)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **generators:** JOB-62646 Update generator to create storybook file ([#1063](https://github.com/GetJobber/atlantis/issues/1063)) ([7347292](https://github.com/GetJobber/atlantis/commit/734729221c8c6331ddbfbb5b84692a504b270e67))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
11
22
|
# [0.6.0](https://github.com/GetJobber/atlantis/compare/@jobber/generators@0.5.1...@jobber/generators@0.6.0) (2023-02-07)
|
|
12
23
|
|
|
13
24
|
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ module.exports = function (plop, config) {
|
|
|
7
7
|
const { basePath, templateGlob } = Object.assign(
|
|
8
8
|
{
|
|
9
9
|
basePath: "packages/components/src",
|
|
10
|
-
templateGlob: "
|
|
10
|
+
templateGlob: "!(*.stories.*)",
|
|
11
11
|
},
|
|
12
12
|
config || {},
|
|
13
13
|
);
|
|
@@ -30,6 +30,23 @@ module.exports = function (plop, config) {
|
|
|
30
30
|
default: basePath,
|
|
31
31
|
directoryOnly: true,
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
type: "expand",
|
|
35
|
+
name: "storybook",
|
|
36
|
+
message: "Create Storybook mdx?",
|
|
37
|
+
choices: [
|
|
38
|
+
{
|
|
39
|
+
key: "y",
|
|
40
|
+
name: "Yes",
|
|
41
|
+
value: "yes",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: "n",
|
|
45
|
+
name: "No",
|
|
46
|
+
value: "no",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
33
50
|
],
|
|
34
51
|
actions: [
|
|
35
52
|
/**
|
|
@@ -46,6 +63,18 @@ module.exports = function (plop, config) {
|
|
|
46
63
|
base: "templates/component",
|
|
47
64
|
templateFiles: `templates/component/${templateGlob}`,
|
|
48
65
|
},
|
|
66
|
+
{
|
|
67
|
+
type: "addMany",
|
|
68
|
+
destination: `{{path}}/{{name}}/`,
|
|
69
|
+
base: "templates/component",
|
|
70
|
+
templateFiles: `templates/component/*.stories.*`,
|
|
71
|
+
skip(data) {
|
|
72
|
+
if (data.storybook !== "yes") {
|
|
73
|
+
return "Not adding storybook file";
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
},
|
|
77
|
+
},
|
|
49
78
|
],
|
|
50
79
|
});
|
|
51
80
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/generators",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"inquirer-path": "^1.0.0-beta5"
|
|
9
9
|
},
|
|
10
|
-
"gitHead": "
|
|
10
|
+
"gitHead": "80ab88b320ffbb94af1dfd20c055ebd771c4bcaa"
|
|
11
11
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ArgsTable, Canvas, Meta, Story } from "@storybook/addon-docs";
|
|
2
|
+
import { {{name}} } from ".";
|
|
3
|
+
import { Figma } from "storybook-addon-designs/blocks";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# {{ titleCase name }}
|
|
7
|
+
|
|
8
|
+
<Meta title="Components/{{ name }}" component={ {{ name }} } />
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { {{ name }} } from "@jobber/components/{{ name }}";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
<Canvas>
|
|
15
|
+
<Story name="{{ name }}" args={ { "text": "Bob"} }>
|
|
16
|
+
{args => <{{ name }} {...args} />}
|
|
17
|
+
</Story>
|
|
18
|
+
</Canvas>
|
|
19
|
+
|
|
20
|
+
<!--
|
|
21
|
+
INTERFACE: This is for the proposal stage of the component
|
|
22
|
+
|
|
23
|
+
Provide an example of what the component looks like in code. How would you use
|
|
24
|
+
it from another React component? This should consist primarily of code blocks.
|
|
25
|
+
This section can be deleted once the component is built, when the Playground
|
|
26
|
+
will demonstrate this at a higher fidelity.
|
|
27
|
+
-->
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
<ArgsTable of={ {{ name }} } story="{{ name }}" />
|
|
32
|
+
|
|
33
|
+
<!--
|
|
34
|
+
It is not necessary to provide an example of each prop. Use usage examples to
|
|
35
|
+
highlight key features of a component or particular considerations.
|
|
36
|
+
|
|
37
|
+
See `Button.mdx` for a good example of this.
|
|
38
|
+
-->
|
|
39
|
+
|
|
40
|
+
## Usage guidelines
|
|
41
|
+
|
|
42
|
+
The `<{{name}}>` will... _Add a brief description of the component_
|
|
43
|
+
|
|
44
|
+
<!--
|
|
45
|
+
What is the design purpose of this component? How do its responsibilities
|
|
46
|
+
relate to other components? What should this component not be used for? What
|
|
47
|
+
are some related components in Atlantis? Try to describe this component not
|
|
48
|
+
in terms of what it looks like or what elements make it up, but what function
|
|
49
|
+
it performs or how it enables a user to perform tasks (e.g. “Buttons allow users
|
|
50
|
+
to initiate, complete, and reverse actions.” vs “Buttons are rectangular elements
|
|
51
|
+
that have a green background and white text”).
|
|
52
|
+
-->
|
|
53
|
+
|
|
54
|
+
## Content guidelines
|
|
55
|
+
|
|
56
|
+
<!--
|
|
57
|
+
What type of content does this component present (documents, text, images, other components)?
|
|
58
|
+
What is the recommended, or expected, amount of content? What is the components’ behaviour when
|
|
59
|
+
the provided content diverges from what is expected (image aspect ratio, amount of text, video
|
|
60
|
+
vs audio, filesize)? Are there any important references to the [Product Vocabulary](https://atlantis.getjobber.com/guides/product-vocabulary)
|
|
61
|
+
that should be made regarding this component? What happens when content is unavailable or unreliable
|
|
62
|
+
(poor connection, empty states, flaky GPS data?)
|
|
63
|
+
-->
|
|
64
|
+
|
|
65
|
+
## Accessibility
|
|
66
|
+
|
|
67
|
+
<!--
|
|
68
|
+
Describe the accessibility concerns for the component. How does it handle touch vs cursor vs
|
|
69
|
+
keyboard events? Should it capture input? What should a screen reader see when it's focuse?
|
|
70
|
+
-->
|
|
71
|
+
|
|
72
|
+
## Responsiveness
|
|
73
|
+
|
|
74
|
+
<!--
|
|
75
|
+
How should the component behave on an iPhone 8? An iPad? A 1920x1080 monitor? How does the
|
|
76
|
+
component appear when the component itself is less than 375px wide? Less than 640px wide?
|
|
77
|
+
Less than 1200px wide? Greater than 1200px? Does it change when the device DPI is higher
|
|
78
|
+
or lower?
|
|
79
|
+
-->
|
|
80
|
+
|
|
81
|
+
## Mockup
|
|
82
|
+
|
|
83
|
+
<Figma collapsable />
|
|
84
|
+
|
|
85
|
+
<!--
|
|
86
|
+
Insert a Figma mockup from the [Design System Contribution template](https://www.figma.com/file/3BXCXXD9glMtj8RAHjXiQC/Design-System-Contribution-TEMPLATE?node-id=26%3A2)
|
|
87
|
+
that conveys the visual design of the component, with variants and state accounted for.
|
|
88
|
+
Consider progressive enhancement; might this rely on newer browser features that aren’t
|
|
89
|
+
widely supported yet?
|
|
90
|
+
-->
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
<!--
|
|
95
|
+
What decisions worth remembering have gone into this component? Did we consider any potentially valuable
|
|
96
|
+
functionality that we’re not implementing right now for scope purposes? Are there any design decisions
|
|
97
|
+
that might need explaining beyond the usage guidelines? This will help consumers understand this component
|
|
98
|
+
more fully.
|
|
99
|
+
-->
|