xpine 0.0.58 → 0.0.60

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.
Files changed (53) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/.claude/worktrees/happy-lalande-c6c39c/.claude/settings.local.json +33 -0
  3. package/.claude/worktrees/happy-lalande-c6c39c/.d.ts +1 -0
  4. package/.claude/worktrees/happy-lalande-c6c39c/.gitattributes +2 -0
  5. package/.claude/worktrees/happy-lalande-c6c39c/README.md +571 -0
  6. package/.claude/worktrees/happy-lalande-c6c39c/TODO +2 -0
  7. package/.claude/worktrees/happy-lalande-c6c39c/eslint.config.mjs +27 -0
  8. package/.claude/worktrees/happy-lalande-c6c39c/jsx-runtime.d.ts +1 -0
  9. package/.claude/worktrees/happy-lalande-c6c39c/package-lock.json +5862 -0
  10. package/.claude/worktrees/happy-lalande-c6c39c/package.json +62 -0
  11. package/.claude/worktrees/happy-lalande-c6c39c/tsconfig.json +43 -0
  12. package/.claude/worktrees/happy-lalande-c6c39c/types.ts +55 -0
  13. package/.claude/worktrees/happy-lalande-c6c39c/xpine.config.mjs +1 -0
  14. package/.claude/worktrees/jolly-hofstadter-2764be/.claude/settings.local.json +33 -0
  15. package/.claude/worktrees/jolly-hofstadter-2764be/.d.ts +1 -0
  16. package/.claude/worktrees/jolly-hofstadter-2764be/.gitattributes +2 -0
  17. package/.claude/worktrees/jolly-hofstadter-2764be/README.md +571 -0
  18. package/.claude/worktrees/jolly-hofstadter-2764be/TODO +2 -0
  19. package/.claude/worktrees/jolly-hofstadter-2764be/eslint.config.mjs +27 -0
  20. package/.claude/worktrees/jolly-hofstadter-2764be/jsx-runtime.d.ts +1 -0
  21. package/.claude/worktrees/jolly-hofstadter-2764be/package-lock.json +5862 -0
  22. package/.claude/worktrees/jolly-hofstadter-2764be/package.json +62 -0
  23. package/.claude/worktrees/jolly-hofstadter-2764be/tsconfig.json +43 -0
  24. package/.claude/worktrees/jolly-hofstadter-2764be/types.ts +55 -0
  25. package/.claude/worktrees/jolly-hofstadter-2764be/xpine.config.mjs +1 -0
  26. package/README.md +104 -0
  27. package/create-xpine-app/README.md +20 -0
  28. package/create-xpine-app/index.js +80 -0
  29. package/create-xpine-app/package.json +30 -0
  30. package/create-xpine-app/template/README.md +50 -0
  31. package/create-xpine-app/template/eslint.config.mjs +27 -0
  32. package/create-xpine-app/template/gitignore +5 -0
  33. package/create-xpine-app/template/package.json +32 -0
  34. package/create-xpine-app/template/tsconfig.json +36 -0
  35. package/create-xpine-app/template/xpine.config.mjs +1 -0
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +269 -106
  39. package/dist/src/auth.d.ts.map +1 -1
  40. package/dist/src/express.d.ts +5 -0
  41. package/dist/src/express.d.ts.map +1 -1
  42. package/dist/src/scripts/build.d.ts.map +1 -1
  43. package/dist/src/scripts/xpine-build.js +6 -2
  44. package/dist/src/scripts/xpine-dev.js +15 -21
  45. package/dist/src/util/html.d.ts +9 -1
  46. package/dist/src/util/html.d.ts.map +1 -1
  47. package/dist/src/util/regex.d.ts +2 -0
  48. package/dist/src/util/regex.d.ts.map +1 -1
  49. package/dist/types.d.ts +4 -1
  50. package/dist/types.d.ts.map +1 -1
  51. package/eslint.config.mjs +1 -1
  52. package/package.json +1 -1
  53. package/types.ts +5 -1
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "xpine",
3
+ "version": "0.0.59",
4
+ "main": "dist/index.js",
5
+ "dependencies": {
6
+ "@aws-sdk/client-secrets-manager": "^3.758.0",
7
+ "@tailwindcss/postcss": "^4.1.12",
8
+ "builtin-modules": "^4.0.0",
9
+ "chokidar": "^4.0.3",
10
+ "dotenv": "^16.4.7",
11
+ "esbuild": "^0.25.0",
12
+ "express": "^4.21.2",
13
+ "express-ws": "^5.0.2",
14
+ "fs-extra": "^11.3.0",
15
+ "glob": "^11.0.1",
16
+ "jsonwebtoken": "^9.0.2",
17
+ "micromatch": "^4.0.8",
18
+ "minify-xml": "^4.5.2",
19
+ "postcss": "^8.5.3",
20
+ "request-ip": "^3.3.0",
21
+ "shelljs": "^0.9.2",
22
+ "tsx": "^4.19.3",
23
+ "typescript": "^5.7.3",
24
+ "yargs": "^17.7.2"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git://github.com/dan-caldwell/xpine.git"
29
+ },
30
+ "scripts": {
31
+ "build": "tsx ./src/scripts/run-build-module.ts && npm run build:types",
32
+ "build:types": "sh ./src/scripts/build-types.sh",
33
+ "xpine-dev-server": "tsx ./src/scripts/xpine-dev-server.ts",
34
+ "test": "cd ./tests && npm run test",
35
+ "test:dev": "cd ./tests && npm run dev",
36
+ "test:start": "cd ./tests && npm run build && npm start",
37
+ "test:build": "cd ./tests && npm run build",
38
+ "test:build:dev": "cd ./tests && npm run build:dev",
39
+ "lint": "npx eslint",
40
+ "fix": "npx eslint --fix",
41
+ "release:patch": "npm run build && npm version patch && npm publish"
42
+ },
43
+ "bin": {
44
+ "xpine-build": "dist/src/scripts/xpine-build.js",
45
+ "xpine-dev": "dist/src/scripts/xpine-dev.js"
46
+ },
47
+ "types": "dist/index.d.ts",
48
+ "type": "module",
49
+ "devDependencies": {
50
+ "@eslint/js": "^9.24.0",
51
+ "@tailwindcss/oxide-darwin-arm64": "^4.1.3",
52
+ "@types/express": "^5.0.0",
53
+ "@types/micromatch": "^4.0.9",
54
+ "@types/node": "^22.13.5",
55
+ "@types/request-ip": "^0.0.41",
56
+ "@types/shelljs": "^0.8.15",
57
+ "@types/yargs": "^17.0.33",
58
+ "axios": "^1.8.4",
59
+ "lightningcss-darwin-arm64": "^1.29.3",
60
+ "typescript-eslint": "^8.29.0"
61
+ }
62
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "compilerOptions": {
3
+ "jsx": "preserve",
4
+ "jsxFragmentFactory": "html.fragment",
5
+ "jsxFactory": "html.createElement",
6
+ "lib": [
7
+ "dom",
8
+ "dom.iterable",
9
+ "esnext"
10
+ ],
11
+ "allowJs": false,
12
+ "skipLibCheck": true,
13
+ "strict": false,
14
+ "forceConsistentCasingInFileNames": false,
15
+ "noEmit": true,
16
+ "esModuleInterop": true,
17
+ "target": "esnext",
18
+ "module": "ESNext",
19
+ "moduleResolution": "node",
20
+ "resolveJsonModule": true,
21
+ "isolatedModules": true,
22
+ "jsxImportSource": "xpine",
23
+ "incremental": true,
24
+ "allowImportingTsExtensions": true,
25
+ // Generate d.ts files
26
+ "declaration": true,
27
+ "emitDeclarationOnly": true,
28
+ "outDir": "dist",
29
+ "declarationMap": true,
30
+ "types": []
31
+ },
32
+ "include": [
33
+ "src/**/*.ts"
34
+ ],
35
+ "exclude": [
36
+ "node_modules",
37
+ "./node_modules",
38
+ "./node_modules/*",
39
+ "./node_modules/@types/node/index.d.ts",
40
+ "dist",
41
+ "**/*.js"
42
+ ],
43
+ }
@@ -0,0 +1,55 @@
1
+ import { NextFunction, Request, Response } from 'express';
2
+ import ts from 'typescript';
3
+
4
+ export type XPineConfig = {
5
+ [key: string]: any;
6
+ }
7
+
8
+ export type TokenUser = {
9
+ email?: string;
10
+ username?: string;
11
+ }
12
+
13
+ export type ServerRequest = Request & {
14
+ user?: TokenUser;
15
+ clientIp?: string;
16
+ }
17
+
18
+ export type WrapperProps = {
19
+ req: ServerRequest;
20
+ children: any;
21
+ config: ConfigFile;
22
+ data?: any;
23
+ routePath?: string;
24
+ }
25
+
26
+ export type ConfigFile = {
27
+ staticPaths?: boolean | (() => Promise<{ [key: string]: string }[]> | { [key: string]: string }[]);
28
+ wrapper?: (props: WrapperProps) => Promise<any>;
29
+ data?: (req: ServerRequest) => Promise<any>;
30
+ routeMiddleware?: (req: ServerRequest, res: Response, next: NextFunction) => void;
31
+ // For multi-segment dynamic routes ([...slug]): validate a slug that was not
32
+ // generated at build time so it can be resolved safely at request time.
33
+ // Return false (the default for unknown slugs) to fall through to the 404 handler.
34
+ isValid?: (slug: string, req: ServerRequest) => boolean | Promise<boolean>;
35
+ }
36
+
37
+ export type PageProps = {
38
+ req: ServerRequest;
39
+ res: Response;
40
+ data: any;
41
+ routePath: string;
42
+ }
43
+
44
+ export type FileItem = {
45
+ file: string;
46
+ size: number;
47
+ }
48
+
49
+ export type ComponentData = {
50
+ path: string;
51
+ contents: string;
52
+ clientContent: string;
53
+ configFiles: string[];
54
+ source: ts.SourceFile;
55
+ }
@@ -0,0 +1 @@
1
+ export default {};
@@ -0,0 +1,33 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm run *)",
5
+ "Bash(PORT=8888 node ./dist/server/run/prod.js)",
6
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8888/)",
7
+ "Bash(break)",
8
+ "Bash(curl -s -o /dev/null -w \"status=%{http_code}\\\\n\" http://localhost:8888/blog/technology/devops/my-blog-post)",
9
+ "Bash(curl -s http://localhost:8888/blog/technology/devops/my-blog-post)",
10
+ "Bash(curl -s -o /dev/null -w \"status=%{http_code}\\\\n\" http://localhost:8888/blog/preview/some/new/post)",
11
+ "Bash(curl -s http://localhost:8888/blog/preview/some/new/post)",
12
+ "Bash(curl -s -o /dev/null -w \"status=%{http_code}\\\\n\" http://localhost:8888/blog/totally/unknown/path)",
13
+ "Bash(curl -s http://localhost:8888/blog/totally/unknown/path)",
14
+ "Bash(curl -s -o /dev/null -w \"status=%{http_code}\\\\n\" http://localhost:8888/some-totally-random-route-xyz)",
15
+ "Bash(curl -s http://localhost:8888/some-totally-random-route-xyz)",
16
+ "Bash(curl -s http://localhost:8888/some-random-xyz)",
17
+ "Bash(curl -s -o /dev/null -w \"status=%{http_code}\\\\n\" http://localhost:8888/blog/nope)",
18
+ "Bash(curl -s http://localhost:8888/blog/nope)",
19
+ "Bash(PORT=8888 npx playwright test app-build --grep \"multi-segment\")",
20
+ "Bash(PORT=8888 npx playwright test)",
21
+ "Bash(npx eslint *)",
22
+ "Bash(echo \"=== exit: $? ===\")",
23
+ "Bash(git stash *)",
24
+ "Bash(PORT=8888 npx playwright test app-build --grep \"traverse\")",
25
+ "Bash(node -e \"console.log\\(require\\('./node_modules/jsonwebtoken/package.json'\\).version\\)\")",
26
+ "Bash(JWT_PRIVATE_KEY=test-secret-123 node --input-type=module -e ' *)",
27
+ "Bash(node --input-type=module -e ' *)",
28
+ "Bash(CSRF_SECRET='csrf-secret-xyz' node /tmp/csrf-test.mjs)",
29
+ "Bash(CSRF_SECRET='csrf-secret-xyz' node csrf-test.mjs)",
30
+ "Bash(npm view *)"
31
+ ]
32
+ }
33
+ }
@@ -0,0 +1 @@
1
+ declare module 'xpine';
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto