From 25586731ef628286353d0898871076b3b9258941 Mon Sep 17 00:00:00 2001 From: X Date: Tue, 18 Apr 2023 18:28:08 +0800 Subject: [PATCH] v116 --- CHANGELOG.md | 10 ++++++++++ Dockerfile | 2 +- README.md | 27 +++++++++++++++++++++------ server/consts.go | 2 +- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf2ab7c0a..276cf5f3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## v116 + +- Support modules/assets from Github repo (close #588) +- Update `nativeNodePackages` (close #591) +- Fix dep import url of cjs module (close #592) +- Add support of resolving `typesVersions` (close #593) +- Fix `exports` glob condition resloving (close #594) +- Remove shebang (close #596) +- Fix missed build version of dts files (close #589) + ## v115 - Return JavaScript modules for `?module` query with `wasm` files diff --git a/Dockerfile b/Dockerfile index 2176baa19..18704c132 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ RUN apt-get update -y && apt-get install -y xz-utils RUN useradd -u 1000 -m esm RUN mkdir /esm && chown esm:esm /esm RUN git clone https://github.com/esm-dev/esm.sh /esm/esm.sh -RUN git checkout v115 +RUN git checkout v116 USER esm WORKDIR /esm diff --git a/README.md b/README.md index 46ae7cc87..cb6eb2d0f 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,14 @@ # esm.sh -A fast, global content delivery network for [NPM](http://npmjs.org/) packages with **ES Module** format. +A fast, global content delivery network (CDN) for modern(es2015+) web development. -## Import from URL +

+ Chat + Twitter +

+ +## Import from NPM ```javascript import React from "https://esm.sh/react@18.2.0" @@ -30,6 +35,16 @@ or import non-module(js) as following: import "https://esm.sh/react@18.2.0/package.json" assert { type: "json" } ``` +## Import from GitHub Repo + +You can also import modules/assets from a github repo: `esm.sh/gh/OWNER/REPO/PATH` + +```javascript +import sfMeta from "https:/esms.h/gh/superfluid-finance/metadata" +``` + +or load a svg image from a github repo: https://esm.sh/gh/microsoft/fluentui-emoji/assets/Alien/Flat/alien_flat.svg + ### Specify Dependencies By default, esm.sh rewrites import specifiers based on the package dependencies. To specify the version of these dependencies, you can add the `?deps=PACKAGE@VERSION` query. To specify multiple dependencies, separate them with a comma, like this: `?deps=react@17.0.2,react-dom@17.0.2`. @@ -71,8 +86,8 @@ Import maps supports [**trailing slash**](https://github.com/WICG/import-maps#pa ```json { "imports": { - "react-dom": "https://esm.sh/react-dom@18.2.0?pin=v115&dev", - "react-dom/": "https://esm.sh/react-dom@18.2.0&pin=v115&dev/", + "react-dom": "https://esm.sh/react-dom@18.2.0?pin=v116&dev", + "react-dom/": "https://esm.sh/react-dom@18.2.0&pin=v116&dev/", } } ``` @@ -256,9 +271,9 @@ To ensure stable and consistent behavior, you may want to pin the build version The `?pin` query allows you to specify a specific build version of a module, which is an **immutable** cached version stored on the esm.sh CDN. ```javascript -import React from "https://esm.sh/react-dom?pin=v115" +import React from "https://esm.sh/react-dom?pin=v116" // or use version prefix -import React from "https://esm.sh/v115/react-dom" +import React from "https://esm.sh/v116/react-dom" ``` By using the `?pin` query in the import statement, you can rest assured that the version of the module you're using will not change, even if updates are pushed to the esm.sh server. This helps ensure the stability and reliability of your application. diff --git a/server/consts.go b/server/consts.go index a22b1e053..f98777973 100644 --- a/server/consts.go +++ b/server/consts.go @@ -2,7 +2,7 @@ package server const ( // esm.sh build version - VERSION = 115 + VERSION = 116 // esm.sh stable build version, used for UI libraries like react, to make sure the runtime is single copy // change this carefully STABLE_VERSION = 112