Skip to content

Releases: astrohelm/isolation

Isolation v1.5.0

30 Oct 16:24
Compare
Choose a tag to compare

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

26 Oct 13:53
Compare
Choose a tag to compare

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

26 Oct 11:37
Compare
Choose a tag to compare

Astroctx v1.2.0

25 Oct 17:29
c60c169
Compare
Choose a tag to compare

Update 2023-10-25

  • Fix type definitions
  • New default global variables
  • Tests

Astroctx v1.1.0

01 Oct 18:01
Compare
Choose a tag to compare

2023-10-01

Major updates

  • Removed astro syntax with type option, now only supports common js syntax.
  • Context updates
    1. Renamed to sandbox, example: Astroctx.sandbox
    2. To create new contexts you should use Astroctx.sandbox({ myCtxVariable: 'test' })
    3. All presets still should be working properly with Astroctx.sandbox[preset-key]
  • Reader updates
    1. 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');
    2. New access controll feature, see access updates
  • 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

26 Aug 20:11
Compare
Choose a tag to compare

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