@yongdall/init 0.1.0 → 0.3.0

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/index.d.mts CHANGED
@@ -1,4 +1,13 @@
1
1
  //#region packages/init/index.d.mts
2
- declare const development: boolean;
2
+ /**
3
+ *
4
+ * @param {object} env
5
+ * @param {boolean} [env.development]
6
+ */
7
+ declare function init({
8
+ development
9
+ }: {
10
+ development?: boolean | undefined;
11
+ }): Promise<void>;
3
12
  //#endregion
4
- export { development };
13
+ export { init as default };
package/index.mjs CHANGED
@@ -1,14 +1,23 @@
1
1
  import { setDevelopment } from "@yongdall/model";
2
- import { boot, tenant } from "@yongdall/configuration";
2
+ import { loadBoot, loadTenant } from "@yongdall/configuration";
3
+ import { loadPluginProfiles } from "@yongdall/plugins";
3
4
  import initSystem from "@yongdall/core";
4
- import { loadHooks } from "@yongdall/load";
5
5
 
6
6
  //#region packages/init/index.mjs
7
- const argv = process.argv.slice(2);
8
- const development = argv.includes("--development");
9
- if (development) setDevelopment(true);
10
- initSystem(tenant, boot, await loadHooks());
7
+ /**
8
+ *
9
+ * @param {object} env
10
+ * @param {boolean} [env.development]
11
+ */
12
+ async function init({ development }) {
13
+ if (development) setDevelopment(true);
14
+ /** @type {Record<string, any>} */
15
+ const hooks = Object.create(null);
16
+ for await (const [plugin, config] of loadPluginProfiles("hooks")) hooks[plugin] = config;
17
+ const [tenant, boot] = await Promise.all([loadTenant(), loadBoot()]);
18
+ initSystem(tenant, boot, hooks);
19
+ }
11
20
 
12
21
  //#endregion
13
- export { development };
22
+ export { init as default };
14
23
  //# sourceMappingURL=index.mjs.map
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../packages/init/index.mjs"],"sourcesContent":["import { setDevelopment } from '@yongdall/model';\nimport { boot, tenant } from '@yongdall/configuration';\nimport initSystem from '@yongdall/core';\nimport { loadHooks } from '@yongdall/load';\nconst argv = process.argv.slice(2);\nexport const development = argv.includes('--development');\nif (development) {\n\tsetDevelopment(true);\n}\n\nconst pluginHooks = await loadHooks();\n\ninitSystem(tenant, boot, pluginHooks);\n"],"mappings":";;;;;;AAIA,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE;AAClC,MAAa,cAAc,KAAK,SAAS,gBAAgB;AACzD,IAAI,YACH,gBAAe,KAAK;AAKrB,WAAW,QAAQ,MAFC,MAAM,WAAW,CAEA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../packages/init/index.mjs"],"sourcesContent":["import { setDevelopment } from '@yongdall/model';\nimport { loadBoot, loadTenant } from '@yongdall/configuration';\nimport { loadPluginProfiles } from '@yongdall/plugins';\nimport initSystem from '@yongdall/core';\n\n/**\n * \n * @param {object} env \n * @param {boolean} [env.development]\n */\nexport default async function init({ development }) {\n\tif (development) {\n\t\tsetDevelopment(true);\n\t}\n\t/** @type {Record<string, any>} */\n\tconst hooks = Object.create(null);\n\tfor await (const [plugin, config] of loadPluginProfiles('hooks')) {\n\t\thooks[plugin] = config;\n\t}\n\tconst [tenant, boot] = await Promise.all([\n\t\tloadTenant(),\n\t\tloadBoot(),\n\t])\n\tinitSystem(tenant, boot, hooks);\n}\n"],"mappings":";;;;;;;;;;;AAUA,eAA8B,KAAK,EAAE,eAAe;AACnD,KAAI,YACH,gBAAe,KAAK;;CAGrB,MAAM,QAAQ,OAAO,OAAO,KAAK;AACjC,YAAW,MAAM,CAAC,QAAQ,WAAW,mBAAmB,QAAQ,CAC/D,OAAM,UAAU;CAEjB,MAAM,CAAC,QAAQ,QAAQ,MAAM,QAAQ,IAAI,CACxC,YAAY,EACZ,UAAU,CACV,CAAC;AACF,YAAW,QAAQ,MAAM,MAAM"}
package/package.json CHANGED
@@ -5,19 +5,18 @@
5
5
  "exports": {
6
6
  ".": "./index.mjs"
7
7
  },
8
- "version": "0.1.0",
8
+ "version": "0.3.0",
9
9
  "description": "",
10
10
  "keywords": [],
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@yongdall/plugins": "^0.1.0",
15
- "@yongdall/assets": "^0.1.0",
16
- "@yongdall/configuration": "^0.1.0",
17
- "@yongdall/model": "^0.1.0",
18
- "@yongdall/core": "^0.1.0",
19
- "@yongdall/connection": "^0.1.0",
20
- "@yongdall/load": "^0.1.0"
14
+ "@yongdall/plugins": "^0.3.0",
15
+ "@yongdall/assets": "^0.3.0",
16
+ "@yongdall/configuration": "^0.3.0",
17
+ "@yongdall/model": "^0.3.0",
18
+ "@yongdall/core": "^0.3.0",
19
+ "@yongdall/connection": "^0.3.0"
21
20
  },
22
21
  "devDependencies": {}
23
22
  }