Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 813c7bf

Browse files
author
Eunjae Lee
authored
feat(templates): update README and LICENSE for widget templates (#459)
1 parent 25da57e commit 813c7bf

File tree

9 files changed

+380
-81
lines changed

9 files changed

+380
-81
lines changed

e2e/__snapshots__/templates.test.js.snap

Lines changed: 197 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,12 +3348,82 @@ yarn-error.log
33483348
dist/"
33493349
`;
33503350
3351+
exports[`Templates InstantSearch.js widget File content: CONTRIBUTING.md 1`] = `
3352+
"# Contribution Guide
3353+
3354+
## Test
3355+
3356+
\`\`\`bash
3357+
npm test
3358+
# or
3359+
yarn test
3360+
\`\`\`
3361+
3362+
## Build
3363+
3364+
\`\`\`bash
3365+
npm run build
3366+
# or
3367+
yarn build
3368+
\`\`\`
3369+
3370+
## Release
3371+
3372+
\`\`\`bash
3373+
npm run release
3374+
# or
3375+
yarn release
3376+
\`\`\`
3377+
3378+
### First Release
3379+
3380+
\`\`\`bash
3381+
npm run release -- --first-release
3382+
# or
3383+
yarn release --first-release
3384+
\`\`\`
3385+
3386+
This will tag a release without bumping the version.
3387+
3388+
When you are ready, push the git tag and run \`npm publish\`.
3389+
3390+
If you want to publish it as a public scoped package, run \`npm publish --access public\` the first time.
3391+
3392+
[To know more about \`standard-version\`, read this →](https://github.com/conventional-changelog/standard-version#cli-usage)"
3393+
`;
3394+
3395+
exports[`Templates InstantSearch.js widget File content: LICENSE.md 1`] = `
3396+
"The MIT License (MIT)
3397+
3398+
Copyright (c) 2021-present algolia.
3399+
3400+
Permission is hereby granted, free of charge, to any person obtaining a copy
3401+
of this software and associated documentation files (the \\"Software\\"), to deal
3402+
in the Software without restriction, including without limitation the rights
3403+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3404+
copies of the Software, and to permit persons to whom the Software is
3405+
furnished to do so, subject to the following conditions:
3406+
3407+
The above copyright notice and this permission notice shall be included in all
3408+
copies or substantial portions of the Software.
3409+
3410+
THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3411+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3412+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3413+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3414+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3415+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3416+
SOFTWARE."
3417+
`;
3418+
33513419
exports[`Templates InstantSearch.js widget File content: README.md 1`] = `
33523420
"# date-picker
33533421
3354-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
33553422
33563423
3424+
---
3425+
3426+
[![MIT](https://img.shields.io/npm/l/@algolia/instantsearch-widget-date-picker)](./LICENSE) [![NPM version](http://img.shields.io/npm/v/@algolia/instantsearch-widget-date-picker.svg)](https://npmjs.org/package/@algolia/instantsearch-widget-date-picker)
33573427
33583428
## Install
33593429
@@ -3390,6 +3460,11 @@ search.start();
33903460
33913461
### Options
33923462
3463+
| Option | Type | Required | Default | Description |
3464+
| :-- | :-- | :-- | :-- | --- |
3465+
| [\`container\`](#container) | \`string\` or \`HTMLElement\` | true | - | The element to insert the widget into. |
3466+
| [\`option1\`](#option1) | \`...\` | true | - | REPLACE WITH THE DESCRIPTION FOR THIS OPTION |
3467+
33933468
#### container
33943469
33953470
> \`string | Element\` | **required**
@@ -3413,7 +3488,6 @@ datePicker({
34133488
// ...
34143489
});
34153490
\`\`\`
3416-
\`\`\`
34173491
34183492
#### option1
34193493
@@ -3428,7 +3502,6 @@ datePicker({
34283502
});
34293503
\`\`\`
34303504
3431-
34323505
## Connector
34333506
34343507
### Usage
@@ -3462,7 +3535,6 @@ search.addWidgets([
34623535
34633536
REPLACE WITH THE DESCRIPTION FOR THIS RENDERING ITEM
34643537
3465-
34663538
\`\`\`js
34673539
const renderDatePicker = (renderOptions, isFirstRender) => {
34683540
// show how to use this render option
@@ -3501,7 +3573,22 @@ search.addWidgets([
35013573
// ...
35023574
}),
35033575
]);
3504-
\`\`\`"
3576+
\`\`\`
3577+
3578+
## Contributing
3579+
3580+
To start contributing to code, you need to:
3581+
3582+
1. [Fork the project](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
3583+
2. [Clone the repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository)
3584+
3. Install the dependencies: \`yarn\`
3585+
4. Run the development mode: \`yarn start\`
3586+
3587+
Please read [our contribution process](./CONTRIBUTING.md) to learn more.
3588+
3589+
---
3590+
3591+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._"
35053592
`;
35063593
35073594
exports[`Templates InstantSearch.js widget File content: babel.config.cjs 1`] = `
@@ -3573,6 +3660,7 @@ exports[`Templates InstantSearch.js widget File content: package.json 1`] = `
35733660
\\"keywords\\": [
35743661
\\"instantsearch-widget\\",
35753662
\\"instantsearch\\",
3663+
\\"instantsearch-widget-date-picker\\",
35763664
\\"widget\\",
35773665
\\"connector\\",
35783666
\\"algolia\\"
@@ -3954,6 +4042,8 @@ Array [
39544042
".eslintignore",
39554043
".eslintrc.cjs",
39564044
".gitignore",
4045+
"CONTRIBUTING.md",
4046+
"LICENSE.md",
39574047
"README.md",
39584048
"babel.config.cjs",
39594049
"package.json",
@@ -5573,12 +5663,90 @@ exports[`Templates React InstantSearch widget File content: .prettierrc 1`] = `
55735663
}"
55745664
`;
55755665

5666+
exports[`Templates React InstantSearch widget File content: CONTRIBUTING.md 1`] = `
5667+
"# Contribution Guide
5668+
5669+
## Test
5670+
5671+
\`\`\`bash
5672+
npm test
5673+
# or
5674+
yarn test
5675+
\`\`\`
5676+
5677+
## Build
5678+
5679+
\`\`\`bash
5680+
npm run build
5681+
# or
5682+
yarn build
5683+
\`\`\`
5684+
5685+
## Run example
5686+
5687+
\`\`\`bash
5688+
npm start
5689+
# or
5690+
yarn start
5691+
\`\`\`
5692+
5693+
## Release
5694+
5695+
\`\`\`bash
5696+
npm run release
5697+
# or
5698+
yarn release
5699+
\`\`\`
5700+
5701+
### First Release
5702+
5703+
\`\`\`bash
5704+
npm run release -- --first-release
5705+
# or
5706+
yarn release --first-release
5707+
\`\`\`
5708+
5709+
This will tag a release without bumping the version.
5710+
5711+
When you are ready, push the git tag and run \`npm publish\`.
5712+
5713+
If you want to publish it as a public scoped package, run \`npm publish --access public\` the first time.
5714+
5715+
[To know more about \`standard-version\`, read this →](https://github.com/conventional-changelog/standard-version#cli-usage)"
5716+
`;
5717+
5718+
exports[`Templates React InstantSearch widget File content: LICENSE.md 1`] = `
5719+
"The MIT License (MIT)
5720+
5721+
Copyright (c) 2021-present algolia.
5722+
5723+
Permission is hereby granted, free of charge, to any person obtaining a copy
5724+
of this software and associated documentation files (the \\"Software\\"), to deal
5725+
in the Software without restriction, including without limitation the rights
5726+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5727+
copies of the Software, and to permit persons to whom the Software is
5728+
furnished to do so, subject to the following conditions:
5729+
5730+
The above copyright notice and this permission notice shall be included in all
5731+
copies or substantial portions of the Software.
5732+
5733+
THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5734+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5735+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5736+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5737+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5738+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5739+
SOFTWARE."
5740+
`;
5741+
55765742
exports[`Templates React InstantSearch widget File content: README.md 1`] = `
55775743
"# date-picker
55785744
5579-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
55805745
55815746
5747+
---
5748+
5749+
[![MIT](https://img.shields.io/npm/l/@algolia/react-instantsearch-widget-date-picker)](./LICENSE) [![NPM version](http://img.shields.io/npm/v/@algolia/react-instantsearch-widget-date-picker.svg)](https://npmjs.org/package/@algolia/react-instantsearch-widget-date-picker)
55825750
55835751
## Install
55845752
@@ -5606,6 +5774,18 @@ const App = () => (
56065774
);
56075775
\`\`\`
56085776
5777+
### Options
5778+
5779+
| Option | Type | Required | Default | Description |
5780+
| :-- | :-- | :-- | :-- | --- |
5781+
| [\`option1\`](#option1) | \`string\` | true | - | REPLACE WITH THE DESCRIPTION FOR THIS OPTION |
5782+
5783+
#### option1
5784+
5785+
> \`string\` | **required**
5786+
5787+
REPLACE WITH THE DESCRIPTION FOR THIS OPTION
5788+
56095789
## Connector
56105790
56115791
### Usage
@@ -5631,45 +5811,20 @@ const App = () => (
56315811
);
56325812
\`\`\`
56335813
5634-
## Test
5635-
5636-
\`\`\`bash
5637-
npm test
5638-
# or
5639-
yarn test
5640-
\`\`\`
5641-
5642-
## Build
5643-
5644-
\`\`\`bash
5645-
npm run build
5646-
# or
5647-
yarn build
5648-
\`\`\`
5649-
5650-
## Release
5651-
5652-
\`\`\`bash
5653-
npm run release
5654-
# or
5655-
yarn release
5656-
\`\`\`
5657-
5658-
### First Release
5814+
## Contributing
56595815
5660-
\`\`\`bash
5661-
npm run release -- --first-release
5662-
# or
5663-
yarn release --first-release
5664-
\`\`\`
5816+
To start contributing to code, you need to:
56655817
5666-
This will tag a release without bumping the version.
5818+
1. [Fork the project](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
5819+
2. [Clone the repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository)
5820+
3. Install the dependencies: \`yarn\`
5821+
4. Run the development mode: \`yarn start\`
56675822
5668-
When you are ready, push the git tag and run \`npm publish\`.
5823+
Please read [our contribution process](./CONTRIBUTING.md) to learn more.
56695824
5670-
If you want to publish it as a public scoped package, run \`npm publish --access public\` the first time.
5825+
---
56715826
5672-
[To know more about \`standard-version\`, read this →](https://github.com/conventional-changelog/standard-version#cli-usage)"
5827+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._"
56735828
`;
56745829

56755830
exports[`Templates React InstantSearch widget File content: babel.config.cjs 1`] = `
@@ -5964,6 +6119,8 @@ Array [
59646119
".eslintrc.cjs",
59656120
".gitignore",
59666121
".prettierrc",
6122+
"CONTRIBUTING.md",
6123+
"LICENSE.md",
59676124
"README.md",
59686125
"babel.config.cjs",
59696126
"example/index.html",

src/cli/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ async function run() {
290290
libraryVersion,
291291
template: templatePath,
292292
installation: program.installation,
293+
currentYear: new Date().getFullYear(),
293294
},
294295
templateConfig.tasks
295296
);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contribution Guide
2+
3+
## Test
4+
5+
```bash
6+
npm test
7+
# or
8+
yarn test
9+
```
10+
11+
## Build
12+
13+
```bash
14+
npm run build
15+
# or
16+
yarn build
17+
```
18+
19+
## Release
20+
21+
```bash
22+
npm run release
23+
# or
24+
yarn release
25+
```
26+
27+
### First Release
28+
29+
```bash
30+
npm run release -- --first-release
31+
# or
32+
yarn release --first-release
33+
```
34+
35+
This will tag a release without bumping the version.
36+
37+
When you are ready, push the git tag and run `npm publish`.
38+
39+
If you want to publish it as a public scoped package, run `npm publish --access public` the first time.
40+
41+
[To know more about `standard-version`, read this →](https://github.com/conventional-changelog/standard-version#cli-usage)

0 commit comments

Comments
 (0)