Skip to content

Releases: tommy351/kosko

@kosko/[email protected]

13 Apr 16:10
db40fe9
Compare
Choose a tag to compare

Patch Changes

@kosko/[email protected]

13 Apr 16:10
db40fe9
Compare
Choose a tag to compare

Minor Changes

  • #73 2718ffe Thanks @tommy351! - Add resolve function.

  • #73 5c09694 Thanks @tommy351! - Support Promise in generate and resolve function.

  • #73 35c5ce8 Thanks @tommy351! - Update the type of PrintOptions.writer. The type becomes a simplified Writer interface instead of the Node.js stream type.

Patch Changes

@kosko/[email protected]

13 Apr 16:10
db40fe9
Compare
Choose a tag to compare

Major Changes

  • #73 b90c724 Thanks @tommy351! - Add support for browser. Several APIs were introduced in this release.

    • Loader interface
    • createEnvironment function
    • createAsyncEnvironment function
    • createNodeCJSEnvironment function
    • createNodeESMEnvironment function
    • createSyncEnvironment function
    • createSyncLoaderReducers function
    • createAsyncLoaderReducers function

    The following example shows how to use this package in browsers.

    import env, { createLoaderReducers } from "@kosko/env";
    
    env.setReducers(reducers => [
      ...reducers,
      ...createAsyncLoaderReducers({
        global: () =>
          import("./environments/dev/index.js").then(mod => mod.default),
        component: name =>
          import(`./environments/dev/${name}.js`).then(mod => mod.default)
      })
    ]);

    BREAKING CHANGES: The following APIs were changed in this release.

    • Environment class → Environment interface
    • SyncEnvironment class → createNodeCJSEnvironment function
    • AsyncEnvironment class → createNodeESMEnvironment function

    You don't have to change anything, unless you initialize these classes manually.

    // Before
    const { Environment } = require("@kosko/env");
    const env = new Environment(process.cwd());
    
    // After
    const { createNodeCJSEnvironment } = require("@kosko/env");
    const env = createNodeCJSEnvironment({ cwd: process.cwd() });

Patch Changes

@kosko/[email protected]

13 Apr 16:10
db40fe9
Compare
Choose a tag to compare

Patch Changes

@kosko/[email protected]

13 Apr 16:10
db40fe9
Compare
Choose a tag to compare

Patch Changes