mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 22:44:21 +01:00
Updating guides (1.5.0) (#154)
* Remove `--` for app option passthrough Changed since `paparam` was used for parsing command line options: 85892a6a32a84ae42a548f8e3ac0b5dbedd70c80 Now uses `cmd.rest` for app args. * Use `Pear.config.args` for howto scripts * Update "starting a pear desktop project" guide to match template * Remove `--no-ask-trust` flag from `pear run` cli doc This command was replaced by `--no-ask` which was already in the documentation. Updated a reference to `--no-ask-trust` in the 'Sharing a Pear Application' guide. * Fix typos in "Releasing a Pear Application" guide * Correct application storage folder name in hyperbee howto * Add missing `test/index.test.js` in project structure for terminal guide * Remove language about app continuing to run This is no longer true at least as of pear: v0.5114.pqbzjhqyonxprx8hghxexnmctw75mr91ewqw5dxe1zmntfyaddqy / v1.5.0 * Fix extra indention in example code for hypercore howto * Format json in `_template.json` example * Add instructions to set up a minimal `package.json` for testing template Without this, the next step of `pear run --dev .` does not work since `pear` expects a `package.json` file. * Rename hyperbee reader app in hyperdrive howto to avoid name conflict Naming only matters if someone is following the guides and starts each guide from the same root directory. If they do, then `bee-reader-app` from the hyperdrive conflicts with the `bee-reader-app` from the hyperbee howto. * Remove unrelated youtube tutorial from hyperswarm howto * Update guide/creating-a-pear-init-template.md Co-authored-by: David Mark Clements <huperekchunow@googlemail.com> * Fix spelling mistake Co-authored-by: David Mark Clements <huperekchunow@googlemail.com> --------- Co-authored-by: David Mark Clements <huperekchunow@googlemail.com>
This commit is contained in:
@@ -78,37 +78,37 @@ Replace the contents of `_template.json` with
|
||||
|
||||
```json
|
||||
{
|
||||
"params": [
|
||||
{
|
||||
"name": "name",
|
||||
"prompt": "name"
|
||||
},
|
||||
{
|
||||
"name": "main",
|
||||
"default": "index.html",
|
||||
"prompt": "main",
|
||||
"validation": "(value) => value.endsWith('.html')",
|
||||
"msg": "must have an .html file extension"
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"validation": "(value) => Number.isInteger(+value)",
|
||||
"prompt": "height",
|
||||
"msg": "must be an integer"
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"validation": "(value) => Number.isInteger(+value)",
|
||||
"prompt": "width",
|
||||
"msg": "must be an integer"
|
||||
},
|
||||
{
|
||||
"name": "license",
|
||||
"default": "Apache-2.0",
|
||||
"prompt": "license"
|
||||
}
|
||||
]
|
||||
}
|
||||
"params": [
|
||||
{
|
||||
"name": "name",
|
||||
"prompt": "name"
|
||||
},
|
||||
{
|
||||
"name": "main",
|
||||
"default": "index.html",
|
||||
"prompt": "main",
|
||||
"validation": "(value) => value.endsWith('.html')",
|
||||
"msg": "must have an .html file extension"
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"validation": "(value) => Number.isInteger(+value)",
|
||||
"prompt": "height",
|
||||
"msg": "must be an integer"
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"validation": "(value) => Number.isInteger(+value)",
|
||||
"prompt": "width",
|
||||
"msg": "must be an integer"
|
||||
},
|
||||
{
|
||||
"name": "license",
|
||||
"default": "Apache-2.0",
|
||||
"prompt": "license"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## App Content
|
||||
@@ -166,6 +166,21 @@ Replace the contents of `index.html` file with :
|
||||
</html>
|
||||
```
|
||||
|
||||
Temporarily set the contents of `package.json` to:
|
||||
|
||||
```json
|
||||
{
|
||||
"pear": {
|
||||
"name": "pear-init-template-tutorial",
|
||||
"type": "desktop"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This is the minimal requirements for a Pear Application `package.json` to run.
|
||||
This will allow us to test the template's `index.html` as a pear desktop
|
||||
app.
|
||||
|
||||
Run the application using:
|
||||
|
||||
```bash
|
||||
@@ -216,4 +231,4 @@ pear init [dir]
|
||||
|
||||
Here replace `[dir]` with the local template directory path. This can also be a `pear://` link.
|
||||
|
||||
This should now initialize a new Pear project from the created template.
|
||||
This should now initialize a new Pear project from the created template.
|
||||
|
||||
Reference in New Issue
Block a user