@hywax/cms 0.0.9 → 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 +1 -1
- package/dist/module.mjs +17 -15
- package/package.json +7 -1
- package/.nuxt/cms/http-codes.ts +0 -8
package/dist/module.json
CHANGED
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.
|
|
9
|
+
const version = "0.0.11";
|
|
10
10
|
|
|
11
11
|
function createContext(options, nuxt) {
|
|
12
12
|
const { resolve } = createResolver(import.meta.url);
|
|
@@ -48,8 +48,14 @@ function transformHttpCodes(httpCodes) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function prepareAutoImports({ resolve, options, nuxt }) {
|
|
51
|
-
const httpCodesPath =
|
|
51
|
+
const httpCodesPath = "#cms/http-codes";
|
|
52
52
|
const httpCodesImports = transformHttpCodes(options.httpCodes).map(({ code }) => ({ name: code, from: httpCodesPath }));
|
|
53
|
+
const sharedUtils = [
|
|
54
|
+
"avatar",
|
|
55
|
+
"dictionaries",
|
|
56
|
+
"image",
|
|
57
|
+
"slugify"
|
|
58
|
+
].map((name) => ({ name, from: resolve(`./runtime/utils/${name}`) }));
|
|
53
59
|
addComponentsDir({
|
|
54
60
|
path: resolve("./runtime/components"),
|
|
55
61
|
pathPrefix: false,
|
|
@@ -64,25 +70,22 @@ function prepareAutoImports({ resolve, options, nuxt }) {
|
|
|
64
70
|
});
|
|
65
71
|
addPlugin(resolve("./runtime/plugins/api"));
|
|
66
72
|
addImports([
|
|
67
|
-
...
|
|
73
|
+
...sharedUtils,
|
|
68
74
|
{ name: "docToMarkdown", from: resolve("./runtime/editor/markdown") },
|
|
69
75
|
{ name: "markdownToDoc", from: resolve("./runtime/editor/markdown") }
|
|
70
76
|
]);
|
|
71
77
|
addImportsDir([
|
|
72
|
-
resolve("./runtime/composables")
|
|
73
|
-
resolve("./runtime/utils")
|
|
78
|
+
resolve("./runtime/composables")
|
|
74
79
|
]);
|
|
75
80
|
addServerImports([
|
|
76
81
|
...httpCodesImports,
|
|
82
|
+
...sharedUtils,
|
|
77
83
|
{ name: "docToMarkdown", from: resolve("./runtime/editor/markdown") },
|
|
78
84
|
{ name: "markdownToDoc", from: resolve("./runtime/editor/markdown") }
|
|
79
85
|
]);
|
|
80
86
|
addServerImportsDir([
|
|
81
|
-
resolve("./runtime/utils"),
|
|
82
87
|
resolve("./runtime/server/utils")
|
|
83
88
|
]);
|
|
84
|
-
nuxt.options.nitro.alias ||= {};
|
|
85
|
-
nuxt.options.nitro.alias["#cms/http-codes"] = httpCodesPath;
|
|
86
89
|
nuxt.options.alias["#cms"] = resolve("./runtime");
|
|
87
90
|
nuxt.options.appConfig.cms = defu(nuxt.options.appConfig.cms || {}, defaultCMSConfig);
|
|
88
91
|
}
|
|
@@ -513,9 +516,12 @@ declare module '@nuxt/schema' {
|
|
|
513
516
|
export {}
|
|
514
517
|
`
|
|
515
518
|
});
|
|
519
|
+
return templates;
|
|
520
|
+
}
|
|
521
|
+
function getServerTemplates({ options }) {
|
|
522
|
+
const templates = [];
|
|
516
523
|
templates.push({
|
|
517
|
-
filename: "cms/http-codes
|
|
518
|
-
write: true,
|
|
524
|
+
filename: "#cms/http-codes",
|
|
519
525
|
getContents: () => {
|
|
520
526
|
const httpCodes = transformHttpCodes(options.httpCodes);
|
|
521
527
|
const content = httpCodes.map(({ code, value }) => `export const ${code} = '${value}'`).join("\n");
|
|
@@ -525,13 +531,9 @@ export {}
|
|
|
525
531
|
});
|
|
526
532
|
return templates;
|
|
527
533
|
}
|
|
528
|
-
function getServerTemplates(_context) {
|
|
529
|
-
const templates = [];
|
|
530
|
-
return templates;
|
|
531
|
-
}
|
|
532
534
|
function prepareTemplates(context) {
|
|
533
535
|
const appTemplates = getAppTemplates(context);
|
|
534
|
-
const serverTemplates = getServerTemplates();
|
|
536
|
+
const serverTemplates = getServerTemplates(context);
|
|
535
537
|
for (const template of appTemplates) {
|
|
536
538
|
if (template.filename.endsWith(".d.ts")) {
|
|
537
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.
|
|
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",
|
|
@@ -96,6 +96,12 @@
|
|
|
96
96
|
"resolutions": {
|
|
97
97
|
"@hywax/cms": "workspace:*"
|
|
98
98
|
},
|
|
99
|
+
"ignoredBuiltDependencies": [
|
|
100
|
+
"@parcel/watcher",
|
|
101
|
+
"@tailwindcss/oxide",
|
|
102
|
+
"esbuild",
|
|
103
|
+
"vue-demi"
|
|
104
|
+
],
|
|
99
105
|
"lint-staged": {
|
|
100
106
|
"*.ts": "pnpm run lint"
|
|
101
107
|
},
|
package/.nuxt/cms/http-codes.ts
DELETED
|
@@ -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: Сервис недоступен'
|