Releases: astrohelm/isolation
Releases · astrohelm/isolation
Isolation v1.5.0
Update 2023-10-30
- Depth option, now you can limit reader depth
- Method
from
now allow to pass code and pathname as source - Renamed default script name "Astro" -> "ISO"
- Code quality improvements
- Performance improvements
Isolation v1.4.0
Update 2023-10-26
- JSDoc enhancements
- Renamed require -> from
- Support latest:21 nodejs version
- Renamed Access types from [sandbox, internal] -> [realm, reader]
Isolation v1.3.0
v1.3.0
Astroctx v1.2.0
Update 2023-10-25
- Fix type definitions
- New default global variables
- Tests
Astroctx v1.1.0
2023-10-01
Major updates
- Removed astro syntax with type option, now only supports common js syntax.
- Context updates
- Renamed to sandbox, example:
Astroctx.sandbox
- To create new contexts you should use
Astroctx.sandbox({ myCtxVariable: 'test' })
- All presets still should be working properly with
Astroctx.sandbox[preset-key]
- Renamed to sandbox, example:
- Reader updates
- Joined with require, now require works as reader, examples:
Astroctx.require('./my-path/to/script.js'); Astroctx.require.script('./my-path/to/script.js'); Astroctx.require.dir('./my-path/to');
- New access controll feature, see access updates
- Joined with require, now require works as reader, examples:
- Access updates, now this option work for both sandbox and reader, you need to provide function
const option = { access: pathOrModule => pathOrModule === 'fs' || pathOrModule.endsWith('.js') }; Astroctx.execute('module.exports = require("fs")'); Astroctx.read('./path/to/script.js'); // But you still can controll them by each own function const option = { access: { internal: path => true, // Reader controll sandbox: module => {}, // Sandbox require controll }, };
Sandbox function can return object or boolean value, in case of object it will be used as stub
content
Minor updates
-
Created new tests, new tests coverage ~85%
-
NPM Isolation fix, now it should work properly
const script = Astroctx.execute(`module.exports = require('chalk')`, { access: { sandbox: () => true }, npmIsolation: true, ctx: sandbox.NODE, }); // Output: Chalk function
Astoctx v1.0.0
1.0.0 - 2023-08-26
- Transferred from leadfisher
- Code quality improved
- Tests updates
- Api updates
- JSDoc
- New
prepare
option - Quality of life improvements
- Massive README update, documentation improvement