@coreframe/vite 0.2.29 → 0.2.30

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/client.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  interface ImportMetaEnv {
4
4
  readonly COREFRAME_ENV: "development" | "preview" | "production"
5
5
  readonly COREFRAME_MANAGED_DEV?: boolean
6
+ readonly DEBUG: boolean
6
7
  readonly MOBILE_PLATFORM: "ios" | "android" | undefined
7
8
  readonly PLATFORM: import("@coreframe/lib/shell").ShellPlatform
8
9
  }
@@ -0,0 +1,6 @@
1
+ import { Plugin } from "vite";
2
+
3
+ //#region plugins/environment.d.ts
4
+ declare function coreframeEnvironmentPlugin(): Plugin;
5
+ //#endregion
6
+ export { coreframeEnvironmentPlugin };
@@ -0,0 +1 @@
1
+ import{parseSync as e}from"vite";function t(e,n){if(Array.isArray(e)){for(let r of e)t(r,n);return}if(typeof e!=`object`||!e)return;let r=e;if(!(typeof r.type!=`string`||typeof r.start!=`number`||typeof r.end!=`number`)){n(r);for(let e of Object.values(r))t(e,n)}}function n(n,r,i){let a=r.split(`?`,1)[0];if(!a||!n.includes(`import.meta.env.DEBUG`)||!/\.[cm]?[jt]sx?$/.test(a))return;let o=[];t(e(a,n,{range:!0}).program,e=>{e.type===`MemberExpression`&&n.slice(e.start,e.end)===`import.meta.env.DEBUG`&&o.push(e)});let s=String(i);for(let e of o.sort((e,t)=>t.start-e.start))n=`${n.slice(0,e.start)}${s.padEnd(e.end-e.start)}${n.slice(e.end)}`;return o.length>0?n:void 0}function r(e){return process.env.COREFRAME_ENV===`preview`||e.mode===`preview`?`preview`:e.command===`serve`?`development`:`production`}function i(){let e=!1,t=!1;return{name:`coreframe:environment`,enforce:`pre`,config(n,i){let a=r(i);return e=a!==`production`,t=i.mode===`test`||i.mode===`benchmark`,{define:{"import.meta.env.COREFRAME_ENV":JSON.stringify(a),"import.meta.env.DEBUG":JSON.stringify(e)}}},transform(r,i){if(t)return n(r,i,e)}}}export{i as coreframeEnvironmentPlugin};
@@ -1 +1 @@
1
- import{coreframeAssetsPlugin as e}from"./assets.js";import{coreframeDashboardPlugin as t}from"./dashboard.js";import{coreframeDevJobsPlugin as n}from"./dev-jobs.js";import{coreframeDevelopmentControlsPlugin as r}from"./development-controls.js";import{coreframeFaviconPlugin as i}from"./favicon.js";import{coreframeFlutterDevToolsPlugin as a}from"./flutter-devtools.js";import{t as o}from"../icons-vb_lG-av.js";import{coreframeManagedDevPlugin as s}from"./managed-dev.js";import{coreframePreviewPlugin as c}from"./preview.js";import{coreframeStartupTimingPlugin as l}from"./startup-timing.js";import{t as u}from"../worktree-head-BZrhW1-Q.js";function d(d={}){return[l(),c(d.config??{}),e(),...o(),r(),a(),n(),s(),u(),t(),...i(d.webManifest===void 0?void 0:{webManifest:d.webManifest})]}export{d as coreframeVitePreset};
1
+ import{coreframeAssetsPlugin as e}from"./assets.js";import{coreframeDashboardPlugin as t}from"./dashboard.js";import{coreframeDevJobsPlugin as n}from"./dev-jobs.js";import{coreframeDevelopmentControlsPlugin as r}from"./development-controls.js";import{coreframeEnvironmentPlugin as i}from"./environment.js";import{coreframeFaviconPlugin as a}from"./favicon.js";import{coreframeFlutterDevToolsPlugin as o}from"./flutter-devtools.js";import{t as s}from"../icons-vb_lG-av.js";import{coreframeManagedDevPlugin as c}from"./managed-dev.js";import{coreframePreviewPlugin as l}from"./preview.js";import{coreframeStartupTimingPlugin as u}from"./startup-timing.js";import{t as d}from"../worktree-head-BZrhW1-Q.js";function f(f={}){return[u(),i(),l(f.config??{}),e(),...s(),r(),o(),n(),c(),d(),t(),...a(f.webManifest===void 0?void 0:{webManifest:f.webManifest})]}export{f as coreframeVitePreset};
@@ -1 +1 @@
1
- function e(e){return{name:`coreframe:preview`,config(t,n){let r=process.env.COREFRAME_ENV===`preview`||n.mode===`preview`?`preview`:n.command===`serve`?`development`:`production`;if(n.mode!==`preview`)return{define:{"import.meta.env.COREFRAME_ENV":JSON.stringify(r)}};let i=e.preview??{},a=i.tunnel?[i.tunnel.hostname]:void 0,o=i.appOrigin?{origin:i.appOrigin}:void 0;return{define:{"import.meta.env.COREFRAME_ENV":JSON.stringify(r)},preview:{allowedHosts:a,cors:o,host:i.host,port:i.port,strictPort:i.strictPort??!0}}}}}export{e as coreframePreviewPlugin};
1
+ function e(e){return{name:`coreframe:preview`,config(t,n){if(n.mode!==`preview`)return;let r=e.preview??{};return{preview:{allowedHosts:r.tunnel?[r.tunnel.hostname]:void 0,cors:r.appOrigin?{origin:r.appOrigin}:void 0,host:r.host,port:r.port,strictPort:r.strictPort??!0}}}}}export{e as coreframePreviewPlugin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/vite",
3
- "version": "0.2.29",
3
+ "version": "0.2.30",
4
4
  "description": "Vite plugins and build integrations for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,14 +57,14 @@
57
57
  "obug": "^2.1.3",
58
58
  "unplugin": "^2.3.11",
59
59
  "vite-plugin-hashed-favicons": "^2.1.1",
60
- "@coreframe/config": "^0.1.11",
61
- "@coreframe/assets": "^0.1.14",
62
- "@coreframe/dashboard": "^0.3.14",
60
+ "@coreframe/assets": "^0.1.15",
61
+ "@coreframe/config": "^0.1.12",
62
+ "@coreframe/dashboard": "^0.3.15",
63
+ "@coreframe/dev": "^0.1.19",
63
64
  "@coreframe/dev-contracts": "^0.1.8",
64
- "@coreframe/flutter-js": "^0.1.26",
65
- "@coreframe/flutter-tools": "^0.1.21",
66
- "@coreframe/lib": "^0.2.14",
67
- "@coreframe/dev": "^0.1.18"
65
+ "@coreframe/flutter-js": "^0.1.27",
66
+ "@coreframe/lib": "^0.2.15",
67
+ "@coreframe/flutter-tools": "^0.1.22"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@tsdown/css": "0.22.3",