@notabene/javascript-sdk 2.0.0-next.2 → 2.0.0-next.5
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/dist/notabene.cjs +1 -1
- package/dist/notabene.d.ts +4 -4
- package/dist/notabene.js +6 -6
- package/package.json +13 -8
- package/src/__tests__/notabene.test.ts +15 -0
- package/src/notabene.ts +6 -6
- package/.editorconfig +0 -10
- package/.gitlab-ci.yml +0 -85
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -4
- package/.husky/pre-push +0 -4
- package/.prettierrc +0 -4
- package/.releaserc.json +0 -16
- package/.vscode/extensions.json +0 -3
- package/.vscode/settings.json +0 -11
- package/.yarn/releases/yarn-berry.cjs +0 -925
- package/.yarnrc.yml +0 -3
- package/CODEOWNERS +0 -1
- package/api-extractor.json +0 -434
- package/eslint.config.js +0 -24
- package/etc/javascript-sdk.api.md +0 -363
- package/index.html +0 -137
- package/temp/javascript-sdk.api.json +0 -3509
- package/temp/javascript-sdk.api.md +0 -363
- package/ts-out/src/__tests__/notabene.test.d.ts +0 -1
- package/ts-out/src/__tests__/notabene.test.js +0 -88
- package/ts-out/src/arbitraries.d.ts +0 -4
- package/ts-out/src/arbitraries.js +0 -8
- package/ts-out/src/components/EmbeddedComponent.d.ts +0 -25
- package/ts-out/src/components/EmbeddedComponent.js +0 -87
- package/ts-out/src/components/__tests__/EmbeddedComponent.test.d.ts +0 -1
- package/ts-out/src/components/__tests__/EmbeddedComponent.test.js +0 -132
- package/ts-out/src/ivms/types.d.ts +0 -252
- package/ts-out/src/ivms/types.js +0 -1
- package/ts-out/src/notabene.d.ts +0 -35
- package/ts-out/src/notabene.js +0 -59
- package/ts-out/src/types.d.ts +0 -357
- package/ts-out/src/types.js +0 -85
- package/ts-out/src/utils/MessageEventManager.d.ts +0 -12
- package/ts-out/src/utils/MessageEventManager.js +0 -45
- package/ts-out/src/utils/__tests__/MessageEventManager.test.d.ts +0 -1
- package/ts-out/src/utils/__tests__/MessageEventManager.test.js +0 -73
- package/ts-out/src/utils/arbitraries.d.ts +0 -6
- package/ts-out/src/utils/arbitraries.js +0 -7
- package/ts-out/src/utils/caip.d.ts +0 -13
- package/ts-out/src/utils/caip.js +0 -15
- package/ts-out/src/utils/urls.d.ts +0 -1
- package/ts-out/src/utils/urls.js +0 -14
- package/ts-out/tsconfig.tsbuildinfo +0 -1
- package/tsconfig.json +0 -22
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.js +0 -13
package/dist/notabene.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var u=(s,e,t)=>e in s?l(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var o=(s,e,t)=>u(s,typeof e!="symbol"?e+"":e,t);var h=(s=>(s.COMPLETE="complete",s.RESIZE="resize",s.RESULT="result",s.READY="ready",s.INVALID="invalid",s.MODAL="openModal",s.ERROR="error",s.CLOSE="closeModal",s.CANCEL="cancel",s))(h||{}),d=(s=>(s.UPDATE="update",s.REQUEST_RESPONSE="requestResponse",s))(d||{});class m{constructor(){o(this,"listeners",new Map);o(this,"port");this.handleMessage=this.handleMessage.bind(this)}setPort(e){this.port=e,this.port.onmessage=this.handleMessage,this.port.start()}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const r=this.listeners.get(e);r&&(r.delete(t),r.size===0&&this.listeners.delete(e))}handleMessage(e){console.log("received message",e.data);const t=e.data;if(typeof t=="object"&&t!==null&&"type"in t){const r=t.type,i=this.listeners.get(r);i&&i.forEach(n=>n(t))}}send(e){if(!this.port)throw new Error("No port set");this.port.postMessage(e)}}class f{constructor(e,t){o(this,"_url");o(this,"_value");o(this,"_errors",[]);o(this,"iframe");o(this,"eventManager");o(this,"ready",!1);this._url=e,this._value=t,this.eventManager=new m,this.on(h.INVALID,r=>{r.type===h.INVALID&&(this._errors=r.errors,this._value=r.value)}),this.on(h.RESIZE,r=>{r.type===h.RESIZE&&this.iframe&&(this.iframe.style.height=`${r.height}px`)})}get url(){return this._url}get value(){return this._value}get errors(){return this._errors}open(){document.location.href=this.url}mount(e){var r,i;this.iframe=document.createElement("iframe"),this.iframe.src=this.url,this.iframe.style.width="100%",this.iframe.style.height="100px",this.iframe.style.border="none",this.iframe.style.overflow="hidden",window.addEventListener("message",n=>{var a,c;n.source===((a=this.iframe)==null?void 0:a.contentWindow)&&(console.log("received message from iframe",n.data),(c=this.eventManager)==null||c.setPort(n.ports[0]),this.ready=!0)});const t=document.querySelector(e);if(!t)throw new Error(`parentID ${e} not found`);t.appendChild(this.iframe),(i=(r=this.iframe)==null?void 0:r.contentWindow)==null||i.focus()}send(e){this.eventManager.send(e)}on(e,t){this.eventManager.on(e,t)}off(e,t){this.eventManager.off(e,t)}update(e){this._value=e,this.send({type:d.UPDATE,value:e})}completion(){return new Promise((e,t)=>{this.on(h.COMPLETE,r=>{e(r.response)}),this.on("error",r=>{t(new Error(r.message))})})}}function p(s){return Object.entries(s).map(([e,t])=>{if(!(e&&t))return;const r=encodeURIComponent(e),i=encodeURIComponent(typeof t=="object"?JSON.stringify(t):t);return`${r}=${i}`}).filter(e=>!!e).join("&")}class E{constructor(e){o(this,"nodeUrl");o(this,"authToken");o(this,"uxUrl");o(this,"theme");o(this,"dictionary");this.uxUrl=e.uxUrl||"https://
|
|
1
|
+
"use strict";var l=Object.defineProperty;var u=(s,e,t)=>e in s?l(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var o=(s,e,t)=>u(s,typeof e!="symbol"?e+"":e,t);var h=(s=>(s.COMPLETE="complete",s.RESIZE="resize",s.RESULT="result",s.READY="ready",s.INVALID="invalid",s.MODAL="openModal",s.ERROR="error",s.CLOSE="closeModal",s.CANCEL="cancel",s))(h||{}),d=(s=>(s.UPDATE="update",s.REQUEST_RESPONSE="requestResponse",s))(d||{});class m{constructor(){o(this,"listeners",new Map);o(this,"port");this.handleMessage=this.handleMessage.bind(this)}setPort(e){this.port=e,this.port.onmessage=this.handleMessage,this.port.start()}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const r=this.listeners.get(e);r&&(r.delete(t),r.size===0&&this.listeners.delete(e))}handleMessage(e){console.log("received message",e.data);const t=e.data;if(typeof t=="object"&&t!==null&&"type"in t){const r=t.type,i=this.listeners.get(r);i&&i.forEach(n=>n(t))}}send(e){if(!this.port)throw new Error("No port set");this.port.postMessage(e)}}class f{constructor(e,t){o(this,"_url");o(this,"_value");o(this,"_errors",[]);o(this,"iframe");o(this,"eventManager");o(this,"ready",!1);this._url=e,this._value=t,this.eventManager=new m,this.on(h.INVALID,r=>{r.type===h.INVALID&&(this._errors=r.errors,this._value=r.value)}),this.on(h.RESIZE,r=>{r.type===h.RESIZE&&this.iframe&&(this.iframe.style.height=`${r.height}px`)})}get url(){return this._url}get value(){return this._value}get errors(){return this._errors}open(){document.location.href=this.url}mount(e){var r,i;this.iframe=document.createElement("iframe"),this.iframe.src=this.url,this.iframe.style.width="100%",this.iframe.style.height="100px",this.iframe.style.border="none",this.iframe.style.overflow="hidden",window.addEventListener("message",n=>{var a,c;n.source===((a=this.iframe)==null?void 0:a.contentWindow)&&(console.log("received message from iframe",n.data),(c=this.eventManager)==null||c.setPort(n.ports[0]),this.ready=!0)});const t=document.querySelector(e);if(!t)throw new Error(`parentID ${e} not found`);t.appendChild(this.iframe),(i=(r=this.iframe)==null?void 0:r.contentWindow)==null||i.focus()}send(e){this.eventManager.send(e)}on(e,t){this.eventManager.on(e,t)}off(e,t){this.eventManager.off(e,t)}update(e){this._value=e,this.send({type:d.UPDATE,value:e})}completion(){return new Promise((e,t)=>{this.on(h.COMPLETE,r=>{e(r.response)}),this.on("error",r=>{t(new Error(r.message))})})}}function p(s){return Object.entries(s).map(([e,t])=>{if(!(e&&t))return;const r=encodeURIComponent(e),i=encodeURIComponent(typeof t=="object"?JSON.stringify(t):t);return`${r}=${i}`}).filter(e=>!!e).join("&")}class E{constructor(e){o(this,"nodeUrl");o(this,"authToken");o(this,"uxUrl");o(this,"theme");o(this,"dictionary");this.uxUrl=e.uxUrl||"https://connect.notabene.id",this.nodeUrl=e.nodeUrl,this.authToken=e.authToken,this.theme=e.theme,this.dictionary=e.dictionary}componentUrl(e,t,r,i){const n=new URL(this.uxUrl);n.pathname=e;const a=p({authToken:this.authToken,value:t,configuration:r});return n.hash=a,this.nodeUrl&&n.searchParams.set("nodeUrl",this.nodeUrl),this.theme&&n.searchParams.set("theme",JSON.stringify(this.theme)),this.dictionary&&n.searchParams.set("dictionary",JSON.stringify(this.dictionary)),i&&(i.callback&&n.searchParams.set("callback_url",i.callback),i.redirectUri&&n.searchParams.set("redirect_uri",i.redirectUri)),n.toString()}createComponent(e,t,r,i){return new f(this.componentUrl(e,t,r,i),t)}createWithdrawalAssist(e,t,r){return this.createComponent("withdrawal-assist",e,t,r)}decodeFragmentToObject(e){return e.slice(1).split("&").reduce((r,i)=>{const[n,a]=i.split("=");return r[decodeURIComponent(n)]=decodeURIComponent(a),r},{})}}module.exports=E;
|
package/dist/notabene.d.ts
CHANGED
|
@@ -396,8 +396,8 @@ declare type NaturalPersonNameTypeCode = 'ALIA' | 'BIRT' | 'MAID' | 'LEGL' | 'MI
|
|
|
396
396
|
* @public
|
|
397
397
|
*/
|
|
398
398
|
declare class Notabene {
|
|
399
|
-
private nodeUrl
|
|
400
|
-
private authToken
|
|
399
|
+
private nodeUrl?;
|
|
400
|
+
private authToken?;
|
|
401
401
|
private uxUrl;
|
|
402
402
|
private theme?;
|
|
403
403
|
private dictionary?;
|
|
@@ -418,8 +418,8 @@ declare type NotabeneAsset = string;
|
|
|
418
418
|
* @public
|
|
419
419
|
*/
|
|
420
420
|
export declare interface NotabeneConfig {
|
|
421
|
-
nodeUrl
|
|
422
|
-
authToken
|
|
421
|
+
nodeUrl?: string;
|
|
422
|
+
authToken?: string;
|
|
423
423
|
uxUrl?: string;
|
|
424
424
|
theme?: Theme;
|
|
425
425
|
dictionary?: {
|
package/dist/notabene.js
CHANGED
|
@@ -2,7 +2,7 @@ var l = Object.defineProperty;
|
|
|
2
2
|
var u = (s, e, t) => e in s ? l(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
3
|
var o = (s, e, t) => u(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
var h = /* @__PURE__ */ ((s) => (s.COMPLETE = "complete", s.RESIZE = "resize", s.RESULT = "result", s.READY = "ready", s.INVALID = "invalid", s.MODAL = "openModal", s.ERROR = "error", s.CLOSE = "closeModal", s.CANCEL = "cancel", s))(h || {}), c = /* @__PURE__ */ ((s) => (s.UPDATE = "update", s.REQUEST_RESPONSE = "requestResponse", s))(c || {});
|
|
5
|
-
class
|
|
5
|
+
class f {
|
|
6
6
|
constructor() {
|
|
7
7
|
o(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
8
|
o(this, "port");
|
|
@@ -33,7 +33,7 @@ class m {
|
|
|
33
33
|
this.port.postMessage(e);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class m {
|
|
37
37
|
constructor(e, t) {
|
|
38
38
|
o(this, "_url");
|
|
39
39
|
o(this, "_value");
|
|
@@ -41,7 +41,7 @@ class f {
|
|
|
41
41
|
o(this, "iframe");
|
|
42
42
|
o(this, "eventManager");
|
|
43
43
|
o(this, "ready", !1);
|
|
44
|
-
this._url = e, this._value = t, this.eventManager = new
|
|
44
|
+
this._url = e, this._value = t, this.eventManager = new f(), this.on(h.INVALID, (r) => {
|
|
45
45
|
r.type === h.INVALID && (this._errors = r.errors, this._value = r.value);
|
|
46
46
|
}), this.on(h.RESIZE, (r) => {
|
|
47
47
|
r.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
|
|
@@ -107,7 +107,7 @@ class g {
|
|
|
107
107
|
o(this, "uxUrl");
|
|
108
108
|
o(this, "theme");
|
|
109
109
|
o(this, "dictionary");
|
|
110
|
-
this.uxUrl = e.uxUrl || "https://
|
|
110
|
+
this.uxUrl = e.uxUrl || "https://connect.notabene.id", this.nodeUrl = e.nodeUrl, this.authToken = e.authToken, this.theme = e.theme, this.dictionary = e.dictionary;
|
|
111
111
|
}
|
|
112
112
|
componentUrl(e, t, r, i) {
|
|
113
113
|
const n = new URL(this.uxUrl);
|
|
@@ -117,10 +117,10 @@ class g {
|
|
|
117
117
|
value: t,
|
|
118
118
|
configuration: r
|
|
119
119
|
});
|
|
120
|
-
return n.hash = a, n.searchParams.set("nodeUrl", this.nodeUrl), this.theme && n.searchParams.set("theme", JSON.stringify(this.theme)), this.dictionary && n.searchParams.set("dictionary", JSON.stringify(this.dictionary)), i && (i.callback && n.searchParams.set("callback_url", i.callback), i.redirectUri && n.searchParams.set("redirect_uri", i.redirectUri)), n.toString();
|
|
120
|
+
return n.hash = a, this.nodeUrl && n.searchParams.set("nodeUrl", this.nodeUrl), this.theme && n.searchParams.set("theme", JSON.stringify(this.theme)), this.dictionary && n.searchParams.set("dictionary", JSON.stringify(this.dictionary)), i && (i.callback && n.searchParams.set("callback_url", i.callback), i.redirectUri && n.searchParams.set("redirect_uri", i.redirectUri)), n.toString();
|
|
121
121
|
}
|
|
122
122
|
createComponent(e, t, r, i) {
|
|
123
|
-
return new
|
|
123
|
+
return new m(
|
|
124
124
|
this.componentUrl(e, t, r, i),
|
|
125
125
|
t
|
|
126
126
|
);
|
package/package.json
CHANGED
|
@@ -9,11 +9,17 @@
|
|
|
9
9
|
},
|
|
10
10
|
"author": "Notabene <developers@notabene.id>",
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "2.0.0-next.
|
|
12
|
+
"version": "2.0.0-next.5",
|
|
13
13
|
"source": "src/notabene.ts",
|
|
14
14
|
"main": "dist/notabene.js",
|
|
15
15
|
"types": "dist/notabene.d.ts",
|
|
16
16
|
"browserslist": "> 0.5%, last 2 versions, not dead",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"src",
|
|
20
|
+
"package.json",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
17
23
|
"scripts": {
|
|
18
24
|
"prepare": "husky install",
|
|
19
25
|
"dev": "vite",
|
|
@@ -24,11 +30,12 @@
|
|
|
24
30
|
"build": "vite build && tsc && api-extractor run",
|
|
25
31
|
"lint": "eslint .",
|
|
26
32
|
"test": "vitest",
|
|
27
|
-
"release": "semantic-release"
|
|
33
|
+
"release": "semantic-release",
|
|
34
|
+
"publish": "yarn build && npm publish --tag next"
|
|
28
35
|
},
|
|
29
36
|
"devDependencies": {
|
|
30
|
-
"@commitlint/cli": "^
|
|
31
|
-
"@commitlint/config-conventional": "^
|
|
37
|
+
"@commitlint/cli": "^19.4.0",
|
|
38
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
32
39
|
"@eslint/js": "^9.7.0",
|
|
33
40
|
"@fast-check/vitest": "^0.1.2",
|
|
34
41
|
"@microsoft/api-extractor": "^7.47.7",
|
|
@@ -39,9 +46,6 @@
|
|
|
39
46
|
"@typescript-eslint/parser": "^8.2.0",
|
|
40
47
|
"eslint": "^9.9.0",
|
|
41
48
|
"eslint-config-prettier": "^9.1.0",
|
|
42
|
-
"eslint-config-standard": "^17.1.0",
|
|
43
|
-
"eslint-plugin-import": "^2.25.4",
|
|
44
|
-
"eslint-plugin-node": "^11.1.0",
|
|
45
49
|
"eslint-plugin-prettier": "^5.2.1",
|
|
46
50
|
"fast-check": "^3.20.0",
|
|
47
51
|
"globals": "^15.8.0",
|
|
@@ -49,7 +53,8 @@
|
|
|
49
53
|
"lint-staged": "^12.3.4",
|
|
50
54
|
"organize-imports-cli": "^0.9.0",
|
|
51
55
|
"prettier": "^3.3.3",
|
|
52
|
-
"
|
|
56
|
+
"rimraf": "^6.0.1",
|
|
57
|
+
"semantic-release": "^24.1.0",
|
|
53
58
|
"typescript": "^5.5.4",
|
|
54
59
|
"typescript-eslint": "^8.2.0",
|
|
55
60
|
"vite": "^5.4.2",
|
|
@@ -28,6 +28,21 @@ describe('Notabene', () => {
|
|
|
28
28
|
);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
+
describe('minimal', () => {
|
|
32
|
+
test.prop([arbitraryComponent(), fc.object()])(
|
|
33
|
+
'Should set the correct values',
|
|
34
|
+
(component, value) => {
|
|
35
|
+
const notabene = new Notabene({});
|
|
36
|
+
const url = new URL(notabene.componentUrl(component, value));
|
|
37
|
+
return (
|
|
38
|
+
url.hash === `#value=${encodeURIComponent(JSON.stringify(value))}` &&
|
|
39
|
+
url.hostname === 'connect.notabene.id' &&
|
|
40
|
+
url.pathname === `/${component}`
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
31
46
|
describe('with uxUrl', () => {
|
|
32
47
|
test.prop([
|
|
33
48
|
fc.string({ minLength: 3 }),
|
package/src/notabene.ts
CHANGED
|
@@ -62,8 +62,8 @@ export type {
|
|
|
62
62
|
* @public
|
|
63
63
|
*/
|
|
64
64
|
export interface NotabeneConfig {
|
|
65
|
-
nodeUrl
|
|
66
|
-
authToken
|
|
65
|
+
nodeUrl?: string;
|
|
66
|
+
authToken?: string;
|
|
67
67
|
uxUrl?: string;
|
|
68
68
|
theme?: Theme;
|
|
69
69
|
dictionary?: { [key: string]: string };
|
|
@@ -76,14 +76,14 @@ export interface NotabeneConfig {
|
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
78
|
export default class Notabene {
|
|
79
|
-
private nodeUrl
|
|
80
|
-
private authToken
|
|
79
|
+
private nodeUrl?: string;
|
|
80
|
+
private authToken?: string;
|
|
81
81
|
private uxUrl: string;
|
|
82
82
|
private theme?: Theme;
|
|
83
83
|
private dictionary?: { [key: string]: string };
|
|
84
84
|
|
|
85
85
|
constructor(config: NotabeneConfig) {
|
|
86
|
-
this.uxUrl = config.uxUrl || 'https://
|
|
86
|
+
this.uxUrl = config.uxUrl || 'https://connect.notabene.id';
|
|
87
87
|
this.nodeUrl = config.nodeUrl;
|
|
88
88
|
this.authToken = config.authToken;
|
|
89
89
|
this.theme = config.theme;
|
|
@@ -105,7 +105,7 @@ export default class Notabene {
|
|
|
105
105
|
configuration,
|
|
106
106
|
});
|
|
107
107
|
url.hash = hash;
|
|
108
|
-
url.searchParams.set('nodeUrl', this.nodeUrl);
|
|
108
|
+
if (this.nodeUrl) url.searchParams.set('nodeUrl', this.nodeUrl);
|
|
109
109
|
|
|
110
110
|
if (this.theme) {
|
|
111
111
|
url.searchParams.set('theme', JSON.stringify(this.theme));
|
package/.editorconfig
DELETED
package/.gitlab-ci.yml
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
image: registry.gitlab.com/notabene/devops/build-node-18-image:latest
|
|
2
|
-
|
|
3
|
-
variables:
|
|
4
|
-
NPM_TOKEN: ${CI_JOB_TOKEN}
|
|
5
|
-
|
|
6
|
-
stages:
|
|
7
|
-
- install
|
|
8
|
-
- lint
|
|
9
|
-
- test
|
|
10
|
-
- build
|
|
11
|
-
- release
|
|
12
|
-
|
|
13
|
-
install:
|
|
14
|
-
stage: install
|
|
15
|
-
artifacts:
|
|
16
|
-
paths:
|
|
17
|
-
- .yarn
|
|
18
|
-
- .pnp.cjs
|
|
19
|
-
- .pnp.loader.mjs
|
|
20
|
-
script:
|
|
21
|
-
- yarn
|
|
22
|
-
|
|
23
|
-
lint:
|
|
24
|
-
stage: lint
|
|
25
|
-
needs:
|
|
26
|
-
- install
|
|
27
|
-
script:
|
|
28
|
-
- yarn lint
|
|
29
|
-
|
|
30
|
-
test:
|
|
31
|
-
stage: test
|
|
32
|
-
needs:
|
|
33
|
-
- install
|
|
34
|
-
script:
|
|
35
|
-
- yarn test
|
|
36
|
-
|
|
37
|
-
build:
|
|
38
|
-
stage: build
|
|
39
|
-
needs:
|
|
40
|
-
- install
|
|
41
|
-
script:
|
|
42
|
-
- yarn build
|
|
43
|
-
artifacts:
|
|
44
|
-
paths:
|
|
45
|
-
- dist
|
|
46
|
-
|
|
47
|
-
publish-gitlab:
|
|
48
|
-
stage: release
|
|
49
|
-
needs:
|
|
50
|
-
- install
|
|
51
|
-
- build
|
|
52
|
-
variables:
|
|
53
|
-
GITLAB_USER_NAME: 'gitlab-ci'
|
|
54
|
-
GITLAB_USER_EMAIL: 'gitlab-ci@example.com'
|
|
55
|
-
before_script:
|
|
56
|
-
- git config --global user.email "$GITLAB_USER_EMAIL"
|
|
57
|
-
- git config --global user.name "$GITLAB_USER_NAME"
|
|
58
|
-
- |
|
|
59
|
-
{
|
|
60
|
-
echo "@${CI_PROJECT_ROOT_NAMESPACE}:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/"
|
|
61
|
-
echo "${CI_API_V4_URL#https?}/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=\${CI_JOB_TOKEN}"
|
|
62
|
-
} | tee -a .npmrc
|
|
63
|
-
script:
|
|
64
|
-
- yarn semantic-release
|
|
65
|
-
only:
|
|
66
|
-
- master
|
|
67
|
-
|
|
68
|
-
publish-npm:
|
|
69
|
-
stage: release
|
|
70
|
-
when: manual
|
|
71
|
-
script:
|
|
72
|
-
- yarn npm publish
|
|
73
|
-
only:
|
|
74
|
-
- tags
|
|
75
|
-
|
|
76
|
-
publish-npm-next:
|
|
77
|
-
stage: release
|
|
78
|
-
needs:
|
|
79
|
-
- install
|
|
80
|
-
- build
|
|
81
|
-
script:
|
|
82
|
-
- yarn npm version prerelease
|
|
83
|
-
- yarn npm publish --tag next
|
|
84
|
-
only:
|
|
85
|
-
- v2
|
package/.husky/commit-msg
DELETED
package/.husky/pre-commit
DELETED
package/.husky/pre-push
DELETED
package/.prettierrc
DELETED
package/.releaserc.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"branches": ["master"],
|
|
3
|
-
"plugins": [
|
|
4
|
-
"@semantic-release/commit-analyzer",
|
|
5
|
-
"@semantic-release/release-notes-generator",
|
|
6
|
-
"@semantic-release/gitlab",
|
|
7
|
-
"@semantic-release/npm",
|
|
8
|
-
[
|
|
9
|
-
"@semantic-release/git",
|
|
10
|
-
{
|
|
11
|
-
"assets": ["package.json"],
|
|
12
|
-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
]
|
|
16
|
-
}
|
package/.vscode/extensions.json
DELETED
package/.vscode/settings.json
DELETED