Commit Graph

25 Commits

Author SHA1 Message Date
KernelDeimos 39fdcec9bf fix: add missing utilities.js 2025-10-03 17:12:41 -04:00
KernelDeimos 9c5b96305a example(extensions): [+] example-kv 2025-10-03 16:53:23 -04:00
KernelDeimos 36b30ebf57 dev(extensions): [+] extension-examples:ii:hello-world 2025-10-02 18:35:20 -04:00
KernelDeimos 54b8990c70 devex(extensions): simplify kv get and set methods
The basic `.get()` and `.set()` calls should be the same between
persistent key-value store (puter-kvstore) and in-memory cache (kv.js).
This commit wraps these methods to support the "shorthand" usage.
2025-10-02 16:53:59 -04:00
KernelDeimos 36ddad0ecc lint: add config global to extensions 2025-10-01 16:58:46 -04:00
KernelDeimos 9946d2ffc5 dev(extensions): event for extensions to grant permst 2025-10-01 16:46:59 -04:00
KernelDeimos 574088ea55 doc: improve extension documentation
- describe extension events
- link drivers documentation
2025-10-01 16:03:24 -04:00
KernelDeimos ec8111cc2f dev(extensions): improved configuration support
Extensions now read configuration objects under the "extensions" block
in the backend configuration. Additionally, a `config.json` for default
values directly in the extension's directory is now supported.
2025-10-01 15:29:13 -04:00
KernelDeimos c11a4008ee doc: improve comments in hellodriver.js
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
2025-09-30 17:12:09 -04:00
KernelDeimos 057eaa46ca dev(extensions): [+] hellodriver
The hellodriver extension provides a useful interface for generating
greetings at the same time as a simple example of how to implement
drivers.
2025-09-30 16:33:34 -04:00
KernelDeimos d85f5fad5e dev: expose 'kv' as 'cache' from data extension
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
2025-09-26 17:31:00 -04:00
KernelDeimos 601eb019a2 dev(extensions): [+] data
The data extension adds convenient access to the database and kvstore
via it's 'db' and 'kv' exports.

Example usage:
  const { db, kv } = extensions.import('data');
  await kv.set('some-key', 'some-value');
  await db.write('INSERT INTO something (a, b) VALUES (1, 2)');
2025-09-26 15:28:00 -04:00
KernelDeimos 0c30a9e157 fixup! dev(extensions): [+] whoami 2025-09-26 15:28:00 -04:00
KernelDeimos dabf8cac56 fix: add missing dep to whoami extension 2025-09-26 15:28:00 -04:00
KernelDeimos cb31c1d44e dev: add command to list extensions
This commit adds the `extension:list` command for listing extensions.
This command is itself defined in an extension. To make this possible,
an event called 'create.commands' is emitted form CommandService with
the event object holding a function that can be used to add commands.
2025-09-26 15:27:59 -04:00
KernelDeimos 7b4c62d1c3 lint: minor formatting issue with catch(e)
The custom eslint pluggin for the formatting rule I have for the
expressions in control structures isn't a good fit when the condition is
a single variable named by a single character. This happens a lot with
`catch`. `catch ( e ) {` has too much spacing, but `catch (e) {` looks
relatively normal.
2025-09-26 15:27:59 -04:00
KernelDeimos 353cf397cb dev: remove legacy whoami and use extension 2025-09-26 15:27:59 -04:00
KernelDeimos ebbe18f72d dev(extensions): [+] whoami 2025-09-26 15:27:59 -04:00
KernelDeimos 943a3c7bab type(extensions): config and add core.util.helpers 2025-09-26 15:27:58 -04:00
KernelDeimos 1358e98c5b devex: add some types for extension intellisense 2025-09-26 15:27:58 -04:00
KernelDeimos e271476e0b tweak: alias 'runtime' to 'extension'
Extension developers should not have to remember what comes form
where between two different globals. This change makes Extension
effectively a facade (Facade Pattern) containing the behaviors
of both extensions and runtime modules.
2025-09-26 15:27:57 -04:00
KernelDeimos 9aef281ad2 dev: add runtime modules for imports and exports
RuntimeModule is a new construct which represents the import/export
mechanism for Puter extensions. This can be thought of as analogous
to node's Module class. These are called "runtime modules" because
extensions have less control of what they're consuming than a typical
npm module; i.e. `runtime.import('database')` will provide a version
of 'database' that's compatible with the importing extension, but the
version used can't be locked or otherwise determined by the extension.
2025-09-26 15:27:57 -04:00
KernelDeimos e5f23e815d dev: disable textex by default
it's too verbose now
2025-03-31 20:07:19 -04:00
ajaykrishnaswamy 782e858b3c Update (and automate) events docs (#1164)
Docker Image CI / build-and-push-image (push) Waiting to run
Maintain Release Merge PR / update-release-pr (push) Waiting to run
release-please / release-please (push) Waiting to run
test / test (18.x) (push) Waiting to run
test / test (20.x) (push) Waiting to run
test / test (22.x) (push) Waiting to run
* documentation: new documentation for emit features

* Update events documentation and doc_helper.js script

* Update package.json

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>

* added manual_overrides.json.js file

* Update doc_helper.js to resolve paths relative to project root and update events documentation

* created a new events.md generated file, differences can be seen.

* added and populated events.md file. Can now compare new and old versions

---------

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>
2025-03-16 12:41:14 -04:00
KernelDeimos 05573dad51 tweak: load mods from extensions directory 2024-11-01 19:29:16 -04:00