@absolutejs/absolute 0.19.0-beta.1012 → 0.19.0-beta.1013

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-sziwrI/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-qYjAlK/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-sziwrI/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-qYjAlK/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-sziwrI/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-qYjAlK/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/cli/index.js CHANGED
@@ -589,7 +589,13 @@ __export(exports_devCert, {
589
589
  hasCert: () => hasCert,
590
590
  ensureDevCert: () => ensureDevCert
591
591
  });
592
- import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync5, rmSync } from "fs";
592
+ import {
593
+ copyFileSync,
594
+ existsSync as existsSync4,
595
+ mkdirSync as mkdirSync3,
596
+ readFileSync as readFileSync5,
597
+ rmSync
598
+ } from "fs";
593
599
  import { platform as platform2 } from "os";
594
600
  import { join as join4 } from "path";
595
601
  var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`), devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`), certFilesExist = () => existsSync4(CERT_PATH) && existsSync4(KEY_PATH), isCertExpired = () => {
@@ -776,6 +782,58 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, devLog = (msg) => c
776
782
  return false;
777
783
  }
778
784
  return true;
785
+ }, isWSL = () => {
786
+ if (platform2() !== "linux")
787
+ return false;
788
+ try {
789
+ return /microsoft|wsl/i.test(readFileSync5("/proc/version", "utf-8"));
790
+ } catch {
791
+ return false;
792
+ }
793
+ }, runCapture = (cmd) => {
794
+ try {
795
+ const result = Bun.spawnSync(cmd, { stderr: "pipe", stdout: "pipe" });
796
+ if (result.exitCode !== 0)
797
+ return null;
798
+ const out = new TextDecoder().decode(result.stdout).trim();
799
+ return out || null;
800
+ } catch {
801
+ return null;
802
+ }
803
+ }, mkcertCaRoot = () => runCapture(["mkcert", "-CAROOT"]), toWindowsPath = (linuxPath) => runCapture(["wslpath", "-w", linuxPath]), windowsTempDir = () => {
804
+ const winTemp = runCapture(["cmd.exe", "/c", "echo %TEMP%"]);
805
+ if (!winTemp)
806
+ return null;
807
+ return runCapture(["wslpath", "-u", winTemp]);
808
+ }, trustCaOnWindows = () => {
809
+ const caRoot = mkcertCaRoot();
810
+ if (!caRoot)
811
+ return false;
812
+ const rootCa = join4(caRoot, "rootCA.pem");
813
+ if (!existsSync4(rootCa))
814
+ return false;
815
+ const winTemp = windowsTempDir();
816
+ if (!winTemp)
817
+ return false;
818
+ const staged = join4(winTemp, "absolutejs-mkcert-rootCA.crt");
819
+ try {
820
+ copyFileSync(rootCa, staged);
821
+ } catch {
822
+ return false;
823
+ }
824
+ const stagedWin = toWindowsPath(staged);
825
+ if (!stagedWin) {
826
+ rmSync(staged, { force: true });
827
+ return false;
828
+ }
829
+ const result = Bun.spawnSync([
830
+ "powershell.exe",
831
+ "-NoProfile",
832
+ "-Command",
833
+ `Import-Certificate -FilePath '${stagedWin}' -CertStoreLocation Cert:\\CurrentUser\\Root`
834
+ ], { stderr: "pipe", stdout: "pipe" });
835
+ rmSync(staged, { force: true });
836
+ return result.exitCode === 0;
779
837
  }, setupMkcert = () => {
780
838
  if (!ensureMkcert())
781
839
  return false;
@@ -788,6 +846,18 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, devLog = (msg) => c
788
846
  devWarn("Failed to install local CA");
789
847
  return false;
790
848
  }
849
+ if (isWSL()) {
850
+ if (trustCaOnWindows()) {
851
+ devLog("Trusted the local CA in the Windows store \u2014 Chrome/Edge on Windows now accept dev HTTPS");
852
+ } else {
853
+ const caRoot = mkcertCaRoot();
854
+ const hint = caRoot ? toWindowsPath(join4(caRoot, "rootCA.pem")) : null;
855
+ devWarn("Could not auto-trust the local CA on Windows; Windows browsers may warn.");
856
+ if (hint) {
857
+ console.log(` Run in PowerShell: Import-Certificate -FilePath "${hint}" -CertStoreLocation Cert:\\CurrentUser\\Root`);
858
+ }
859
+ }
860
+ }
791
861
  rmSync(CERT_PATH, { force: true });
792
862
  rmSync(KEY_PATH, { force: true });
793
863
  mkdirSync3(CERT_DIR, { recursive: true });
