@descope/web-component 0.1.0-alpha.0 → 0.1.0-alpha.2

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 (2) hide show
  1. package/README.md +12 -3
  2. package/package.json +80 -69
package/README.md CHANGED
@@ -3,12 +3,17 @@
3
3
  Create your login pages on our console-app, once done, you can use this library to inject those pages to your app</br>
4
4
  it registers- a [web component](https://developer.mozilla.org/en-US/docs/Web/Web_Components) and update the web-component content based on the relevant page,
5
5
  See usage example below
6
+
6
7
  ## Usage
8
+
7
9
  ### Install the package
10
+
8
11
  ```bash
9
12
  npm install @descope/web-component
10
13
  ```
14
+
11
15
  ### As a library
16
+
12
17
  ```js
13
18
  import '@descope/web-component'
14
19
  import { DescopeWc } // in case you need types definition or you want to use the class directly
@@ -20,25 +25,29 @@ render(){
20
25
  )
21
26
  }
22
27
  ```
28
+
23
29
  ### In HTML file
24
30
 
25
31
  - Copy the file `@descope/web-js/sdk/dist/descope-wc.js` and place it where your HTML file is located
26
32
 
27
33
  - Add the following script tag to your HTML file
34
+
28
35
  ```html
29
36
  <head>
30
- <script src="./my-lib.umd.production.min.js"></script>
37
+ <script src="./my-lib.umd.production.min.js"></script>
31
38
  </head>
32
39
  ```
33
40
 
34
41
  - Now you can add the custom element to your HTML
42
+
35
43
  ```html
36
44
  <descope-wc project-id="<project-id>" flow-id="<flow-id>"></descope-wc>
37
45
  ```
38
46
 
39
47
  ### Run the demo app
48
+
40
49
  - Install dependencies - `npm i`
41
- - Edit the `src/app/index.html` - replace `<project-id>` and `<project-id>` with your project and a flow
50
+ - Edit the `src/app/index.html` - replace `<project-id>` and `<project-id>` with your project and a flow
42
51
  - Run application - `npm run start`
43
52
 
44
- *TODO: we should host this file so it can be included without installing the package, once we will publish it to a public registry, we can also use unpkg.com/ to serve it*
53
+ _TODO: we should host this file so it can be included without installing the package, once we will publish it to a public registry, we can also use unpkg.com/ to serve it_
package/package.json CHANGED
@@ -1,71 +1,82 @@
1
1
  {
2
- "name": "@descope/web-component",
3
- "version": "0.1.0-alpha.0",
4
- "main": "dist/descope-wc",
5
- "types": "dist/descope-wc.d.ts",
6
- "description": "Descope WC",
7
- "scripts": {
8
- "start": "rollup -c rollup.config.app.js -w",
9
- "build": "rollup -c",
10
- "test": "jest",
11
- "lint": "eslint ./src --fix",
12
- "format": "prettier ./src --write",
13
- "prepublishOnly": "npm run build"
14
- },
15
- "license": "ISC",
16
- "repository": {
17
- "type": "git",
18
- "url": "https://github.com/descope/web-component.git"
19
- },
20
- "files": [
21
- "dist"
22
- ],
23
- "devDependencies": {
24
- "@open-wc/rollup-plugin-html": "1.2.5",
25
- "@rollup/plugin-commonjs": "^22.0.0",
26
- "@rollup/plugin-node-resolve": "^13.3.0",
27
- "@rollup/plugin-replace": "^4.0.0",
28
- "@rollup/plugin-typescript": "^8.3.0",
29
- "@testing-library/dom": "^8.19.0",
30
- "@types/jest": "^29.0.0",
31
- "@types/lodash.get": "^4.4.7",
32
- "@types/lodash.set": "^4.3.7",
33
- "eslint": "8.26.0",
34
- "eslint-config-airbnb": "19.0.4",
35
- "eslint-config-airbnb-typescript": "17.0.0",
36
- "eslint-config-prettier": "8.5.0",
37
- "eslint-config-standard": "17.0.0",
38
- "eslint-import-resolver-typescript": "3.4.0",
39
- "eslint-plugin-import": "2.26.0",
40
- "eslint-plugin-jest": "27.1.3",
41
- "eslint-plugin-jest-dom": "4.0.2",
42
- "eslint-plugin-jest-formatting": "3.1.0",
43
- "eslint-plugin-n": "15.3.0",
44
- "eslint-plugin-no-only-tests": "3.0.0",
45
- "eslint-plugin-prefer-arrow": "1.2.3",
46
- "eslint-plugin-prettier": "4.2.1",
47
- "eslint-plugin-promise": "6.1.1",
48
- "husky": "^8.0.1",
49
- "jest": "^29.0.0",
50
- "jest-environment-jsdom": "^29.0.0",
51
- "prettier": "^2.6.2",
52
- "rollup": "^2.62.0",
53
- "rollup-plugin-browsersync": "^1.3.3",
54
- "rollup-plugin-delete": "^2.0.0",
55
- "rollup-plugin-dts": "^4.2.2",
56
- "rollup-plugin-livereload": "^2.0.5",
57
- "rollup-plugin-terser": "7.0.2",
58
- "shadow-dom-testing-library": "^1.2.0",
59
- "string-to-arraybuffer": "^1.0.2",
60
- "ts-jest": "^29.0.0",
61
- "ts-node": "10.9.1",
62
- "typescript": "^4.5.3"
63
- },
64
- "dependencies": {
65
- "@descope/core-js-sdk": "0.0.41-alpha.17",
66
- "@descope/web-js-sdk": "0.1.0-alpha.3"
67
- },
68
- "overrides": {
69
- "terser": "5.15.1"
70
- }
2
+ "name": "@descope/web-component",
3
+ "version": "0.1.0-alpha.2",
4
+ "main": "dist/descope-wc",
5
+ "types": "dist/descope-wc.d.ts",
6
+ "description": "Descope WC",
7
+ "scripts": {
8
+ "start": "rollup -c rollup.config.app.js -w",
9
+ "build": "rollup -c",
10
+ "test": "jest",
11
+ "prepare": "husky install",
12
+ "lint": "eslint '+(src|test)/**/*.ts' --fix",
13
+ "format": "prettier . -w --ignore-path .gitignore",
14
+ "format-check": "prettier . --check --ignore-path .gitignore",
15
+ "format-lint": "pretty-quick --staged --ignore-path .gitignore && lint-staged",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "lint-staged": {
19
+ "+(src|test)/**/*.{js,ts,jsx,tsx}": [
20
+ "npm run lint"
21
+ ]
22
+ },
23
+ "license": "ISC",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/descope/web-component.git"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "devDependencies": {
32
+ "@open-wc/rollup-plugin-html": "1.2.5",
33
+ "@rollup/plugin-commonjs": "^22.0.0",
34
+ "@rollup/plugin-node-resolve": "^13.3.0",
35
+ "@rollup/plugin-replace": "^4.0.0",
36
+ "@rollup/plugin-typescript": "^8.3.0",
37
+ "@testing-library/dom": "^8.19.0",
38
+ "@types/jest": "^29.0.0",
39
+ "@types/lodash": "^4.14.186",
40
+ "@types/lodash.get": "^4.4.7",
41
+ "@types/lodash.set": "^4.3.7",
42
+ "eslint": "8.26.0",
43
+ "eslint-config-airbnb": "19.0.4",
44
+ "eslint-config-airbnb-typescript": "17.0.0",
45
+ "eslint-config-prettier": "8.5.0",
46
+ "eslint-config-standard": "17.0.0",
47
+ "eslint-import-resolver-typescript": "3.4.0",
48
+ "eslint-plugin-import": "2.26.0",
49
+ "eslint-plugin-jest": "27.1.3",
50
+ "eslint-plugin-jest-dom": "4.0.2",
51
+ "eslint-plugin-jest-formatting": "3.1.0",
52
+ "eslint-plugin-n": "15.3.0",
53
+ "eslint-plugin-no-only-tests": "3.1.0",
54
+ "eslint-plugin-prefer-arrow": "1.2.3",
55
+ "eslint-plugin-prettier": "4.2.1",
56
+ "eslint-plugin-promise": "6.1.1",
57
+ "husky": "^8.0.1",
58
+ "jest": "^29.0.0",
59
+ "jest-environment-jsdom": "^29.0.0",
60
+ "lint-staged": "^13.0.3",
61
+ "prettier": "^2.6.2",
62
+ "pretty-quick": "^3.1.3",
63
+ "rollup": "^2.62.0",
64
+ "rollup-plugin-browsersync": "^1.3.3",
65
+ "rollup-plugin-delete": "^2.0.0",
66
+ "rollup-plugin-dts": "^4.2.2",
67
+ "rollup-plugin-livereload": "^2.0.5",
68
+ "rollup-plugin-terser": "7.0.2",
69
+ "shadow-dom-testing-library": "^1.2.0",
70
+ "string-to-arraybuffer": "^1.0.2",
71
+ "ts-jest": "^29.0.0",
72
+ "ts-node": "10.9.1",
73
+ "typescript": "^4.5.3"
74
+ },
75
+ "dependencies": {
76
+ "@descope/core-js-sdk": "0.0.41-alpha.17",
77
+ "@descope/web-js-sdk": "0.1.0-alpha.3"
78
+ },
79
+ "overrides": {
80
+ "terser": "5.15.1"
81
+ }
71
82
  }