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.
- package/LICENSE +661 -0
- package/README.md +304 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +244 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +46 -0
- package/dist/config.js +54 -0
- package/dist/config.js.map +1 -0
- package/dist/context-export.d.ts +11 -0
- package/dist/context-export.js +121 -0
- package/dist/context-export.js.map +1 -0
- package/dist/decompiler.d.ts +2 -0
- package/dist/decompiler.js +44 -0
- package/dist/decompiler.js.map +1 -0
- package/dist/draft-protocol.d.ts +27 -0
- package/dist/draft-protocol.js +135 -0
- package/dist/draft-protocol.js.map +1 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.js +40 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/metrics.d.ts +30 -0
- package/dist/metrics.js +182 -0
- package/dist/metrics.js.map +1 -0
- package/dist/parser.d.ts +4 -0
- package/dist/parser.js +361 -0
- package/dist/parser.js.map +1 -0
- package/dist/spec.d.ts +17 -0
- package/dist/spec.js +86 -0
- package/dist/spec.js.map +1 -0
- package/dist/styles-react.d.ts +3 -0
- package/dist/styles-react.js +20 -0
- package/dist/styles-react.js.map +1 -0
- package/dist/styles-tailwind.d.ts +8 -0
- package/dist/styles-tailwind.js +197 -0
- package/dist/styles-tailwind.js.map +1 -0
- package/dist/transpiler-cli.d.ts +3 -0
- package/dist/transpiler-cli.js +279 -0
- package/dist/transpiler-cli.js.map +1 -0
- package/dist/transpiler-express.d.ts +3 -0
- package/dist/transpiler-express.js +612 -0
- package/dist/transpiler-express.js.map +1 -0
- package/dist/transpiler-nextjs.d.ts +21 -0
- package/dist/transpiler-nextjs.js +400 -0
- package/dist/transpiler-nextjs.js.map +1 -0
- package/dist/transpiler-tailwind.d.ts +3 -0
- package/dist/transpiler-tailwind.js +594 -0
- package/dist/transpiler-tailwind.js.map +1 -0
- package/dist/transpiler-terminal.d.ts +3 -0
- package/dist/transpiler-terminal.js +522 -0
- package/dist/transpiler-terminal.js.map +1 -0
- package/dist/transpiler-web.d.ts +3 -0
- package/dist/transpiler-web.js +218 -0
- package/dist/transpiler-web.js.map +1 -0
- package/dist/transpiler.d.ts +3 -0
- package/dist/transpiler.js +218 -0
- package/dist/transpiler.js.map +1 -0
- package/dist/types.d.ts +76 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +36 -0
- package/dist/utils.js.map +1 -0
- package/kern.config.ts +61 -0
- 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
|
+
}
|