@@ -1278,7 +1348,7 @@ var init_build = __esm(() => {
1278
1348
  });
1279
1349
 
1280
1350
  // src/build/externalAssetPlugin.ts
1281
- import { copyFileSync, existsSync as existsSync10, mkdirSync as mkdirSync6, statSync } from "fs";
1351
+ import { copyFileSync as copyFileSync2, existsSync as existsSync10, mkdirSync as mkdirSync6, statSync } from "fs";
1282
1352
  import { basename as basename2, dirname as dirname3, join as join9, resolve as resolve10 } from "path";
1283
1353
  var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
1284
1354
  name: "absolute-external-asset",
@@ -1308,7 +1378,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
1308
1378
  if (existsSync10(targetPath))
1309
1379
  continue;
1310
1380
  mkdirSync6(dirname3(targetPath), { recursive: true });
1311
- copyFileSync(assetPath, targetPath);
1381
+ copyFileSync2(assetPath, targetPath);
1312
1382
  }
1313
1383
  return;
1314
1384
  });
@@ -3265,9 +3335,9 @@ var dev = async (serverEntry, configPath2) => {
3265
3335
  const openInBrowser = async () => {
3266
3336
  const url = `http://${resolvedDev.host === "0.0.0.0" ? "localhost" : resolvedDev.host}:${port}`;
3267
3337
  const { platform: platform3 } = process;
3268
- const isWSL = platform3 === "linux" && isWSLEnvironment();
3338
+ const isWSL2 = platform3 === "linux" && isWSLEnvironment();
3269
3339
  let cmd;
3270
- if (isWSL) {
3340
+ if (isWSL2) {
3271
3341
  cmd = "cmd.exe";
3272
3342
  } else if (platform3 === "darwin") {
3273
3343
  cmd = "open";
@@ -3276,7 +3346,7 @@ var dev = async (serverEntry, configPath2) => {
3276
3346
  } else {
3277
3347
  cmd = "xdg-open";
3278
3348
  }
3279
- const args = isWSL ? ["/c", "start", url] : [url];
3349
+ const args = isWSL2 ? ["/c", "start", url] : [url];
3280
3350
  try {
3281
3351
  Bun.spawn([cmd, ...args], {
3282
3352
  stderr: "ignore",
@@ -5647,9 +5717,9 @@ var workspace = async (subcommand, options) => {
5647
5717
  return;
5648
5718
  }
5649
5719
  const { platform: platform5 } = process;
5650
- const isWSL = platform5 === "linux" && isWSLEnvironment();
5720
+ const isWSL2 = platform5 === "linux" && isWSLEnvironment();
5651
5721
  let cmd;
5652
- if (isWSL) {
5722
+ if (isWSL2) {
5653
5723
  cmd = "cmd.exe";
5654
5724
  } else if (platform5 === "darwin") {
5655
5725
  cmd = "open";
@@ -5658,7 +5728,7 @@ var workspace = async (subcommand, options) => {
5658
5728
  } else {
5659
5729
  cmd = "xdg-open";
5660
5730
  }
5661
- const args = isWSL ? ["/c", "start", url] : [url];
5731
+ const args = isWSL2 ? ["/c", "start", url] : [url];
5662
5732
  try {
5663
5733
  Bun.spawn([cmd, ...args], {
5664
5734
  stderr: "ignore",
package/dist/index.js CHANGED
@@ -29148,7 +29148,13 @@ import { argv } from "process";
29148
29148
  var {env: env4 } = globalThis.Bun;
29149
29149
 
29150
29150
  // src/dev/devCert.ts
29151
- import { existsSync as existsSync38, mkdirSync as mkdirSync17, readFileSync as readFileSync32, rmSync as rmSync4 } from "fs";
29151
+ import {
29152
+ copyFileSync as copyFileSync3,
29153
+ existsSync as existsSync38,
29154
+ mkdirSync as mkdirSync17,
29155
+ readFileSync as readFileSync32,
29156
+ rmSync as rmSync4
29157
+ } from "fs";
29152
29158
  import { join as join46 } from "path";
29153
29159
  var CERT_DIR = join46(process.cwd(), ".absolutejs");
29154
29160
  var CERT_PATH = join46(CERT_DIR, "cert.pem");
@@ -35853,5 +35859,5 @@ export {
35853
35859
  ANGULAR_INIT_TIMEOUT_MS
35854
35860
  };
35855
35861
 
35856
- //# debugId=E2B3E7F15839C01C64756E2164756E21
35862
+ //# debugId=9BA6CEB425584CC564756E2164756E21
35857
35863
  //# sourceMappingURL=index.js.map