kern-lang 1.0.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.
Files changed (67) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +304 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +244 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/config.d.ts +46 -0
  7. package/dist/config.js +54 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/context-export.d.ts +11 -0
  10. package/dist/context-export.js +121 -0
  11. package/dist/context-export.js.map +1 -0
  12. package/dist/decompiler.d.ts +2 -0
  13. package/dist/decompiler.js +44 -0
  14. package/dist/decompiler.js.map +1 -0
  15. package/dist/draft-protocol.d.ts +27 -0
  16. package/dist/draft-protocol.js +135 -0
  17. package/dist/draft-protocol.js.map +1 -0
  18. package/dist/errors.d.ts +12 -0
  19. package/dist/errors.js +40 -0
  20. package/dist/errors.js.map +1 -0
  21. package/dist/index.d.ts +28 -0
  22. package/dist/index.js +33 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/metrics.d.ts +30 -0
  25. package/dist/metrics.js +182 -0
  26. package/dist/metrics.js.map +1 -0
  27. package/dist/parser.d.ts +4 -0
  28. package/dist/parser.js +361 -0
  29. package/dist/parser.js.map +1 -0
  30. package/dist/spec.d.ts +17 -0
  31. package/dist/spec.js +86 -0
  32. package/dist/spec.js.map +1 -0
  33. package/dist/styles-react.d.ts +3 -0
  34. package/dist/styles-react.js +20 -0
  35. package/dist/styles-react.js.map +1 -0
  36. package/dist/styles-tailwind.d.ts +8 -0
  37. package/dist/styles-tailwind.js +197 -0
  38. package/dist/styles-tailwind.js.map +1 -0
  39. package/dist/transpiler-cli.d.ts +3 -0
  40. package/dist/transpiler-cli.js +279 -0
  41. package/dist/transpiler-cli.js.map +1 -0
  42. package/dist/transpiler-express.d.ts +3 -0
  43. package/dist/transpiler-express.js +612 -0
  44. package/dist/transpiler-express.js.map +1 -0
  45. package/dist/transpiler-nextjs.d.ts +21 -0
  46. package/dist/transpiler-nextjs.js +400 -0
  47. package/dist/transpiler-nextjs.js.map +1 -0
  48. package/dist/transpiler-tailwind.d.ts +3 -0
  49. package/dist/transpiler-tailwind.js +594 -0
  50. package/dist/transpiler-tailwind.js.map +1 -0
  51. package/dist/transpiler-terminal.d.ts +3 -0
  52. package/dist/transpiler-terminal.js +522 -0
  53. package/dist/transpiler-terminal.js.map +1 -0
  54. package/dist/transpiler-web.d.ts +3 -0
  55. package/dist/transpiler-web.js +218 -0
  56. package/dist/transpiler-web.js.map +1 -0
  57. package/dist/transpiler.d.ts +3 -0
  58. package/dist/transpiler.js +218 -0
  59. package/dist/transpiler.js.map +1 -0
  60. package/dist/types.d.ts +76 -0
  61. package/dist/types.js +11 -0
  62. package/dist/types.js.map +1 -0
  63. package/dist/utils.d.ts +5 -0
  64. package/dist/utils.js +36 -0
  65. package/dist/utils.js.map +1 -0
  66. package/kern.config.ts +61 -0
  67. package/package.json +64 -0
