@orieljs/framework 0.1.0-alpha.12 → 0.1.0-alpha.14

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 (44) hide show
  1. package/dist/{chunk-MURTCTRH.js → chunk-4NCMY3ZS.js} +48 -2
  2. package/dist/chunk-4NCMY3ZS.js.map +1 -0
  3. package/dist/{chunk-HTJKT2R2.js → chunk-BKA5F3TH.js} +1 -1
  4. package/dist/{chunk-HTJKT2R2.js.map → chunk-BKA5F3TH.js.map} +1 -1
  5. package/dist/{chunk-7NA4HALO.js → chunk-UBSIBGXR.js} +236 -54
  6. package/dist/chunk-UBSIBGXR.js.map +1 -0
  7. package/dist/{chunk-24673JQF.js → chunk-X4N74JDO.js} +98 -4
  8. package/dist/chunk-X4N74JDO.js.map +1 -0
  9. package/dist/contracts.d.ts +11 -1
  10. package/dist/contracts.js +1 -1
  11. package/dist/{index.d-WQpfdIbG.d.ts → index.d-lffxurFs.d.ts} +10 -1
  12. package/dist/index.d.ts +363 -19
  13. package/dist/index.js +1193 -189
  14. package/dist/index.js.map +1 -1
  15. package/dist/{jsx-runtime-6um4Mwfb.d.ts → jsx-runtime-Bc5KJzwb.d.ts} +1 -1
  16. package/dist/jsx-runtime.d.ts +2 -2
  17. package/dist/jsx-runtime.js +3 -3
  18. package/dist/{testing-CKwfWJGn.d.ts → testing-CVpo7aRl.d.ts} +46 -7
  19. package/dist/testing.d.ts +2 -2
  20. package/dist/testing.js +5 -3
  21. package/docs/authentication.md +42 -1
  22. package/docs/console.md +17 -6
  23. package/docs/database-testing.md +21 -0
  24. package/docs/database.md +12 -0
  25. package/docs/deployment.md +33 -6
  26. package/docs/encryption.md +2 -0
  27. package/docs/installation.md +2 -1
  28. package/docs/live-tests.md +20 -0
  29. package/docs/live.md +22 -0
  30. package/docs/navigation.json +4 -0
  31. package/docs/pagination.md +10 -0
  32. package/docs/routing.md +1 -1
  33. package/docs/scheduling.md +3 -0
  34. package/docs/session.md +19 -2
  35. package/docs/starter-kits.md +4 -0
  36. package/docs/storage.md +44 -5
  37. package/docs/testing.md +9 -6
  38. package/docs/two-factor.md +192 -0
  39. package/docs/views.md +2 -0
  40. package/docs/vite.md +1 -1
  41. package/package.json +56 -38
  42. package/dist/chunk-24673JQF.js.map +0 -1
  43. package/dist/chunk-7NA4HALO.js.map +0 -1
  44. package/dist/chunk-MURTCTRH.js.map +0 -1
@@ -2,7 +2,7 @@ import {
2
2
  Application,
3
3
  ConfigRepository,
4
4
  Container
5
- } from "./chunk-HTJKT2R2.js";
5
+ } from "./chunk-BKA5F3TH.js";
6
6
 
7
7
  // ../Container/dist/index.js
8
8
  import { AsyncLocalStorage } from "async_hooks";
@@ -1137,6 +1137,8 @@ function collect(items = []) {
1137
1137
  // ../Support/dist/index.js
1138
1138
  import { randomBytes, randomUUID } from "crypto";
1139
1139
  import pluralize from "pluralize";
1140
+ import { existsSync } from "fs";
1141
+ import { join } from "path";
1140
1142
  import { setTimeout as sleep } from "timers/promises";
1141
1143
  var __defProp = Object.defineProperty;
1142
1144
  var __export = (target, all) => {
@@ -3001,6 +3003,48 @@ function facade(abstract, extras) {
3001
3003
  });
3002
3004
  return proxy;
3003
3005
  }
3006
+ var MissingPackageError = class extends Error {
3007
+ constructor(packageName, neededFor, command) {
3008
+ super(`${neededFor} needs the ${packageName} package. Install it with: ${command}`);
3009
+ this.packageName = packageName;
3010
+ this.neededFor = neededFor;
3011
+ this.command = command;
3012
+ }
3013
+ packageName;
3014
+ neededFor;
3015
+ command;
3016
+ name = "MissingPackageError";
3017
+ };
3018
+ var ADD = { pnpm: "pnpm add", yarn: "yarn add", bun: "bun add", npm: "npm install" };
3019
+ var LOCKFILES = [
3020
+ ["pnpm-lock.yaml", "pnpm"],
3021
+ ["yarn.lock", "yarn"],
3022
+ ["bun.lock", "bun"],
3023
+ ["bun.lockb", "bun"],
3024
+ ["package-lock.json", "npm"]
3025
+ ];
3026
+ function installCommand(packageName, options = {}) {
3027
+ const { env = process.env, cwd = process.cwd() } = options;
3028
+ const agent = /^(pnpm|yarn|bun|npm)\//.exec(env.npm_config_user_agent ?? "")?.[1];
3029
+ const manager = agent ?? LOCKFILES.find(([file]) => existsSync(join(cwd, file)))?.[1] ?? "npm";
3030
+ return `${ADD[manager]} ${packageName}`;
3031
+ }
3032
+ function isMissing(error, packageName) {
3033
+ if (!(error instanceof Error)) return false;
3034
+ const { code } = error;
3035
+ const notFound = code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND" || error.message.startsWith("Failed to load url ");
3036
+ if (!notFound) return false;
3037
+ const name = packageName.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
3038
+ return new RegExp(`(?:package|module|url) ['"]?${name}(?:['"\\s]|$)`).test(error.message);
3039
+ }
3040
+ async function importOptional(packageName, neededFor, load) {
3041
+ try {
3042
+ return await load();
3043
+ } catch (error) {
3044
+ if (isMissing(error, packageName)) throw new MissingPackageError(packageName, neededFor, installCommand(packageName));
3045
+ throw error;
3046
+ }
3047
+ }
3004
3048
  var ClassRegistry = class {
3005
3049
  byName = /* @__PURE__ */ new Map();
3006
3050
  byClass = /* @__PURE__ */ new Map();
@@ -3220,6 +3264,8 @@ export {
3220
3264
  Arr,
3221
3265
  ServiceProvider,
3222
3266
  facade,
3267
+ MissingPackageError,
3268
+ importOptional,
3223
3269
  ClassRegistry,
3224
3270
  app,
3225
3271
  config,
@@ -3250,4 +3296,4 @@ export {
3250
3296
  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
3251
3297
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3252
3298
  */
3253
- //# sourceMappingURL=chunk-MURTCTRH.js.map
3299
+ //# sourceMappingURL=chunk-4NCMY3ZS.js.map