From 3e38e6c4f72b5da083bccd99abc3b25ecf139fa1 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Wed, 20 Apr 2022 10:00:46 -0500 Subject: [PATCH 1/6] http-api: updating dist to be more compatible with node --- pkg/npm/http-api/package.json | 6 +++++- pkg/npm/http-api/rollup.config.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/npm/http-api/package.json b/pkg/npm/http-api/package.json index 8b5f497679..4101cc4a07 100644 --- a/pkg/npm/http-api/package.json +++ b/pkg/npm/http-api/package.json @@ -9,8 +9,12 @@ "directory": "pkg/npm/http-api" }, "type": "module", - "main": "dist/cjs/index.js", + "main": "dist/cjs/index.cjs", "module": "dist/esm/index.js", + "exports": { + "require": "./dist/cjs/index.cjs", + "import": "./dist/esm/index.js" + }, "jsdelivr": "dist/urbit-http-api.min.js", "unpkg": "dist/urbit-http-api.min.js", "types": "dist/index.d.ts", diff --git a/pkg/npm/http-api/rollup.config.ts b/pkg/npm/http-api/rollup.config.ts index 6ad92c7eb1..75767ba08d 100644 --- a/pkg/npm/http-api/rollup.config.ts +++ b/pkg/npm/http-api/rollup.config.ts @@ -56,13 +56,13 @@ export default [ ], output: [ { - dir: 'dist/esm', + file: 'dist/esm/index.js', format: 'esm', exports: 'named', sourcemap: true, }, { - dir: 'dist/cjs', + file: 'dist/cjs/index.cjs', format: 'cjs', exports: 'named', sourcemap: true, From b8fca68db635b45f20271eeba132e3806a52ad05 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Tue, 26 Apr 2022 15:25:09 -0700 Subject: [PATCH 2/6] grid: pasting shortcodes redirects to app page Current behaviour when pasting, eg. `~paldev/pals` is to show the list of all apps by ~paldev, even though the URL knows we're looking for pals (eg. `/~paldev/apps/pals`). By reconstructing the URL to include the host and desk twice, we can redirect straight to the app prompt, as that's where that route exists. --- pkg/grid/src/nav/Leap.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/grid/src/nav/Leap.tsx b/pkg/grid/src/nav/Leap.tsx index ab2710a0ce..df09f855be 100644 --- a/pkg/grid/src/nav/Leap.tsx +++ b/pkg/grid/src/nav/Leap.tsx @@ -72,7 +72,6 @@ export const Leap = React.forwardRef( useEffect(() => { const newMatch = getMatch(rawInput); - if (newMatch && rawInput) { useLeapStore.setState({ selectedMatch: newMatch }); } @@ -112,7 +111,7 @@ export const Leap = React.forwardRef( const navigateByInput = useCallback( (input: string) => { - const normalizedValue = input.trim().replace(/(~?[\w^_-]{3,13})\//, '$1/apps/'); + const normalizedValue = input.trim().replace(/(~?[\w^_-]{3,13})\//, '$1/apps/$1/'); push(`/leap/${menu}/${normalizedValue}`); }, [menu] From 243a7dd22a6ed92c4b969707a072ce1d2a577344 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Wed, 27 Apr 2022 11:17:57 -0500 Subject: [PATCH 3/6] api: make same dist updates as http-api --- pkg/npm/api/package.json | 8 ++++++-- pkg/npm/api/rollup.config.ts | 6 +++--- pkg/npm/http-api/package.json | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pkg/npm/api/package.json b/pkg/npm/api/package.json index b6b3761236..88caa2f899 100644 --- a/pkg/npm/api/package.json +++ b/pkg/npm/api/package.json @@ -1,6 +1,6 @@ { "name": "@urbit/api", - "version": "2.1.0", + "version": "2.1.1", "description": "A library that provides bindings and types for Urbit's various userspace desks", "repository": { "type": "git", @@ -8,8 +8,12 @@ "directory": "pkg/npm/api" }, "type": "module", - "main": "dist/cjs/index.js", + "main": "dist/cjs/index.cjs", "module": "dist/esm/index.js", + "exports": { + "require": "./dist/cjs/index.cjs", + "import": "./dist/esm/index.js" + }, "jsdelivr": "dist/urbit-api.min.js", "unpkg": "dist/urbit-api.min.js", "types": "dist/index.d.ts", diff --git a/pkg/npm/api/rollup.config.ts b/pkg/npm/api/rollup.config.ts index 449bcc869c..8664a48ae2 100644 --- a/pkg/npm/api/rollup.config.ts +++ b/pkg/npm/api/rollup.config.ts @@ -60,13 +60,13 @@ export default [ ], output: [ { - dir: 'dist/esm', + file: 'dist/esm/index.js', format: 'esm', exports: 'named', - sourcemap: true + sourcemap: true, }, { - dir: 'dist/cjs', + file: 'dist/cjs/index.cjs', format: 'cjs', exports: 'named', sourcemap: true diff --git a/pkg/npm/http-api/package.json b/pkg/npm/http-api/package.json index 4101cc4a07..1ac27d0348 100644 --- a/pkg/npm/http-api/package.json +++ b/pkg/npm/http-api/package.json @@ -1,6 +1,6 @@ { "name": "@urbit/http-api", - "version": "2.1.0", + "version": "2.1.1", "license": "MIT", "description": "Library to interact with an Urbit ship over HTTP", "repository": { From fb63f840cc6ea98f45c47f81cd84f84b1f3d5047 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Sun, 8 May 2022 16:42:19 -0700 Subject: [PATCH 4/6] garden: add symbolic link to css.hoon --- pkg/garden/mar/css.hoon | 1 + 1 file changed, 1 insertion(+) create mode 120000 pkg/garden/mar/css.hoon diff --git a/pkg/garden/mar/css.hoon b/pkg/garden/mar/css.hoon new file mode 120000 index 0000000000..53211538d5 --- /dev/null +++ b/pkg/garden/mar/css.hoon @@ -0,0 +1 @@ +../../arvo/mar/css.hoon \ No newline at end of file From 7c646417b62d70419cf181c477caf630585d5fdc Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 9 May 2022 12:41:50 -0700 Subject: [PATCH 5/6] base-dev: add css.hoon, switch others to symlink --- pkg/arvo/mar/css.hoon | 22 +--------------------- pkg/base-dev/mar/css.hoon | 21 +++++++++++++++++++++ pkg/garden/mar/css.hoon | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) mode change 100644 => 120000 pkg/arvo/mar/css.hoon create mode 100644 pkg/base-dev/mar/css.hoon diff --git a/pkg/arvo/mar/css.hoon b/pkg/arvo/mar/css.hoon deleted file mode 100644 index c4810b2118..0000000000 --- a/pkg/arvo/mar/css.hoon +++ /dev/null @@ -1,21 +0,0 @@ -:: -:::: /hoon/css/mar - :: -/? 310 -=, eyre -=, mimes:html -|_ mud=@t -++ grow :: convert to - |% ++ mime [/text/css (as-octs mud)] :: convert to %mime - ++ elem ;style :: convert to %hymn - ;- (trip mud) - == - ++ hymn ;html:(head:"{elem}" body) - -- -++ grab - |% :: convert from - ++ mime |=([p=mite q=octs] (@t q.q)) - ++ noun @t :: clam from %noun - -- -++ grad %mime --- diff --git a/pkg/arvo/mar/css.hoon b/pkg/arvo/mar/css.hoon new file mode 120000 index 0000000000..dff5dfcd53 --- /dev/null +++ b/pkg/arvo/mar/css.hoon @@ -0,0 +1 @@ +../../base-dev/mar/css.hoon \ No newline at end of file diff --git a/pkg/base-dev/mar/css.hoon b/pkg/base-dev/mar/css.hoon new file mode 100644 index 0000000000..c4810b2118 --- /dev/null +++ b/pkg/base-dev/mar/css.hoon @@ -0,0 +1,21 @@ +:: +:::: /hoon/css/mar + :: +/? 310 +=, eyre +=, mimes:html +|_ mud=@t +++ grow :: convert to + |% ++ mime [/text/css (as-octs mud)] :: convert to %mime + ++ elem ;style :: convert to %hymn + ;- (trip mud) + == + ++ hymn ;html:(head:"{elem}" body) + -- +++ grab + |% :: convert from + ++ mime |=([p=mite q=octs] (@t q.q)) + ++ noun @t :: clam from %noun + -- +++ grad %mime +-- diff --git a/pkg/garden/mar/css.hoon b/pkg/garden/mar/css.hoon index 53211538d5..dff5dfcd53 120000 --- a/pkg/garden/mar/css.hoon +++ b/pkg/garden/mar/css.hoon @@ -1 +1 @@ -../../arvo/mar/css.hoon \ No newline at end of file +../../base-dev/mar/css.hoon \ No newline at end of file From f416d4d4faaf6f9c65df9d3e2a62b6224d9f1f0d Mon Sep 17 00:00:00 2001 From: Patrick O'Sullivan Date: Fri, 13 May 2022 11:15:50 -0500 Subject: [PATCH 6/6] landscape/grid: Prevent cen from breaking react router in grid's leap --- pkg/grid/src/nav/Leap.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/grid/src/nav/Leap.tsx b/pkg/grid/src/nav/Leap.tsx index df09f855be..fa293720ca 100644 --- a/pkg/grid/src/nav/Leap.tsx +++ b/pkg/grid/src/nav/Leap.tsx @@ -111,7 +111,10 @@ export const Leap = React.forwardRef( const navigateByInput = useCallback( (input: string) => { - const normalizedValue = input.trim().replace(/(~?[\w^_-]{3,13})\//, '$1/apps/$1/'); + const normalizedValue = input + .trim() + .replace('%', '') + .replace(/(~?[\w^_-]{3,13})\//, '$1/apps/$1/'); push(`/leap/${menu}/${normalizedValue}`); }, [menu]