@we8/astro 0.1.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/README.md +157 -0
- package/components/ConsentBanner.astro +105 -0
- package/components/VisitBeacon.astro +58 -0
- package/components/We8Form.astro +94 -0
- package/dist/beacon.d.ts +32 -0
- package/dist/beacon.d.ts.map +1 -0
- package/dist/beacon.js +38 -0
- package/dist/beacon.js.map +1 -0
- package/dist/config.d.ts +42 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +58 -0
- package/dist/config.js.map +1 -0
- package/dist/consent.d.ts +61 -0
- package/dist/consent.d.ts.map +1 -0
- package/dist/consent.js +121 -0
- package/dist/consent.js.map +1 -0
- package/dist/content.d.ts +36 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +58 -0
- package/dist/content.js.map +1 -0
- package/dist/form.d.ts +22 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +39 -0
- package/dist/form.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +40 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +37 -0
- package/dist/integration.js.map +1 -0
- package/dist/seo.d.ts +51 -0
- package/dist/seo.d.ts.map +1 -0
- package/dist/seo.js +63 -0
- package/dist/seo.js.map +1 -0
- package/dist/session.d.ts +17 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +46 -0
- package/dist/session.js.map +1 -0
- package/dist/sitemap.d.ts +19 -0
- package/dist/sitemap.d.ts.map +1 -0
- package/dist/sitemap.js +17 -0
- package/dist/sitemap.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type We8AstroConfig } from './config.js';
|
|
2
|
+
import { type BuildFetchOptions } from './content.js';
|
|
3
|
+
/** The absolute URL of this tenant's engine-generated sitemap. */
|
|
4
|
+
export declare function we8SitemapUrl(config?: We8AstroConfig): string;
|
|
5
|
+
export interface MergeSitemapOptions extends BuildFetchOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Map a post slug to the absolute URL it is published at on the tenant's own
|
|
8
|
+
* site (routing is template-specific, e.g. `` (slug) => `${site}/blog/${slug}` ``).
|
|
9
|
+
*/
|
|
10
|
+
map: (slug: string) => string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Build-time: produce the list of post URLs to feed `@astrojs/sitemap`'s
|
|
14
|
+
* `customPages`, so the tenant's sitemap includes every we8 post alongside the
|
|
15
|
+
* statically-generated Astro pages. The route shape is the caller's to decide
|
|
16
|
+
* via `map`, since only the template knows how posts are routed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function mergeSitemap(options: MergeSitemapOptions): Promise<string[]>;
|
|
19
|
+
//# sourceMappingURL=sitemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../src/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpE,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,MAAM,GAAE,cAAgC,GAAG,MAAM,CAE9E;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D;;;OAGG;IACH,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGlF"}
|
package/dist/sitemap.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createBuildClient, resolveConfig } from './config.js';
|
|
2
|
+
import { getPostSlugs } from './content.js';
|
|
3
|
+
/** The absolute URL of this tenant's engine-generated sitemap. */
|
|
4
|
+
export function we8SitemapUrl(config = resolveConfig()) {
|
|
5
|
+
return createBuildClient(config).sitemapUrl();
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Build-time: produce the list of post URLs to feed `@astrojs/sitemap`'s
|
|
9
|
+
* `customPages`, so the tenant's sitemap includes every we8 post alongside the
|
|
10
|
+
* statically-generated Astro pages. The route shape is the caller's to decide
|
|
11
|
+
* via `map`, since only the template knows how posts are routed.
|
|
12
|
+
*/
|
|
13
|
+
export async function mergeSitemap(options) {
|
|
14
|
+
const slugs = await getPostSlugs(options);
|
|
15
|
+
return slugs.map(options.map);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=sitemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../src/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAuB,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,YAAY,EAA0B,MAAM,cAAc,CAAC;AAEpE,kEAAkE;AAClE,MAAM,UAAU,aAAa,CAAC,SAAyB,aAAa,EAAE;IACpE,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;AAChD,CAAC;AAUD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAA4B;IAC7D,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@we8/astro",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/reveriext/we8-package.git",
|
|
8
|
+
"directory": "packages/astro"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/reveriext/we8-package/tree/main/packages/astro#readme",
|
|
11
|
+
"bugs": "https://github.com/reveriext/we8-package/issues",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"description": "The Astro integration for we8: build-time content helpers, the visit beacon, progressive-enhancement forms, consent, and sitemap merging.",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"we8",
|
|
16
|
+
"cms",
|
|
17
|
+
"headless-cms",
|
|
18
|
+
"astro",
|
|
19
|
+
"astro-integration",
|
|
20
|
+
"seo",
|
|
21
|
+
"aeo"
|
|
22
|
+
],
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"@we8/source": "./src/index.ts",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./ConsentBanner.astro": "./components/ConsentBanner.astro",
|
|
32
|
+
"./VisitBeacon.astro": "./components/VisitBeacon.astro",
|
|
33
|
+
"./We8Form.astro": "./components/We8Form.astro"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"components",
|
|
38
|
+
"README.md"
|
|
39
|
+
],
|
|
40
|
+
"sideEffects": false,
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.build.json",
|
|
43
|
+
"prepare": "npm run build",
|
|
44
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"prepack": "npm run build"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@we8/client": "^0.1.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"astro": ">=7"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"astro": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"vitest": "^4.1.9"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=22.12.0"
|
|
67
|
+
}
|
|
68
|
+
}
|