@eventcatalog/core 4.1.1 → 4.1.2
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/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-C7BA7WQB.js → chunk-2HP7DWTG.js} +1 -1
- package/dist/{chunk-OXX3DBZ3.js → chunk-6MLMZ7C6.js} +1 -1
- package/dist/{chunk-5VJKDWMT.js → chunk-BAPUZSRK.js} +1 -1
- package/dist/{chunk-P2FQLNHI.js → chunk-UKC6BKFK.js} +1 -1
- package/dist/{chunk-SZTOJ5TU.js → chunk-XDI5KMKL.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +10 -10
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/astro.config.mjs +6 -1
- package/eventcatalog/src/plugins/astro-trailing-slash-endpoint-fix.ts +52 -0
- package/package.json +3 -3
|
@@ -140,7 +140,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
140
140
|
var import_os = __toESM(require("os"), 1);
|
|
141
141
|
|
|
142
142
|
// package.json
|
|
143
|
-
var version = "4.1.
|
|
143
|
+
var version = "4.1.2";
|
|
144
144
|
|
|
145
145
|
// src/constants.ts
|
|
146
146
|
var VERSION = version;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-XDI5KMKL.js";
|
|
4
|
+
import "../chunk-6MLMZ7C6.js";
|
|
5
5
|
import "../chunk-DAOXTQVS.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-BAPUZSRK.js";
|
|
7
7
|
import "../chunk-6QENHZZP.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -144,7 +144,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
144
144
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
145
145
|
|
|
146
146
|
// package.json
|
|
147
|
-
var version = "4.1.
|
|
147
|
+
var version = "4.1.2";
|
|
148
148
|
|
|
149
149
|
// src/constants.ts
|
|
150
150
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
} from "./chunk-XUAF2H54.js";
|
|
7
|
-
import "./chunk-CA4U2JP7.js";
|
|
3
|
+
} from "./chunk-XDI5KMKL.js";
|
|
4
|
+
import "./chunk-6MLMZ7C6.js";
|
|
5
|
+
import "./chunk-DAOXTQVS.js";
|
|
8
6
|
import {
|
|
9
7
|
generate
|
|
10
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UKC6BKFK.js";
|
|
11
9
|
import {
|
|
12
10
|
logger
|
|
13
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2HP7DWTG.js";
|
|
14
12
|
import {
|
|
15
13
|
resolve_catalog_dependencies_default
|
|
16
14
|
} from "./chunk-LHR4G2UO.js";
|
|
@@ -20,15 +18,17 @@ import {
|
|
|
20
18
|
import {
|
|
21
19
|
watch
|
|
22
20
|
} from "./chunk-CAJUIMDJ.js";
|
|
23
|
-
import
|
|
24
|
-
|
|
21
|
+
import {
|
|
22
|
+
runMigrations
|
|
23
|
+
} from "./chunk-XUAF2H54.js";
|
|
24
|
+
import "./chunk-CA4U2JP7.js";
|
|
25
25
|
import {
|
|
26
26
|
catalogToAstro
|
|
27
27
|
} from "./chunk-W3SAPOZU.js";
|
|
28
28
|
import "./chunk-W5JQON7Z.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-BAPUZSRK.js";
|
|
32
32
|
import {
|
|
33
33
|
linkCoreNodeModules,
|
|
34
34
|
resolveInstalledCoreNodeModules
|
package/dist/generate.cjs
CHANGED
|
@@ -108,7 +108,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
108
108
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
109
109
|
|
|
110
110
|
// package.json
|
|
111
|
-
var version = "4.1.
|
|
111
|
+
var version = "4.1.2";
|
|
112
112
|
|
|
113
113
|
// src/constants.ts
|
|
114
114
|
var VERSION = version;
|
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-UKC6BKFK.js";
|
|
4
|
+
import "./chunk-2HP7DWTG.js";
|
|
5
|
+
import "./chunk-BAPUZSRK.js";
|
|
6
6
|
import "./chunk-6QENHZZP.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -15,6 +15,7 @@ import remarkComment from 'remark-comment';
|
|
|
15
15
|
import rehypeSlug from 'rehype-slug';
|
|
16
16
|
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
|
|
17
17
|
import { eventCatalogLikeC4 } from './src/plugins/likec4';
|
|
18
|
+
import { astroTrailingSlashEndpointFix } from './src/plugins/astro-trailing-slash-endpoint-fix';
|
|
18
19
|
|
|
19
20
|
import rehypeExpressiveCode from 'rehype-expressive-code';
|
|
20
21
|
|
|
@@ -116,7 +117,11 @@ export default defineConfig({
|
|
|
116
117
|
eventCatalogIntegration(),
|
|
117
118
|
].filter(Boolean),
|
|
118
119
|
vite: {
|
|
119
|
-
plugins: [
|
|
120
|
+
plugins: [
|
|
121
|
+
tailwindcss(),
|
|
122
|
+
...(await eventCatalogLikeC4(projectDirectory)),
|
|
123
|
+
...(config.trailingSlash === true ? [astroTrailingSlashEndpointFix()] : []),
|
|
124
|
+
],
|
|
120
125
|
define: {
|
|
121
126
|
/**
|
|
122
127
|
* Trailing slash is exposed as global variable here principally for `@utils/url-builder`.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
// Works around a regression in Astro >= 7.0.4 (withastro/astro PR #17224).
|
|
4
|
+
//
|
|
5
|
+
// With `trailingSlash: 'always'`, Astro's prerender path generation
|
|
6
|
+
// (dist/runtime/prerender/static-paths.js) appends a trailing slash to every
|
|
7
|
+
// generated path, including dynamic file endpoints such as
|
|
8
|
+
// /docs/teams/[id].md -> /docs/teams/customer-platform.md/. Since 7.0.4 the
|
|
9
|
+
// route *pattern* for those endpoints no longer accepts a trailing slash, so
|
|
10
|
+
// at render time `getParams` fails to extract any params and static builds
|
|
11
|
+
// crash with `TypeError: Missing parameter: id`.
|
|
12
|
+
//
|
|
13
|
+
// The generation side runs in the Astro CLI process and cannot be patched
|
|
14
|
+
// here, but `getParams` (dist/core/render/params-and-props.js) is bundled
|
|
15
|
+
// through Vite into the prerender/server entries. This plugin rewrites it to
|
|
16
|
+
// retry with the trailing slash flipped when no route pattern matches - a
|
|
17
|
+
// no-op on unaffected Astro versions and once the regression is fixed
|
|
18
|
+
// upstream.
|
|
19
|
+
//
|
|
20
|
+
// The regex below matches Astro 7.0.3 (`const paramsMatch`) through 7.0.7
|
|
21
|
+
// (`let paramsMatch`). A unit test asserts it still applies to the installed
|
|
22
|
+
// Astro version so a future refactor is caught in CI rather than as a broken
|
|
23
|
+
// user build.
|
|
24
|
+
const GET_PARAMS_PATTERN =
|
|
25
|
+
/(?:const|let)( paramsMatch = allPatterns\.map\(\(pattern\) => pattern\.exec\(path\)\)\.find\(\(x\) => x\);)/;
|
|
26
|
+
|
|
27
|
+
export const applyGetParamsTrailingSlashFix = (code: string): string | undefined => {
|
|
28
|
+
if (!GET_PARAMS_PATTERN.test(code)) return undefined;
|
|
29
|
+
return code.replace(
|
|
30
|
+
GET_PARAMS_PATTERN,
|
|
31
|
+
`let$1
|
|
32
|
+
if (!paramsMatch) {
|
|
33
|
+
const flipped = path.endsWith('/') ? path.slice(0, -1) : path + '/';
|
|
34
|
+
paramsMatch = allPatterns.map((p) => p.exec(flipped)).find((x) => x);
|
|
35
|
+
}`
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const astroTrailingSlashEndpointFix = (): Plugin => ({
|
|
40
|
+
name: 'eventcatalog:astro-trailing-slash-endpoint-fix',
|
|
41
|
+
transform(code, id) {
|
|
42
|
+
if (!id.replace(/\\/g, '/').includes('astro/dist/core/render/params-and-props.js')) return;
|
|
43
|
+
const patched = applyGetParamsTrailingSlashFix(code);
|
|
44
|
+
if (!patched) {
|
|
45
|
+
console.warn(
|
|
46
|
+
'[eventcatalog] Could not apply the Astro trailing-slash endpoint fix; builds with trailingSlash: true may fail. Please raise an issue at https://github.com/event-catalog/eventcatalog/issues'
|
|
47
|
+
);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return { code: patched, map: null };
|
|
51
|
+
},
|
|
52
|
+
});
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "4.1.
|
|
10
|
+
"version": "4.1.2",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"uuid": "^10.0.0",
|
|
118
118
|
"zod": "^4.3.6",
|
|
119
119
|
"@eventcatalog/linter": "1.1.4",
|
|
120
|
-
"@eventcatalog/
|
|
121
|
-
"@eventcatalog/
|
|
120
|
+
"@eventcatalog/sdk": "2.25.0",
|
|
121
|
+
"@eventcatalog/visualiser": "^4.0.1"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@astrojs/check": "^0.9.9",
|