@arcjet/astro 1.0.0-beta.7 → 1.0.0-beta.9

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 CHANGED
@@ -22,6 +22,9 @@ against common attacks.
22
22
 
23
23
  This is the [Arcjet][arcjet] SDK integration for [Astro][astro].
24
24
 
25
+ - [npm package (`@arcjet/astro`)](https://www.npmjs.com/package/@arcjet/astro)
26
+ - [GitHub source code (`arcjet-astro/` in `arcjet/arcjet-js`)](https://github.com/arcjet/arcjet-js/tree/main/arcjet-astro)
27
+
25
28
  ## Getting started
26
29
 
27
30
  Visit the [quick start guide][quick-start] to get started.
package/index.js CHANGED
@@ -314,7 +314,13 @@ function arcjet({ rules, characteristics, client, proxies, } = { rules: [] }) {
314
314
  order: "pre",
315
315
  });
316
316
  },
317
- "astro:config:done": async ({ injectTypes }) => {
317
+ "astro:config:done": async ({ buildOutput, injectTypes, logger }) => {
318
+ if (buildOutput === "static") {
319
+ logger.warn("✦ Arcjet can only protect Dynamic routes.\n\n" +
320
+ " Configure at least 1 Dynamic route to use the Arcjet integration, see Astro's\n" +
321
+ " Dynamic routes documentation for configuration details:\n" +
322
+ " https://docs.astro.build/en/guides/routing/#dynamic-routes\n");
323
+ }
318
324
  const implTypes = await fs.readFile(new URL("./internal.d.ts", import.meta.url), { encoding: "utf-8" });
319
325
  injectTypes({
320
326
  content: `
package/internal.js CHANGED
@@ -46,7 +46,7 @@ function createRemoteClient(options) {
46
46
  // Transport is the HTTP client that the client uses to make requests.
47
47
  const transport = createTransport(url);
48
48
  const sdkStack = "ASTRO";
49
- const sdkVersion = "1.0.0-beta.7";
49
+ const sdkVersion = "1.0.0-beta.9";
50
50
  return createClient({
51
51
  transport,
52
52
  baseUrl: url,
package/package.json CHANGED
@@ -1,7 +1,20 @@
1
1
  {
2
2
  "name": "@arcjet/astro",
3
- "version": "1.0.0-beta.7",
4
- "description": "Arcjet SDK integration for Astro",
3
+ "version": "1.0.0-beta.9",
4
+ "description": "Arcjet helps developers protect their Astro sites in just a few lines of code. Bot detection. Rate limiting. Email validation. Attack protection. Data redaction. A developer-first approach to security.",
5
+ "keywords": [
6
+ "analyze",
7
+ "arcjet",
8
+ "astro-integration",
9
+ "astro",
10
+ "attack",
11
+ "limit",
12
+ "protect",
13
+ "secure",
14
+ "security",
15
+ "verify",
16
+ "withastro"
17
+ ],
5
18
  "license": "Apache-2.0",
6
19
  "homepage": "https://arcjet.com",
7
20
  "repository": {
@@ -23,46 +36,42 @@
23
36
  "main": "./index.js",
24
37
  "types": "./index.d.ts",
25
38
  "files": [
26
- "LICENSE",
27
- "README.md",
28
- "*.js",
29
- "*.d.ts",
30
- "!*.config.js"
39
+ "index.d.ts",
40
+ "index.js",
41
+ "internal.d.ts",
42
+ "internal.js",
43
+ "middleware.d.ts",
44
+ "middleware.js"
31
45
  ],
32
46
  "scripts": {
33
- "prepublishOnly": "npm run build",
34
47
  "build": "rollup --config rollup.config.js",
35
48
  "lint": "eslint .",
36
- "pretest": "npm run build",
37
- "test": "node --test --experimental-test-coverage"
49
+ "prepublishOnly": "npm run build",
50
+ "test": "npm run build && npm run lint"
38
51
  },
39
52
  "dependencies": {
40
- "@arcjet/env": "1.0.0-beta.7",
41
- "@arcjet/headers": "1.0.0-beta.7",
42
- "@arcjet/ip": "1.0.0-beta.7",
43
- "@arcjet/logger": "1.0.0-beta.7",
44
- "@arcjet/protocol": "1.0.0-beta.7",
45
- "@arcjet/transport": "1.0.0-beta.7",
46
- "arcjet": "1.0.0-beta.7"
53
+ "@arcjet/env": "1.0.0-beta.9",
54
+ "@arcjet/headers": "1.0.0-beta.9",
55
+ "@arcjet/ip": "1.0.0-beta.9",
56
+ "@arcjet/logger": "1.0.0-beta.9",
57
+ "@arcjet/protocol": "1.0.0-beta.9",
58
+ "@arcjet/transport": "1.0.0-beta.9",
59
+ "arcjet": "1.0.0-beta.9"
47
60
  },
48
61
  "peerDependencies": {
49
- "astro": "^5"
62
+ "astro": "^5.9.3"
50
63
  },
51
64
  "devDependencies": {
52
- "@arcjet/eslint-config": "1.0.0-beta.7",
53
- "@arcjet/rollup-config": "1.0.0-beta.7",
54
- "@arcjet/tsconfig": "1.0.0-beta.7",
55
- "@rollup/wasm-node": "4.40.1",
56
- "astro": "5.7.10",
57
- "eslint": "9.26.0",
58
- "expect": "29.7.0",
65
+ "@arcjet/eslint-config": "1.0.0-beta.9",
66
+ "@arcjet/rollup-config": "1.0.0-beta.9",
67
+ "@arcjet/tsconfig": "1.0.0-beta.9",
68
+ "@rollup/wasm-node": "4.44.2",
69
+ "astro": "5.11.0",
70
+ "eslint": "9.30.1",
59
71
  "typescript": "5.8.3"
60
72
  },
61
73
  "publishConfig": {
62
74
  "access": "public",
63
75
  "tag": "latest"
64
- },
65
- "keywords": [
66
- "astro-integration"
67
- ]
76
+ }
68
77
  }
package/astro-env.d.ts DELETED
@@ -1,16 +0,0 @@
1
- declare module "astro:env/server" {
2
- const ARCJET_BASE_URL: string | undefined;
3
- const ARCJET_ENV: string | undefined;
4
- const ARCJET_KEY: string | undefined;
5
- const ARCJET_LOG_LEVEL: string | undefined;
6
- const FLY_APP_NAME: string | undefined;
7
- const VERCEL: string | undefined;
8
- }
9
-
10
- interface ImportMetaEnv {
11
- readonly MODE: string | undefined;
12
- }
13
-
14
- interface ImportMeta {
15
- readonly env: ImportMetaEnv;
16
- }