-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: full Node.js ESM runtime support (#86)
BREAKING CHANGE: We have removed the default export and replaced it with a named one: ```diff -import SanityClient from '@sanity/client' +import {createClient} from '@sanity/client' ``` We're working on a codemod for this migration. [The migration guide outlines every breaking change and how to migrate your code](https://github.com/sanity-io/client#from-v4) - feat: full ESM support in modern runtimes and tooling (Bun, Deno, Edge, without breaking Node.js ESM and CJS compatibility) - feat: codebase rewritten in TypeScript, typings are generated and no longer manually maintained - feat: make `httpRequest` on `SanityClient` configurable, intended for libraries wishing to extend the client - feat: shipping modern syntax, reducing bundlesize Co-authored-by: Cody Olsen <81981+stipsan@users.noreply.github.com> Co-authored-by: Knut Melvær <knut@sanity.io> Co-authored-by: Espen Hovlandsdal <espen@hovlandsdal.com> Co-authored-by: Bjørge Næss <876086+bjoerge@users.noreply.github.com>
- Loading branch information
1 parent
371515b
commit bd9b247
Showing
91 changed files
with
20,937 additions
and
20,634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
dist | ||
lib | ||
umd | ||
coverage | ||
.nyc_output | ||
runtimes/deno | ||
runtimes/node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:prettier/recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
plugins: ['@typescript-eslint', 'simple-import-sort', 'prettier'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'error', // use the FIXME alias instead | ||
'@typescript-eslint/member-delimiter-style': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'simple-import-sort/imports': 'warn', | ||
'simple-import-sort/exports': 'warn', | ||
'no-console': 'error', | ||
'no-shadow': 'error', | ||
'no-warning-comments': ['warn', {location: 'start', terms: ['todo', '@todo', 'fixme']}], | ||
'prettier/prettier': 'warn', | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
files: ['**/*.js'], | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**/*.ts'], | ||
rules: { | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Maintain deno/import_map.json | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- 'package.json' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
name: deno run update_import_map.ts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3 | ||
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3 | ||
with: | ||
cache: npm | ||
node-version: lts/* | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: vx.x.x | ||
- run: npm run test:deno:update_import_map | ||
- uses: EndBug/add-and-commit@61a88be553afe4206585b31aa72387c64295d08b # v9 | ||
with: | ||
message: 'chore(deno): update import_map.json' | ||
default_author: github_actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: 'Lock Threads' | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
action: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dessant/lock-threads@v4 | ||
with: | ||
issue-inactive-days: 0 | ||
pr-inactive-days: 0 |
Oops, something went wrong.