@human-synthesis/norns-core
v0.0.10
Published
Norns core — Svelte preprocessor for Civet, Pug, and .n files
Readme
Norns Core
AI-driven software architecture and development framework, based on Svelte.
Svelte preprocessor for the Norns stack: Pug + Civet in .n files. The .c extension is recognised as an alias for .civet — both compile through Civet.
Stack
- Svelte 5 — components and runes
- Pug — templates
- Civet — script (TypeScript-flavored, indented)
- Vite — bundler
- bun — runtime / package manager
Install
bun add -D @human-synthesis/norns-core svelteMost users want the umbrella package @human-synthesis/norns instead — it adds the SvelteKit config, the Vite plugin, and the runtime layer.
Usage
svelte.config.js:
import { nornsPreprocess } from '@human-synthesis/norns-core/preprocess';
export default {
extensions: ['.svelte', '.n'],
preprocess: nornsPreprocess()
};What it does
.nfiles default<script>tolang="civet"and<template>tolang="pug"— write neither attribute and it just works.<script lang="civet">blocks are compiled to JavaScript via @danielx/civet before svelte-preprocess sees them.- Top-level Pug-only content is auto-wrapped in
<template lang="pug">so you don't need the wrapper boilerplate. - Pug class shorthand is rewritten so Tailwind variants (
.hover:bg-X) and fractional values (.gap-2.5) work without escaping. +if/+elseif/+elsechains are rewritten to Svelte block syntax ({#if}/{:else if}/{:else}/{/if}).
Auto-imports — see the umbrella
The auto-import layer (helpers, components, project utilities, UI library presets) lives in @human-synthesis/norns, not here. norns-core is the syntax preprocessor only — the import resolver needs Vite-plugin hooks the umbrella provides.
License
MIT © Daniel Teodoroiu / Human Synthesis. Built on top of Svelte © Svelte Contributors, MIT licensed.
