@hywax/cms 0.0.10 → 0.0.11

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/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hywax/cms",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "configKey": "cms",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -6,7 +6,7 @@ import { snakeCase, kebabCase } from 'scule';
6
6
  import { readFile, writeFile } from 'node:fs/promises';
7
7
 
8
8
  const name = "@hywax/cms";
9
- const version = "0.0.10";
9
+ const version = "0.0.11";
10
10
 
11
11
  function createContext(options, nuxt) {
12
12
  const { resolve } = createResolver(import.meta.url);
@@ -48,7 +48,7 @@ function transformHttpCodes(httpCodes) {
48
48
  }
49
49
 
50
50
  function prepareAutoImports({ resolve, options, nuxt }) {
51
- const httpCodesPath = resolve(nuxt.options.buildDir, "cms/http-codes.ts");
51
+ const httpCodesPath = "#cms/http-codes";
52
52
  const httpCodesImports = transformHttpCodes(options.httpCodes).map(({ code }) => ({ name: code, from: httpCodesPath }));
53
53
  const sharedUtils = [
54
54
  "avatar",
@@ -70,7 +70,6 @@ function prepareAutoImports({ resolve, options, nuxt }) {
70
70
  });
71
71
  addPlugin(resolve("./runtime/plugins/api"));
72
72
  addImports([
73
- ...httpCodesImports,
74
73
  ...sharedUtils,
75
74
  { name: "docToMarkdown", from: resolve("./runtime/editor/markdown") },
76
75
  { name: "markdownToDoc", from: resolve("./runtime/editor/markdown") }
@@ -87,8 +86,6 @@ function prepareAutoImports({ resolve, options, nuxt }) {
87
86
  addServerImportsDir([
88
87
  resolve("./runtime/server/utils")
89
88
  ]);
90
- nuxt.options.nitro.alias ||= {};
91
- nuxt.options.nitro.alias["#cms/http-codes"] = httpCodesPath;
92
89
  nuxt.options.alias["#cms"] = resolve("./runtime");
93
90
  nuxt.options.appConfig.cms = defu(nuxt.options.appConfig.cms || {}, defaultCMSConfig);
94
91
  }
@@ -519,9 +516,12 @@ declare module '@nuxt/schema' {
519
516
  export {}
520
517
  `
521
518
  });
519
+ return templates;
520
+ }
521
+ function getServerTemplates({ options }) {
522
+ const templates = [];
522
523
  templates.push({
523
- filename: "cms/http-codes.ts",
524
- write: true,
524
+ filename: "#cms/http-codes",
525
525
  getContents: () => {
526
526
  const httpCodes = transformHttpCodes(options.httpCodes);
527
527
  const content = httpCodes.map(({ code, value }) => `export const ${code} = '${value}'`).join("\n");
@@ -531,13 +531,9 @@ export {}
531
531
  });
532
532
  return templates;
533
533
  }
534
- function getServerTemplates(_context) {
535
- const templates = [];
536
- return templates;
537
- }
538
534
  function prepareTemplates(context) {
539
535
  const appTemplates = getAppTemplates(context);
540
- const serverTemplates = getServerTemplates();
536
+ const serverTemplates = getServerTemplates(context);
541
537
  for (const template of appTemplates) {
542
538
  if (template.filename.endsWith(".d.ts")) {
543
539
  addTypeTemplate(template);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hywax/cms",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "description": "Hywax CMS. ⚠️ This package is intended for internal use only.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,8 +0,0 @@
1
- export const HTTP_CODE_BAD_REQUEST = '400: Неверный запрос'
2
- export const HTTP_CODE_UNAUTHORIZED = '401: Не авторизован'
3
- export const HTTP_CODE_FORBIDDEN = '403: Доступ запрещен'
4
- export const HTTP_CODE_NOT_FOUND = '404: Не найдено'
5
- export const HTTP_CODE_REQUEST_TIMEOUT = '408: Время ожидания запроса истекло'
6
- export const HTTP_CODE_INTERNAL_SERVER_ERROR = '500: Внутренняя ошибка сервера'
7
- export const HTTP_CODE_BAD_GATEWAY = '502: Ошибка шлюза'
8
- export const HTTP_CODE_SERVICE_UNAVAILABLE = '503: Сервис недоступен'