Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release synckit #146

Merged
merged 1 commit into from
Dec 26, 2023
Merged

chore: release synckit #146

merged 1 commit into from
Dec 26, 2023

Conversation

JounQin
Copy link
Member

@JounQin JounQin commented Dec 26, 2023

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

synckit@0.8.7

Patch Changes

  • #145 b2affa0 Thanks @JounQin! - feat: add new globalShims option, what means you can env SYNCKIT_GLOBAL_SHIMS=1 to enable auto polyfilling for some modules, for example: fetch from node-fetch, performance from node:perf_hooks.

    You can also pass a custom globalShims option as GlobalShim Array to custom your own shims:

    export interface GlobalShim {
      moduleName: string
      /**
       * `undefined` means side effect only
       */
      globalName?: string
      /**
       * 1. `undefined` or empty string means `default`, for example:
       * ```js
       * import globalName from 'module-name'
       * ```
       *
       * 2. `null` means namespaced, for example:
       * ```js
       * import * as globalName from 'module-name'
       * ```
       *
       */
      named?: string | null
      /**
       * If not `false`, the shim will only be applied when the original `globalName` unavailable,
       * for example you may only want polyfill `globalThis.fetch` when it's unavailable natively:
       * ```js
       * import fetch from 'node-fetch'
       *
       * if (!globalThis.fetch) {
       *   globalThis.fetch = fetch
       * }
       * ```
       */
      conditional?: boolean
    }

    You can aslo reuse the exported DEFAULT_GLOBAL_SHIMS_PRESET for extanding:

    import { DEFAULT_GLOBAL_SHIMS_PRESET, createSyncFn } from 'synckit'
    
    const syncFn = createSyncFn(require.resolve('./worker'), {
      globalShims: [
        ...DEFAULT_GLOBAL_SHIMS_PRESET,
        // your own shim here
      ],
    })

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

📊 Package size report   No changes

File Before After
Total (Includes all files) 57.1 kB 57.1 kB
Tarball size 14.9 kB -0.03%↓14.9 kB
Unchanged files
File Size
lib/index.cjs 13.7 kB
lib/index.d.ts 1.9 kB
lib/index.js 13.5 kB
lib/index.js.map 13.3 kB
lib/types.d.ts 1.0 kB
lib/types.js 44 B
lib/types.js.map 102 B
LICENSE 1.1 kB
package.json 3.5 kB
README.md 9.0 kB

🤖 This report was automatically generated by pkg-size-action

@JounQin JounQin enabled auto-merge (squash) December 26, 2023 03:10
Copy link

codecov bot commented Dec 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b2affa0) 100.00% compared to head (3485970) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #146   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          207       207           
  Branches       103       103           
=========================================
  Hits           207       207           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JounQin JounQin merged commit c5eaca3 into main Dec 26, 2023
19 checks passed
@JounQin JounQin deleted the changeset-release/main branch December 26, 2023 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant