Commit Graph

15 Commits

Author SHA1 Message Date
KernelDeimos
d85f5fad5e dev: expose 'kv' as 'cache' from data extension 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)
* 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