{"id":16957009,"url":"https://github.com/jgraichen/lively4-kernel","last_synced_at":"2026-04-11T00:35:30.255Z","repository":{"id":43654095,"uuid":"59098000","full_name":"jgraichen/lively4-kernel","owner":"jgraichen","description":"The Lively kernel is a small bootloader and kernel for the new, newest, or next Lively environment","archived":false,"fork":false,"pushed_at":"2022-02-25T20:47:14.000Z","size":51,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T08:13:36.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgraichen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-18T08:45:35.000Z","updated_at":"2016-06-26T13:41:35.000Z","dependencies_parsed_at":"2022-08-23T05:11:28.319Z","dependency_job_id":null,"html_url":"https://github.com/jgraichen/lively4-kernel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Flively4-kernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Flively4-kernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Flively4-kernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Flively4-kernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgraichen","download_url":"https://codeload.github.com/jgraichen/lively4-kernel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244803364,"owners_count":20512897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T22:16:36.630Z","updated_at":"2025-12-30T23:58:55.582Z","avatar_url":"https://github.com/jgraichen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lively Kernel\n\nThe Lively kernel is a small bootloader for the Lively environment. It provides a minimal ES6 module loader, it can to transpile ES6+ into runnable code and it loads an \"init process\". The kernel also tests for ServiceWorker availability and initializes a service worker if possible.\n\nThe kernel must be generated (compiled) and put into the document root to support loading ServiceWorkers.\n\n## Usage\n\nInclude a script tag like the following to load the kernel:\n\n```html\n\u003cscript\n    src=\"../dist-kernel.js\"\n    type=\"text/javascript\"\n    charset=\"utf-8\"\n    data-lively-kernel\u003e\n\u003c/script\u003e\n```\n\nThe `data-lively-kernel` is required as the kernel has to identify it's own script tag to load itself as a service worker.\n\nAfter the environment is initialized the kernel will load either `/init.js` in the browser tab or `/init-sw.js` in the service worker. These paths will be resolved using a base path, by default `./lively`, that is resolved relative to the `dist-kernel.js`.\n\nAll paths are configurable when compiling the kernel (see below).\n\nThese init \"processes\" can be ES6 modules including other files. They will be resolved relative to current file and absolute to the base path from above.\n\nSee the following example:\n\n```js\n// We are at /src/client.js\n\nimport '/my/file.js' // Will load `./lively/my/file.js`\n\nSystem.import('./header.js') // `./lively/src/header.js`\n```\n\n## Kernel API\n\nThe kernel exports a module providing functions to communicate with the kernel. This module can be required by importing `\"kernel\"`:\n\n```js\nimport * as kernel from 'kernel'\n\nkernel.compile(...)\n```\n\n### TODO: List kernel functions\n\n`...`\n\n## Compile\n\n```\n$ npm install\n$ npm start\n```\n\nRunning `npm start` will invoke webpack to compile and package the kernel loader sources into a single bundle.\n\nCompilation will be places at `./dist-kernel.js`.\n\nUse `kernel.conf.js` to configure kernel before compiling:\n\n* *CLIENT_BASE*, *WORKER_BASE*: The base path used to resolve init files.\n\n  When it's a relative path it be resolved relative to the `dist-kernel.js` path from the script tag.\n\n  An absolute path or a full URL can also be specified.\n  The base path cannot be escaped when importing code, the import path will be normalized before being appended to the base path.\n\n* *CLIENT_INIT*: The path to load in the client (browser tab) after boot.\n\n* *WORKER_INIT*: The service worker init file to load.\n\nExamples for other compile calls:\n\n```\n# Specify configuration\nKERNEL_CONFIG=./kernel.conf.l4.js npm start\n\n# Write to specific output file\nnpm start -- --output-file ../lively4-core/swx-loader.js\n\n# Build kernel for localhost usage\nKERNEL_CONFIG=./kernel.conf.l4.localhost.js npm start -- --output-file ../lively4-core/swx-loader.js\n```\n\n## Development\n\nRun `npm start -- --watch` to start webpack in watch mode. It will continue to watch the source files for changes after initial build and recompile the bundle whenever something changed. Such recompiles will be much faster compared to invoke `npm start` manually as only changes will be recompiled.\n\n## License\n\n(c) Jan Graichen\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgraichen%2Flively4-kernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgraichen%2Flively4-kernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgraichen%2Flively4-kernel/lists"}