@equinor/fusion-framework-cli 0.1.7 → 0.1.9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.1.9](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@0.1.8...@equinor/fusion-framework-cli@0.1.9) (2022-11-07)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **cli:** requires vite ([c512d9e](https://github.com/equinor/fusion-framework/commit/c512d9e0e413e515fe0dcb412af49996b04d2484))
11
+
12
+ ## [0.1.8](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@0.1.7...@equinor/fusion-framework-cli@0.1.8) (2022-11-07)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **cli:** allow overwrite on build ([8e648d7](https://github.com/equinor/fusion-framework/commit/8e648d7ea17518a3ec74f3bb366c4247b8f4fce9))
17
+ - **cli:** set default dev-server logging to info ([5f302d4](https://github.com/equinor/fusion-framework/commit/5f302d4773abdca9e29660e8f9dd5c8d80e1ebe2))
18
+
6
19
  ## [0.1.7](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-cli@0.1.6...@equinor/fusion-framework-cli@0.1.7) (2022-11-03)
7
20
 
8
21
  ### Bug Fixes
@@ -360,4 +360,4 @@ PERFORMANCE OF THIS SOFTWARE.
360
360
  class="progress">
361
361
  </circle>
362
362
  </svg>
363
- `}}ar([Fo({type:String,reflect:!0})],da.prototype,"size",void 0);ar([Fo({type:String,reflect:!0})],da.prototype,"color",void 0);da.styles=CT;const Av="fwc-circular-progress";let Xf=class extends da{};Xf=ar([Cc(Av)],Xf);const Rv=Fd(la,kv);Fd(da,Av);Fd(ua,bv);const ST=async t=>{t.logger.level=4,t.configureServiceDiscovery({client:{baseUri:"https://pro-s-portal-ci.azurewebsites.net",defaultScopes:["97978493-9777-4d48-b38a-67b0b9cd88d2/.default"]}}),t.configureMsal({tenantId:"3aa4a235-b6e2-48d5-9195-7fcf05b459b0",clientId:"9b707e3a-3e90-41ed-a47e-652a1e3b53d0",redirectUri:"/authentication/login-callback"},{requiresAuth:!0}),t.onConfigured(()=>{console.log("framework config done")}),t.onInitialized(async e=>{e.auth.defaultClient.setLogger(new Xm(0)),console.debug("\u{1F4D2} subscribing to all events"),e.event.subscribe(r=>console.debug(`\u{1F514}\u{1F30D} [${r.type}]`,r)),console.debug("\u{1F4D2} subscribing to [onReactAppLoaded]"),e.event.addEventListener("onReactAppLoaded",r=>console.debug("\u{1F514} [onReactAppLoaded]",r))})},TT="modulepreload",IT=function(t){return"/"+t},Zf={},kT=function(e,r,n){if(!r||r.length===0)return e();const o=document.getElementsByTagName("link");return Promise.all(r.map(i=>{if(i=IT(i),i in Zf)return;Zf[i]=!0;const a=i.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!n)for(let u=o.length-1;u>=0;u--){const d=o[u];if(d.href===i&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":TT,a||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),a)return new Promise((u,d)=>{l.addEventListener("load",u),l.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e())},bT=t=>{const e=Ud().modules.app,[r,n]=J.exports.useState(void 0),[o,i]=J.exports.useState(),[a,s]=J.exports.useState(!1);return J.exports.useEffect(()=>{s(!0);const c=e.getApp(t).subscribe({next:l=>n(l),error:l=>i(l),complete:()=>s(!1)});return()=>{s(!1),c.unsubscribe()}},[e,n,i,s,t]),{value:r,error:o,isLoading:a}},AT=t=>{const{appKey:e}=t,r=Ud().modules.app,[n,o]=J.exports.useState(),[i,a]=J.exports.useState(),[s,c]=J.exports.useState(!1);return J.exports.useEffect(()=>{o(void 0)},[o,e]),J.exports.useEffect(()=>{if(!e)return;c(!0);const l=r.getAppConfig(e).subscribe({next:u=>o(u),error:u=>a(u),complete:()=>c(!1)});return()=>{c(!1),l.unsubscribe()}},[r,o,a,c,e]),{value:n,error:i,isLoading:s}},RT=t=>{const{value:e,isLoading:r}=bT(t),{value:n,isLoading:o}=AT({appKey:t});return{manifest:e,config:n,isLoading:r||o}},NT=t=>{const{appKey:e}=t,r=Ud(),n=J.exports.useRef(null),o=J.exports.useRef(void 0),{config:i,manifest:a,isLoading:s}=RT(e),c=J.exports.useCallback(async(l,u)=>{var v;const d=new URL("/index.tsx",self.location).href,h=await kT(()=>import(d),[]),p=(v=h.render)!=null?v:h.default;if(n.current)return p(n.current,{fusion:r,env:{manifest:l,config:u}})},[n,r]);return J.exports.useEffect(()=>(!s&&a&&i&&c(a,i).then(l=>o.current=l),o.current),[c,s,a,i]),lv("div",{children:[s&&Ve(Rv,{text:"Loading Application"}),Ve("span",{ref:n,style:{display:s?"none":""}})]})};gl.createRoot(document.getElementById("root")).render(Ve(Zs.StrictMode,{children:Ve(eT,{theme:Ne,children:Ve(gS,{configure:ST,fallback:Ve(Rv,{text:"Loading framework"}),children:lv("div",{children:[Ve("section",{children:Ve("header",{children:Ve("h1",{children:"Fusion Dev Portal"})})}),Ve(NT,{appKey:"test-app"})]})})})}));
363
+ `}}ar([Fo({type:String,reflect:!0})],da.prototype,"size",void 0);ar([Fo({type:String,reflect:!0})],da.prototype,"color",void 0);da.styles=CT;const Av="fwc-circular-progress";let Xf=class extends da{};Xf=ar([Cc(Av)],Xf);const Rv=Fd(la,kv);Fd(da,Av);Fd(ua,bv);const ST=async t=>{t.logger.level=3,t.configureServiceDiscovery({client:{baseUri:"https://pro-s-portal-ci.azurewebsites.net",defaultScopes:["97978493-9777-4d48-b38a-67b0b9cd88d2/.default"]}}),t.configureMsal({tenantId:"3aa4a235-b6e2-48d5-9195-7fcf05b459b0",clientId:"9b707e3a-3e90-41ed-a47e-652a1e3b53d0",redirectUri:"/authentication/login-callback"},{requiresAuth:!0}),t.onConfigured(()=>{console.log("framework config done")}),t.onInitialized(async e=>{e.auth.defaultClient.setLogger(new Xm(0)),console.debug("\u{1F4D2} subscribing to all events"),e.event.subscribe(r=>console.debug(`\u{1F514}\u{1F30D} [${r.type}]`,r)),console.debug("\u{1F4D2} subscribing to [onReactAppLoaded]"),e.event.addEventListener("onReactAppLoaded",r=>console.debug("\u{1F514} [onReactAppLoaded]",r))})},TT="modulepreload",IT=function(t){return"/"+t},Zf={},kT=function(e,r,n){if(!r||r.length===0)return e();const o=document.getElementsByTagName("link");return Promise.all(r.map(i=>{if(i=IT(i),i in Zf)return;Zf[i]=!0;const a=i.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!n)for(let u=o.length-1;u>=0;u--){const d=o[u];if(d.href===i&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":TT,a||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),a)return new Promise((u,d)=>{l.addEventListener("load",u),l.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e())},bT=t=>{const e=Ud().modules.app,[r,n]=J.exports.useState(void 0),[o,i]=J.exports.useState(),[a,s]=J.exports.useState(!1);return J.exports.useEffect(()=>{s(!0);const c=e.getApp(t).subscribe({next:l=>n(l),error:l=>i(l),complete:()=>s(!1)});return()=>{s(!1),c.unsubscribe()}},[e,n,i,s,t]),{value:r,error:o,isLoading:a}},AT=t=>{const{appKey:e}=t,r=Ud().modules.app,[n,o]=J.exports.useState(),[i,a]=J.exports.useState(),[s,c]=J.exports.useState(!1);return J.exports.useEffect(()=>{o(void 0)},[o,e]),J.exports.useEffect(()=>{if(!e)return;c(!0);const l=r.getAppConfig(e).subscribe({next:u=>o(u),error:u=>a(u),complete:()=>c(!1)});return()=>{c(!1),l.unsubscribe()}},[r,o,a,c,e]),{value:n,error:i,isLoading:s}},RT=t=>{const{value:e,isLoading:r}=bT(t),{value:n,isLoading:o}=AT({appKey:t});return{manifest:e,config:n,isLoading:r||o}},NT=t=>{const{appKey:e}=t,r=Ud(),n=J.exports.useRef(null),o=J.exports.useRef(void 0),{config:i,manifest:a,isLoading:s}=RT(e),c=J.exports.useCallback(async(l,u)=>{var v;const d=new URL("/index.tsx",self.location).href,h=await kT(()=>import(d),[]),p=(v=h.render)!=null?v:h.default;if(n.current)return p(n.current,{fusion:r,env:{manifest:l,config:u}})},[n,r]);return J.exports.useEffect(()=>(!s&&a&&i&&c(a,i).then(l=>o.current=l),o.current),[c,s,a,i]),lv("div",{children:[s&&Ve(Rv,{text:"Loading Application"}),Ve("span",{ref:n,style:{display:s?"none":""}})]})};gl.createRoot(document.getElementById("root")).render(Ve(Zs.StrictMode,{children:Ve(eT,{theme:Ne,children:Ve(gS,{configure:ST,fallback:Ve(Rv,{text:"Loading framework"}),children:lv("div",{children:[Ve("section",{children:Ve("header",{children:Ve("h1",{children:"Fusion Dev Portal"})})}),Ve(NT,{appKey:"test-app"})]})})})}));
@@ -5,7 +5,7 @@
5
5
  <meta charset="UTF-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Fusion Framework Dev Portal</title>
8
- <script type="module" crossorigin src="/assets/index.1356b49a.js"></script>
8
+ <script type="module" crossorigin src="/assets/index.965df01f.js"></script>
9
9
 
10
10
  <body>
11
11
  <div id="root"></div>
package/bin/main.js CHANGED
@@ -29,7 +29,7 @@ app.command('dev')
29
29
  spinner.succeed('Configuration loaded');
30
30
  startDevServer(mergeConfig(config, { server: port }));
31
31
  }));
32
- app.command('build').action(() => {
33
- build(createConfig());
34
- });
32
+ app.command('build').action(() => __awaiter(void 0, void 0, void 0, function* () {
33
+ build(mergeConfig(yield createConfig(), { build: { emptyOutDir: true } }));
34
+ }));
35
35
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "keywords": [
5
5
  "Fusion",
6
6
  "Fusion Framework",
@@ -28,7 +28,8 @@
28
28
  "express": "^4.18.2",
29
29
  "find-up": "^6.3.0",
30
30
  "kleur": "^4.1.5",
31
- "ora": "^6.1.2"
31
+ "ora": "^6.1.2",
32
+ "vite": "^3.2.0"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@equinor/fusion-framework-react": "^1.3.6",
@@ -40,8 +41,7 @@
40
41
  "@vitejs/plugin-react": "^2.2.0",
41
42
  "react": "^18.2.0",
42
43
  "react-dom": "^18.2.0",
43
- "typescript": "^4.8.4",
44
- "vite": "^3.2.0"
44
+ "typescript": "^4.8.4"
45
45
  },
46
- "gitHead": "9cce61b38374a86ac2a74344e12af461b78aea5c"
46
+ "gitHead": "8cd013338521d931dbfee5cd3b6454d96adee391"
47
47
  }