@hellocoop/quickstart 1.0.8 → 1.0.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 (3) hide show
  1. package/README.md +34 -0
  2. package/package.json +11 -7
  3. package/quickstart.js +12 -4
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Hellō Quickstart
2
+
3
+ ## CLI
4
+
5
+ You can run the following command to create or retrieve the `client_id` for a Hellō Application.
6
+
7
+ `npx @hellocoop/quickstart@latest`
8
+
9
+ This will open up a browser window, where you will need to login with Hellō, and then choose to create a new app, or return the `client_id`.
10
+
11
+ ## Import Package
12
+
13
+ To install in another package
14
+
15
+ `npm i @hellocoop/quickstart`
16
+
17
+ or
18
+
19
+ `yarn i @hellocoop/quickstart`
20
+
21
+ You can then use call Quickstart fom another configuration script
22
+
23
+ ```
24
+ import quickstart from './quickstart.js';
25
+
26
+ ...
27
+
28
+ const client_id = await quickstart()
29
+
30
+ ```
31
+
32
+ ## Options
33
+
34
+ TBD
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@hellocoop/quickstart",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Provides a CLI to start the Hello Quickstart web app and return a client_id",
5
5
  "module": "quickstart.js",
6
- "bin":{
7
- "quickstart":"./index.mjs"
6
+ "bin": {
7
+ "quickstart": "./index.mjs"
8
8
  },
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git+https://github.com/hellocoop/hello.git"
14
+ "url": "git+https://github.com/hellocoop/packages.git"
15
15
  },
16
16
  "keywords": [
17
17
  "hello",
@@ -19,12 +19,16 @@
19
19
  "sso",
20
20
  "quickstart"
21
21
  ],
22
- "author": "dick.hardt@hello.coop",
22
+ "author": {
23
+ "name": "Hello Identity Co-op",
24
+ "email": "contact@hello.coop",
25
+ "url": "https://hello.coop"
26
+ },
23
27
  "license": "MIT",
24
28
  "bugs": {
25
- "url": "https://github.com/hellocoop/hello/issues"
29
+ "url": "https://github.com/hellocoop/packages/issues"
26
30
  },
27
- "homepage": "https://github.com/hellocoop/hello#readme",
31
+ "homepage": "https://github.com/hellocoop/packages#readme",
28
32
  "dependencies": {
29
33
  "get-port": "^7.0.0",
30
34
  "open": "^9.1.0"
package/quickstart.js CHANGED
@@ -1,11 +1,11 @@
1
1
 
2
2
  import open from 'open'
3
3
  import getPort from 'get-port'
4
+ import readline from 'readline'
4
5
  import * as http from 'http'
5
6
  import { URLSearchParams, parse } from 'url';
6
7
  import page from './page.js'
7
8
 
8
-
9
9
  const quickstart = async function (params) {
10
10
  return new Promise(async (resolve) => {
11
11
 
@@ -39,10 +39,18 @@ const quickstart = async function (params) {
39
39
  const queryString = new URLSearchParams(queryParams).toString();
40
40
  const quickstartURL = `https://quickstart.hello.coop/?${queryString}`
41
41
  server.listen(port, host, () => {
42
- console.log('Obtaining a client_id from Hellō Quickstart using')
42
+ console.log('Obtaining a client_id from Hellō Quickstart using:')
43
43
  console.log(quickstartURL)
44
- console.log('Opening browser...')
45
- open(quickstartURL)
44
+ const rl = readline.createInterface({
45
+ input: process.stdin,
46
+ output: process.stdout
47
+ });
48
+
49
+ rl.question('Press ENTER to open in the browser...', (answer) => {
50
+ open(quickstartURL)
51
+ rl.close();
52
+ });
53
+
46
54
  })
47
55
  })
48
56
  }