package/kern.config.ts ADDED
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Kern Configuration
3
+ *
4
+ * Customize how Kern transpiles for your project.
5
+ * This file is auto-loaded by the CLI from the project root.
6
+ */
7
+
8
+ import type { KernConfig } from 'kern-lang';
9
+
10
+ const config: KernConfig = {
11
+ // Target framework (default: nextjs)
12
+ target: 'nextjs',
13
+
14
+ // i18n configuration
15
+ i18n: {
16
+ enabled: true,
17
+ hookName: 'useTranslation',
18
+ importPath: 'react-i18next',
19
+ // Set to false to output raw strings without t() wrapping
20
+ },
21
+
22
+ // Component import mappings
23
+ components: {
24
+ // UI library imports (Icon, Button, etc.)
25
+ uiLibrary: '@components/ui',
26
+ // Where to find project components
27
+ componentRoot: '@/components',
28
+ // Custom component mappings (optional)
29
+ // mappings: { SettingsSection: '@features/settings/components/layout/SettingsSection' }
30
+ },
31
+
32
+ // Color palette — maps hex values to Tailwind classes
33
+ // Extend this with your project's design system colors
34
+ colors: {
35
+ // Zinc scale (dark theme)
36
+ '#09090b': 'zinc-950',
37
+ '#18181b': 'zinc-900',
38
+ '#27272a': 'zinc-800',
39
+ '#3f3f46': 'zinc-700',
40
+ '#52525b': 'zinc-600',
41
+ '#71717a': 'zinc-500',
42
+ '#a1a1aa': 'zinc-400',
43
+ '#d4d4d8': 'zinc-300',
44
+ '#e4e4e7': 'zinc-200',
45
+ '#f4f4f5': 'zinc-100',
46
+ // Brand colors
47
+ '#f97316': 'orange-500',
48
+ '#ea580c': 'orange-600',
49
+ // Add your project colors here
50
+ },
51
+
52
+ // Output configuration
53
+ output: {
54
+ // Directory for generated .tsx files (relative to project root)
55
+ outDir: 'src/generated',
56
+ // Generate source map .map files
57
+ sourceMaps: true,
58
+ },
59
+ };
60
+
61
+ export default config;
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "kern-lang",
3
+ "version": "1.0.0",
4
+ "description": "Kern — the LLM-native language. Swiss-engineered IR that transpiles to React, Next.js, Express, and React Native.",
5
+ "type": "module",
6
+ "bin": {
7
+ "kern": "./dist/cli.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": "./dist/index.js",
13
+ "./parser": "./dist/parser.js",
14
+ "./config": "./dist/config.js",
15
+ "./metrics": "./dist/metrics.js",
16
+ "./context-export": "./dist/context-export.js",
17
+ "./transpiler": "./dist/transpiler.js",
18
+ "./transpiler-web": "./dist/transpiler-web.js",
19
+ "./transpiler-tailwind": "./dist/transpiler-tailwind.js",
20
+ "./transpiler-nextjs": "./dist/transpiler-nextjs.js",
21
+ "./transpiler-express": "./dist/transpiler-express.js",
22
+ "./transpiler-cli": "./dist/transpiler-cli.js",
23
+ "./transpiler-terminal": "./dist/transpiler-terminal.js",
24
+ "./draft-protocol": "./dist/draft-protocol.js"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "kern.config.ts"
29
+ ],
30
+ "keywords": [
31
+ "kern",
32
+ "llm",
33
+ "ir",
34
+ "transpiler",
35
+ "react",
36
+ "nextjs",
37
+ "react-native",
38
+ "tailwind",
39
+ "express"
40
+ ],
41
+ "author": "cukas",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/cukas/KERNlang.git"
45
+ },
46
+ "homepage": "https://github.com/cukas/KERNlang#readme",
47
+ "license": "AGPL-3.0-or-later",
48
+ "scripts": {
49
+ "build": "tsc",
50
+ "prepublishOnly": "npm run build",
51
+ "test": "node --experimental-vm-modules node_modules/.bin/jest --forceExit",
52
+ "fitness": "npm test"
53
+ },
54
+ "devDependencies": {
55
+ "@types/jest": "^29.5.0",
56
+ "@types/node": "^22.0.0",
57
+ "jest": "^29.7.0",
58
+ "ts-jest": "^29.3.0",
59
+ "typescript": "^5.7.0"
60
+ },
61
+ "dependencies": {
62
+ "jiti": "^2.6.1"
63
+ }
64
+ }