erudit 3.0.0-dev.6 → 3.0.0-dev.8
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/app/components/SiteMain.vue +2 -3
- package/app/components/aside/minor/topic/TopicToc.vue +1 -1
- package/app/components/bitran/BitranContent.vue +10 -3
- package/app/components/main/topic/MainTopic.vue +1 -2
- package/app/components/main/utils/Breadcrumb.vue +1 -6
- package/app/components/main/utils/ContentPopovers.vue +11 -5
- package/app/components/preview/display/Unique.vue +7 -1
- package/app/composables/bitran.ts +11 -35
- package/app/composables/bitranContent.ts +16 -4
- package/app/composables/bitranLocation.ts +1 -1
- package/app/pages/group/[...groupId].vue +3 -4
- package/app/scripts/preview/data/unique.ts +6 -5
- package/bin/erudit.mjs +2 -0
- package/module/bitran.ts +3 -2
- package/module/config.ts +2 -1
- package/module/index.ts +5 -5
- package/nuxt.config.ts +8 -2
- package/package.json +13 -9
- package/server/api/aside/major/nav/global.ts +1 -1
- package/server/api/aside/minor/path.ts +1 -2
- package/server/api/preview/page/[...parts].ts +3 -2
- package/server/api/preview/unique/[location].ts +6 -3
- package/server/plugin/bitran/content.ts +49 -42
- package/server/plugin/bitran/location.ts +1 -1
- package/server/plugin/bitran/products/include.ts +13 -15
- package/server/plugin/bitran/products/link.ts +12 -12
- package/server/plugin/bitran/setup.ts +1 -1
- package/server/plugin/bitran/toc.ts +21 -29
- package/server/plugin/bitran/transpiler.ts +2 -20
- package/server/plugin/build/jobs/content/parse.ts +19 -10
- package/server/plugin/build/setup.ts +1 -0
- package/server/plugin/content/absoluteId.ts +1 -1
- package/server/plugin/content/context.ts +1 -1
- package/server/plugin/db/entities/Content.ts +1 -1
- package/shared/aside/minor.ts +2 -1
- package/shared/bitran/stringContent.ts +6 -0
- package/shared/icons.ts +1 -1
- package/shared/link.ts +5 -2
- package/tsconfig.json +1 -1
- package/shared/bitran/context.ts +0 -8
- package/shared/bitran/default.ts +0 -46
- package/shared/bitran/link/Link.vue +0 -166
- package/shared/bitran/link/factory.ts +0 -24
- package/shared/bitran/link/icon.svg +0 -3
- package/shared/bitran/link/languages/en.ts +0 -7
- package/shared/bitran/link/languages/ru.ts +0 -7
- package/shared/bitran/link/renderer.ts +0 -21
- package/shared/bitran/link/shared.ts +0 -17
- package/shared/bitran/link/target.ts +0 -134
- package/shared/bitran/link/transpiler.ts +0 -10
- package/shared/bitran/location.ts +0 -166
- package/test/bitran/link/target.test.ts +0 -141
- package/test/bitran/location.test.ts +0 -143
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
<style lang="scss" module>
|
|
13
13
|
@use '$/def/bp';
|
|
14
|
-
@use '@bitran-js/renderer-vue/scss/def' as bitranDef;
|
|
15
14
|
|
|
16
15
|
.main {
|
|
17
16
|
--_pMainBase: var(--gapBig);
|
|
@@ -24,8 +23,8 @@
|
|
|
24
23
|
font-size: 18px;
|
|
25
24
|
|
|
26
25
|
@include bp.below('mobile') {
|
|
27
|
-
--_pMainBase:
|
|
28
|
-
font-size:
|
|
26
|
+
--_pMainBase: var(--_bitran_asideWidth);
|
|
27
|
+
font-size: 14px;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
.mainInner {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { headingName } from '@erudit-js/bitran-elements/heading/shared';
|
|
3
3
|
|
|
4
|
-
import { stringifyBitranLocation } from '@
|
|
4
|
+
import { stringifyBitranLocation } from '@erudit-js/cog/schema';
|
|
5
5
|
import type { TocItem } from '@erudit/shared/bitran/toc';
|
|
6
6
|
import { topicLocation } from '@app/scripts/aside/minor/topic';
|
|
7
7
|
import { injectAsideData } from '@app/scripts/aside/minor/state';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { Bitran, type BitranContent } from '@bitran-js/renderer-vue';
|
|
3
|
+
import type { BitranContext } from '@erudit-js/cog/schema';
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
+
import eruditConfig from '#erudit/config';
|
|
5
6
|
|
|
6
7
|
import RenderWrapper from './RenderWrapper.vue';
|
|
7
8
|
|
|
@@ -36,15 +37,16 @@ const isServer = import.meta.server;
|
|
|
36
37
|
:RenderWrapper
|
|
37
38
|
:isDev
|
|
38
39
|
:isServer
|
|
40
|
+
:language="eruditConfig.language"
|
|
39
41
|
/>
|
|
40
42
|
</template>
|
|
41
43
|
|
|
42
44
|
<style lang="scss" module>
|
|
43
|
-
@use '
|
|
45
|
+
@use '$/def/bp';
|
|
44
46
|
|
|
45
47
|
.eruditBitranContainer {
|
|
46
48
|
padding: var(--_pMainY) var(--_pMainX);
|
|
47
|
-
padding-left: calc(var(--_pMainX) -
|
|
49
|
+
padding-left: calc(var(--_pMainX) - var(--_bitran_asideWidth));
|
|
48
50
|
|
|
49
51
|
// Setting up Bitran
|
|
50
52
|
|
|
@@ -64,7 +66,12 @@ const isServer = import.meta.server;
|
|
|
64
66
|
--bitran_textMuted: var(--textMuted);
|
|
65
67
|
--bitran_textDimmed: var(--textDimmed);
|
|
66
68
|
--bitran_textDisabled: var(--textDisabled);
|
|
69
|
+
--bitran_textDeep: var(--textDeep);
|
|
67
70
|
|
|
68
71
|
--bitran_colorBrand: var(--brand);
|
|
72
|
+
|
|
73
|
+
@include bp.below('mobile') {
|
|
74
|
+
--bitran_gapBlocks: calc(22px);
|
|
75
|
+
}
|
|
69
76
|
}
|
|
70
77
|
</style>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type
|
|
3
|
-
import { NO_ALIASES } from '@erudit-js/bitran-elements/aliases/shared';
|
|
2
|
+
import { NO_ALIASES, type TopicPart } from '@erudit-js/cog/schema';
|
|
4
3
|
|
|
5
4
|
import eruditConfig from '#erudit/config';
|
|
6
5
|
|
|
@@ -56,18 +56,13 @@ function getIcon(contextIcon: string) {
|
|
|
56
56
|
|
|
57
57
|
@include transition(color);
|
|
58
58
|
|
|
59
|
-
// [my-icon]
|
|
60
|
-
// {
|
|
61
|
-
// position: relative;
|
|
62
|
-
// top: .6px;
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
59
|
&:hover {
|
|
66
60
|
color: var(--textMuted);
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
|
|
70
64
|
.sep {
|
|
65
|
+
flex-shrink: 0;
|
|
71
66
|
position: relative;
|
|
72
67
|
top: 0.5px;
|
|
73
68
|
}
|
|
@@ -24,7 +24,7 @@ const phrase = await usePhrases(
|
|
|
24
24
|
|
|
25
25
|
const flagData: Record<ContentFlag, PopoverData> = {
|
|
26
26
|
dev: {
|
|
27
|
-
icon: <MyIconName>'
|
|
27
|
+
icon: <MyIconName>'construction',
|
|
28
28
|
color: 'var(--warn)',
|
|
29
29
|
title: phrase.flag_dev,
|
|
30
30
|
description: phrase.flag_dev_description,
|
|
@@ -70,6 +70,7 @@ const hasPopovers = computed(() => {
|
|
|
70
70
|
<ContentPopover v-if="generic?.dependencies" :data="dependenciesData">
|
|
71
71
|
<ul :class="$style.dependenciesList">
|
|
72
72
|
<li v-for="(value, key) in generic.dependencies">
|
|
73
|
+
<MyIcon :name="'arrow-left'" wrapper="span" />
|
|
73
74
|
<NuxtLink :prefetch="false" :to="key">{{ value }}</NuxtLink>
|
|
74
75
|
</li>
|
|
75
76
|
</ul>
|
|
@@ -87,18 +88,23 @@ const hasPopovers = computed(() => {
|
|
|
87
88
|
|
|
88
89
|
.dependenciesList {
|
|
89
90
|
margin-top: var(--gapSmall);
|
|
90
|
-
list-style-type:
|
|
91
|
+
list-style-type: none;
|
|
91
92
|
list-style-position: inside;
|
|
92
93
|
padding-inline-start: 0;
|
|
93
94
|
|
|
94
95
|
li {
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
display: flex;
|
|
97
|
+
gap: var(--gapSmall);
|
|
98
|
+
align-items: center;
|
|
99
|
+
|
|
100
|
+
[my-icon] {
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
font-size: 0.95em;
|
|
103
|
+
transform: scaleX(-1);
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
a {
|
|
100
107
|
color: inherit;
|
|
101
|
-
padding-left: var(--gapSmall);
|
|
102
108
|
}
|
|
103
109
|
}
|
|
104
110
|
}
|
|
@@ -5,6 +5,9 @@ import type { PreviewDataUnique } from '@app/scripts/preview/data/unique';
|
|
|
5
5
|
import type { PreviewDisplayProps } from '@app/scripts/preview/display';
|
|
6
6
|
|
|
7
7
|
const { data } = defineProps<PreviewDisplayProps<PreviewDataUnique>>();
|
|
8
|
+
|
|
9
|
+
const bitranTranspiler = await useBitranTranspiler();
|
|
10
|
+
const root = await bitranTranspiler.parser.parse(data.bitran.content.biCode);
|
|
8
11
|
</script>
|
|
9
12
|
|
|
10
13
|
<template>
|
|
@@ -16,7 +19,10 @@ const { data } = defineProps<PreviewDisplayProps<PreviewDataUnique>>();
|
|
|
16
19
|
]"
|
|
17
20
|
>
|
|
18
21
|
<BitranContent
|
|
19
|
-
:content="
|
|
22
|
+
:content="{
|
|
23
|
+
root,
|
|
24
|
+
preRenderData: data.bitran.content.preRenderData,
|
|
25
|
+
}"
|
|
20
26
|
:context="data.bitran.context"
|
|
21
27
|
/>
|
|
22
28
|
</div>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import eruditConfig from '#erudit/config';
|
|
2
|
-
import bitranConfig from '#erudit/client/bitran';
|
|
3
|
-
|
|
4
1
|
import {
|
|
5
2
|
createPhraseCaller,
|
|
6
|
-
getDefaultRenderers,
|
|
3
|
+
getDefaultRenderers as getDefaultBitranRenderers,
|
|
7
4
|
getElementIcon,
|
|
8
5
|
type ElementVueRenderers,
|
|
9
6
|
} from '@bitran-js/renderer-vue';
|
|
@@ -12,22 +9,17 @@ import {
|
|
|
12
9
|
type BitranTranspiler,
|
|
13
10
|
type ElementTranspilers,
|
|
14
11
|
} from '@bitran-js/transpiler';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { includeTranspiler } from '@erudit-js/bitran-elements/include/transpiler';
|
|
21
|
-
import { linkName } from '@erudit/shared/bitran/link/shared';
|
|
22
|
-
import { linkTranspiler } from '@erudit/shared/bitran/link/transpiler';
|
|
23
|
-
import { aliasesRenderer } from '@erudit-js/bitran-elements/aliases/renderer';
|
|
24
|
-
import { headingRenderer } from '@erudit-js/bitran-elements/heading/renderer';
|
|
25
|
-
import { includeRenderer } from '@erudit-js/bitran-elements/include/renderer';
|
|
26
|
-
import { linkRenderer } from '@erudit/shared/bitran/link/renderer';
|
|
12
|
+
import { eruditDefaultTranspilers } from '@erudit-js/bitran-elements/defaultTranspilers';
|
|
13
|
+
import { eruditDefaultRenderers } from '@erudit-js/bitran-elements/defaultRenderers';
|
|
14
|
+
|
|
15
|
+
import eruditConfig from '#erudit/config';
|
|
16
|
+
import bitranConfig from '#erudit/client/bitran';
|
|
27
17
|
|
|
28
18
|
let bitranTranspiler!: BitranTranspiler;
|
|
29
19
|
let bitranRenderers!: ElementVueRenderers;
|
|
30
20
|
|
|
21
|
+
globalThis.useEruditConfig = () => eruditConfig;
|
|
22
|
+
|
|
31
23
|
//
|
|
32
24
|
// Transpiler
|
|
33
25
|
//
|
|
@@ -37,18 +29,9 @@ export async function useBitranTranspiler() {
|
|
|
37
29
|
|
|
38
30
|
const projectTranspilers = await getProjectTranspilers();
|
|
39
31
|
|
|
40
|
-
const defaultTranspilers = {
|
|
41
|
-
[aliasesName]: aliasesTranspiler,
|
|
42
|
-
[includeName]: includeTranspiler,
|
|
43
|
-
[headingName]: defineHeadingTranspiler({
|
|
44
|
-
language: eruditConfig?.language,
|
|
45
|
-
}),
|
|
46
|
-
[linkName]: linkTranspiler,
|
|
47
|
-
};
|
|
48
|
-
|
|
49
32
|
bitranTranspiler = defineBitranTranspiler({
|
|
50
33
|
...projectTranspilers,
|
|
51
|
-
...
|
|
34
|
+
...eruditDefaultTranspilers,
|
|
52
35
|
});
|
|
53
36
|
|
|
54
37
|
return bitranTranspiler;
|
|
@@ -75,17 +58,10 @@ export async function useBitranRenderers() {
|
|
|
75
58
|
|
|
76
59
|
const projectRenderers = await getProjectRenderers();
|
|
77
60
|
|
|
78
|
-
const defaultRenderers = {
|
|
79
|
-
[aliasesName]: aliasesRenderer,
|
|
80
|
-
[includeName]: includeRenderer,
|
|
81
|
-
[headingName]: headingRenderer,
|
|
82
|
-
[linkName]: linkRenderer,
|
|
83
|
-
};
|
|
84
|
-
|
|
85
61
|
// @ts-ignore
|
|
86
62
|
bitranRenderers = {
|
|
87
63
|
...projectRenderers,
|
|
88
|
-
...
|
|
64
|
+
...eruditDefaultRenderers,
|
|
89
65
|
};
|
|
90
66
|
|
|
91
67
|
return bitranRenderers!;
|
|
@@ -110,7 +86,7 @@ async function getProjectRenderers() {
|
|
|
110
86
|
export async function useBitranElementRenderer(productName: string) {
|
|
111
87
|
const renderer =
|
|
112
88
|
(await useBitranRenderers())[productName] ||
|
|
113
|
-
|
|
89
|
+
getDefaultBitranRenderers()[productName];
|
|
114
90
|
|
|
115
91
|
if (!renderer)
|
|
116
92
|
throw new Error(`Missing Bitran product render "${productName}"!`);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ShallowRef } from 'vue';
|
|
2
2
|
import type { BitranContent } from '@bitran-js/renderer-vue';
|
|
3
|
-
|
|
4
3
|
import {
|
|
5
4
|
encodeBitranLocation,
|
|
6
5
|
stringifyBitranLocation,
|
|
7
6
|
type BitranLocation,
|
|
8
|
-
} from '@erudit/
|
|
7
|
+
} from '@erudit-js/cog/schema';
|
|
8
|
+
import type { StringBitranContent } from '@erudit/shared/bitran/stringContent';
|
|
9
9
|
|
|
10
10
|
export async function useBitranContent(
|
|
11
11
|
location: Ref<BitranLocation | undefined>,
|
|
@@ -26,11 +26,23 @@ export async function useBitranContent(
|
|
|
26
26
|
|
|
27
27
|
const apiRoute = `/api/bitran/content/${encodeBitranLocation(stringifyBitranLocation(location.value!))}`;
|
|
28
28
|
nuxtApp.runWithContext(() => prerenderRoutes(apiRoute));
|
|
29
|
+
|
|
29
30
|
// @ts-ignore
|
|
30
31
|
contentPromise = (async () => {
|
|
31
|
-
|
|
32
|
+
const stringContent = (await $fetch(apiRoute, {
|
|
32
33
|
responseType: 'json',
|
|
33
|
-
})) as
|
|
34
|
+
})) as StringBitranContent;
|
|
35
|
+
|
|
36
|
+
const bitranTranspiler = await useBitranTranspiler();
|
|
37
|
+
const root = await bitranTranspiler.parser.parse(
|
|
38
|
+
stringContent.biCode,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
content.value = {
|
|
42
|
+
root,
|
|
43
|
+
preRenderData: stringContent.preRenderData,
|
|
44
|
+
};
|
|
45
|
+
|
|
34
46
|
return content;
|
|
35
47
|
})();
|
|
36
48
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { locationFromPath, type BitranLocation } from '@
|
|
1
|
+
import { locationFromPath, type BitranLocation } from '@erudit-js/cog/schema';
|
|
2
2
|
|
|
3
3
|
export function useBitranLocation(): ComputedRef<BitranLocation | undefined> {
|
|
4
4
|
const route = useRoute();
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { NO_ALIASES } from '@erudit-js/
|
|
3
|
-
|
|
4
|
-
import { type ContentGroupData } from '@shared/content/data/type/group';
|
|
2
|
+
import { NO_ALIASES } from '@erudit-js/cog/schema';
|
|
5
3
|
import eruditConfig from '#erudit/config';
|
|
6
4
|
|
|
5
|
+
import { type ContentGroupData } from '@shared/content/data/type/group';
|
|
6
|
+
import { locationIcon } from '@erudit/shared/icons';
|
|
7
7
|
import ContentDecoration from '@app/components/main/utils/ContentDecoration.vue';
|
|
8
8
|
import Breadcrumb from '@app/components/main/utils/Breadcrumb.vue';
|
|
9
9
|
import ContentTitle from '@app/components/main/utils/ContentTitle.vue';
|
|
10
10
|
import ContentDescription from '@app/components/main/utils/ContentDescription.vue';
|
|
11
11
|
import ContentPopovers from '@app/components/main/utils/ContentPopovers.vue';
|
|
12
12
|
import ContentSection from '@app/components/main/utils/ContentSection.vue';
|
|
13
|
-
import { locationIcon } from '@erudit/shared/icons';
|
|
14
13
|
|
|
15
14
|
const location = useBitranLocation();
|
|
16
15
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
encodeBitranLocation,
|
|
3
|
+
type BitranContext,
|
|
4
|
+
} from '@erudit-js/cog/schema';
|
|
4
5
|
|
|
5
6
|
import { PreviewDataType, type PreviewDataBase } from '../data';
|
|
6
7
|
import type { PreviewFooter } from '../footer';
|
|
7
8
|
import { PreviewRequestType, type PreviewRequest } from '../request';
|
|
8
|
-
import {
|
|
9
|
+
import type { StringBitranContent } from '@erudit/shared/bitran/stringContent';
|
|
9
10
|
|
|
10
11
|
export interface PreviewDataUnique extends PreviewDataBase {
|
|
11
12
|
type: PreviewDataType.Unique;
|
|
12
13
|
productName: string;
|
|
13
14
|
bitran: {
|
|
14
15
|
context: BitranContext;
|
|
15
|
-
content:
|
|
16
|
+
content: StringBitranContent;
|
|
16
17
|
};
|
|
17
18
|
footer: PreviewFooter;
|
|
18
19
|
}
|
package/bin/erudit.mjs
ADDED
package/module/bitran.ts
CHANGED
|
@@ -7,9 +7,10 @@ import { logger } from '@erudit/module/logger';
|
|
|
7
7
|
|
|
8
8
|
export async function setupBitranConfig(_nuxt: Nuxt) {
|
|
9
9
|
let config: Partial<EruditBitranConfig>;
|
|
10
|
+
const configPath = projectPath('bitran.config');
|
|
10
11
|
|
|
11
12
|
try {
|
|
12
|
-
const projectConfig = (await import(
|
|
13
|
+
const projectConfig = (await import(configPath)).default;
|
|
13
14
|
if (!projectConfig) throw new Error('Falsy Bitran config!');
|
|
14
15
|
config = projectConfig;
|
|
15
16
|
} catch (error) {
|
|
@@ -23,7 +24,7 @@ export async function setupBitranConfig(_nuxt: Nuxt) {
|
|
|
23
24
|
write: true,
|
|
24
25
|
getContents: () => `
|
|
25
26
|
import type { EruditBitranConfig } from '@erudit-js/cog/schema';
|
|
26
|
-
${config ? `import bitranConfig from '${
|
|
27
|
+
${config ? `import bitranConfig from '${configPath}';` : ''}
|
|
27
28
|
export default ${config ? 'bitranConfig' : '{}'} as Partial<EruditBitranConfig>;
|
|
28
29
|
`,
|
|
29
30
|
});
|
package/module/config.ts
CHANGED
|
@@ -7,9 +7,10 @@ import { logger } from '@erudit/module/logger';
|
|
|
7
7
|
|
|
8
8
|
export async function setupEruditConfig(_nuxt: Nuxt) {
|
|
9
9
|
let config: Partial<EruditConfig> = {};
|
|
10
|
+
const configPath = projectPath('erudit.config');
|
|
10
11
|
|
|
11
12
|
try {
|
|
12
|
-
const projectConfig = (await import(
|
|
13
|
+
const projectConfig = (await import(configPath)).default;
|
|
13
14
|
if (!projectConfig) throw new Error('Falsy Erudit config!');
|
|
14
15
|
config = projectConfig;
|
|
15
16
|
} catch (error) {
|
package/module/index.ts
CHANGED
|
@@ -28,15 +28,15 @@ export default defineNuxtModule({
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
{
|
|
31
|
-
// Handle sub dependencies
|
|
32
|
-
const subDeps = eruditConfig.subDeps || [];
|
|
33
|
-
|
|
34
31
|
const transpile = (_nuxt.options.build.transpile ||= []);
|
|
35
32
|
const optimizeDeps = _nuxt.options.vite.optimizeDeps || {};
|
|
36
33
|
const optimizeDepsInclude = (optimizeDeps.include ||= []);
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
const deps = eruditConfig.dependencies || {};
|
|
36
|
+
for (const [dep, options] of Object.entries(deps)) {
|
|
37
|
+
if (options?.transpile) transpile.push(dep);
|
|
38
|
+
if (options?.optimize) optimizeDepsInclude.push(dep);
|
|
39
|
+
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// TODO: Watch for contributors folder and create/update template with their IDs
|
package/nuxt.config.ts
CHANGED
|
@@ -83,8 +83,14 @@ export default defineNuxtConfig({
|
|
|
83
83
|
},
|
|
84
84
|
vite: {
|
|
85
85
|
optimizeDeps: {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
include: [
|
|
87
|
+
'yaml',
|
|
88
|
+
'@floating-ui/vue',
|
|
89
|
+
'@bitran-js/core',
|
|
90
|
+
'@bitran-js/transpiler',
|
|
91
|
+
'@bitran-js/renderer-vue',
|
|
92
|
+
'@erudit-js/bitran-elements',
|
|
93
|
+
],
|
|
88
94
|
},
|
|
89
95
|
server: { fs: { strict: false } },
|
|
90
96
|
css: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "erudit",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "🤓 CMS for perfect educational sites.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,15 +10,19 @@
|
|
|
10
10
|
"url": "git+https://github.com/erudit-js/erudit.git",
|
|
11
11
|
"directory": "packages/erudit"
|
|
12
12
|
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"erudit-cli": "bin/erudit.mjs",
|
|
15
|
+
"erudit": "bin/erudit.mjs"
|
|
16
|
+
},
|
|
13
17
|
"peerDependencies": {
|
|
14
|
-
"@erudit-js/
|
|
18
|
+
"@erudit-js/cog": "3.0.0-dev.8",
|
|
19
|
+
"@erudit-js/cli": "3.0.0-dev.8",
|
|
20
|
+
"@erudit-js/bitran-elements": "3.0.0-dev.8"
|
|
15
21
|
},
|
|
16
22
|
"dependencies": {
|
|
17
|
-
"@bitran-js/core": "1.0.0-dev.
|
|
18
|
-
"@bitran-js/renderer-vue": "1.0.0-dev.
|
|
19
|
-
"@bitran-js/transpiler": "1.0.0-dev.
|
|
20
|
-
"@erudit-js/cli": "3.0.0-dev.6",
|
|
21
|
-
"@erudit-js/cog": "3.0.0-dev.6",
|
|
23
|
+
"@bitran-js/core": "1.0.0-dev.10",
|
|
24
|
+
"@bitran-js/renderer-vue": "1.0.0-dev.10",
|
|
25
|
+
"@bitran-js/transpiler": "1.0.0-dev.10",
|
|
22
26
|
"@floating-ui/vue": "^1.1.6",
|
|
23
27
|
"chalk": "^5.4.1",
|
|
24
28
|
"chokidar": "^4.0.3",
|
|
@@ -26,9 +30,9 @@
|
|
|
26
30
|
"glob": "^11.0.1",
|
|
27
31
|
"image-size": "^1.2.0",
|
|
28
32
|
"jiti": "^2.4.2",
|
|
29
|
-
"nuxt": "3.
|
|
33
|
+
"nuxt": "3.16.1",
|
|
30
34
|
"nuxt-my-icons": "1.0.2",
|
|
31
|
-
"sass": "
|
|
35
|
+
"sass": ">=1.85.1",
|
|
32
36
|
"sqlite3": "^5.1.7",
|
|
33
37
|
"typeorm": "^0.3.21",
|
|
34
38
|
"vue": "latest",
|
|
@@ -3,5 +3,5 @@ import { ERUDIT_SERVER } from '@server/global';
|
|
|
3
3
|
import { createGlobalFrontNav } from '@server/repository/frontNav';
|
|
4
4
|
|
|
5
5
|
export default defineEventHandler(async () => {
|
|
6
|
-
return (await createGlobalFrontNav(ERUDIT_SERVER.NAV
|
|
6
|
+
return (await createGlobalFrontNav(ERUDIT_SERVER.NAV)) as FrontNav;
|
|
7
7
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isTopicPart } from '@erudit-js/cog/schema';
|
|
1
|
+
import { isTopicPart, locationFromPath } from '@erudit-js/cog/schema';
|
|
2
2
|
|
|
3
3
|
import type { AsideMinorContent, AsideMinorTopic } from '@shared/aside/minor';
|
|
4
4
|
import { getBitranToc } from '@erudit/server/plugin/bitran/toc';
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
getPreviousNext,
|
|
9
9
|
} from '@erudit/server/plugin/repository/content';
|
|
10
10
|
import { getTopicPartsLinks } from '@erudit/server/plugin/repository/topic';
|
|
11
|
-
import { locationFromPath } from '@erudit/shared/bitran/location';
|
|
12
11
|
|
|
13
12
|
export default defineEventHandler(async (event) => {
|
|
14
13
|
const query = getQuery<{ path: string }>(event);
|
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
getContributorContext,
|
|
5
5
|
} from '@erudit/server/plugin/content/context';
|
|
6
6
|
|
|
7
|
+
import type { LinkTargetPageType } from '@erudit-js/bitran-elements/link/target';
|
|
8
|
+
|
|
7
9
|
import type { PreviewDataPageLink } from '@app/scripts/preview/data/pageLink';
|
|
8
|
-
import type { LinkTargetPageType } from '@erudit/shared/bitran/link/target';
|
|
9
10
|
import type { Context, ContextItem } from '@erudit/shared/content/context';
|
|
10
11
|
|
|
11
12
|
export default defineEventHandler<Promise<PreviewDataPageLink>>(
|
|
@@ -27,7 +28,7 @@ export default defineEventHandler<Promise<PreviewDataPageLink>>(
|
|
|
27
28
|
return await getContributorContext(contentId);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
throw createError(`Can't handle "${pageType}" page type!`);
|
|
31
|
+
throw createError(`Can't handle "${pageType as any}" page type!`);
|
|
31
32
|
})();
|
|
32
33
|
|
|
33
34
|
const lastContextItem = context.pop() as ContextItem;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
stringifyBitranLocation,
|
|
3
|
+
type BitranContext,
|
|
4
|
+
} from '@erudit-js/cog/schema';
|
|
1
5
|
import type { BitranContent } from '@bitran-js/renderer-vue';
|
|
2
6
|
|
|
3
7
|
import { parseUrlLocation } from '@server/bitran/location';
|
|
@@ -7,8 +11,7 @@ import { DbUnique } from '@server/db/entities/Unique';
|
|
|
7
11
|
import { getBitranContent } from '@server/bitran/content';
|
|
8
12
|
|
|
9
13
|
import type { Context } from '@shared/content/context';
|
|
10
|
-
import type {
|
|
11
|
-
import { stringifyBitranLocation } from '@shared/bitran/location';
|
|
14
|
+
import type { StringBitranContent } from '@erudit/shared/bitran/stringContent';
|
|
12
15
|
|
|
13
16
|
interface ReturnType {
|
|
14
17
|
context: Context;
|
|
@@ -16,7 +19,7 @@ interface ReturnType {
|
|
|
16
19
|
bitran: {
|
|
17
20
|
productName: string;
|
|
18
21
|
context: BitranContext;
|
|
19
|
-
content:
|
|
22
|
+
content: StringBitranContent;
|
|
20
23
|
};
|
|
21
24
|
}
|
|
22
25
|
|