Skip to content

Commit

Permalink
📦 Upgrade MyST dependencies (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 committed Nov 14, 2023
1 parent 392731e commit d997102
Show file tree
Hide file tree
Showing 16 changed files with 258 additions and 320 deletions.
12 changes: 12 additions & 0 deletions .changeset/silent-countries-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'myst-to-react': patch
'myst-demo': patch
'@myst-theme/providers': patch
'@myst-theme/jupyter': patch
'@myst-theme/common': patch
'@myst-theme/article': patch
'@myst-theme/site': patch
'@myst-theme/book': patch
---

Update packages to latest myst versions
346 changes: 209 additions & 137 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"build": "npm-run-all -l clean -p build:esm"
},
"dependencies": {
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-spec-ext": "^1.1.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"myst-spec-ext": "^1.1.12",
"nbtx": "^0.2.3",
"unist-util-select": "^4.0.3"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/jupyter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"@scienceicons/react": "^0.0.6",
"buffer": "^6.0.3",
"classnames": "^2.3.2",
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-frontmatter": "^1.1.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"myst-frontmatter": "^1.1.12",
"myst-spec": "^0.0.4",
"myst-spec-ext": "^1.1.8",
"myst-spec-ext": "^1.1.12",
"myst-to-react": "^0.5.11",
"nanoid": "^4.0.2",
"nbtx": "^0.2.3",
Expand Down
2 changes: 0 additions & 2 deletions packages/jupyter/src/execute/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
selectSessionsToStart,
} from './selectors.js';
import { MdastFetcher, NotebookBuilder, ServerMonitor, SessionStarter } from './leaf.js';
import type { Thebe } from 'myst-frontmatter';
import { useCanCompute } from '../providers.js';
import type { GenericParent } from 'myst-common';

Expand All @@ -32,7 +31,6 @@ type ArticleContents = {
mdast: GenericParent;
location?: string;
dependencies?: Dependency[];
frontmatter: { thebe?: boolean | Thebe };
};

function useScopeNavigate({
Expand Down
42 changes: 3 additions & 39 deletions packages/jupyter/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import type {
Thebe,
JupyterServerOptions,
JupyterLocalOptions,
BinderHubOptions,
} from 'myst-frontmatter';
import type { Thebe, JupyterServerOptions, BinderHubOptions } from 'myst-frontmatter';
import type { CoreOptions, WellKnownRepoProvider } from 'thebe-core';

export type ExtendedCoreOptions = CoreOptions & {
Expand Down Expand Up @@ -73,46 +68,15 @@ export function thebeFrontmatterToOptions(
): ExtendedCoreOptions | undefined {
if (fm === undefined || fm === false) return undefined;

const {
binder,
server,
lite,
local,
kernelName,
disableSessionSaving,
mathjaxConfig,
mathjaxUrl,
} = (fm as Thebe | undefined) ?? {};
const { binder, server, lite, kernelName, disableSessionSaving, mathjaxConfig, mathjaxUrl } =
(fm as Thebe | undefined) ?? {};

const thebeOptions: ExtendedCoreOptions = { mathjaxConfig, mathjaxUrl };

if (disableSessionSaving) {
thebeOptions.savedSessionOptions = { enabled: false };
}

// handle thebe.local.*
// as local OVERRIDES other binder and server settings, handle these first
// TODO need to expose NODE_ENV somehow via a loader
let NODE_ENV = 'development';
if (typeof window !== 'undefined') {
NODE_ENV = (window as any).NODE_ENV;
}
if (NODE_ENV !== 'production' && local) {
if (isObject(local)) {
const { url, token, kernelName: localKernelName } = local as JupyterLocalOptions;
if (url || token) {
thebeOptions.serverSettings = {};
if (url) thebeOptions.serverSettings.baseUrl = url;
if (token) thebeOptions.serverSettings.token = token;
}
if (localKernelName) {
thebeOptions.kernelOptions = { kernelName: localKernelName };
}
}
return thebeOptions;
// else just fall through & return - TODO return early?
}

// handle additional options
if (kernelName) {
thebeOptions.kernelOptions = {
Expand Down
110 changes: 0 additions & 110 deletions packages/jupyter/test/thebeOptions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,116 +198,6 @@ describe('transforming thebe frontmatter', () => {
},
},
],
[
'thebe.local: true - overrides binder',
{
binder: true,
local: true,
},
'executablebooks/thebe-binder-base',
undefined,
{
useBinder: undefined,
useJuptyerLite: undefined,
},
],
[
'thebe.local: true - overrides lite',
{
lite: true,
local: true,
},
'executablebooks/thebe-binder-base',
undefined,
{
useBinder: undefined,
useJuptyerLite: undefined,
},
],
[
'thebe.local: true - overrides explicit server settings',
{
server: {
url: 'http://localhost:1234',
token: 'qwerty123456',
},
local: true,
},
undefined,
undefined,
{
useBinder: undefined,
useJuptyerLite: undefined,
},
],
[
'thebe.local.* - overrides binder',
{
binder: true,
local: {
url: 'http://localhost:1234',
token: 'qwerty123456',
kernelName: 'funky-chicken',
},
},
undefined,
undefined,
{
useBinder: undefined,
useJupyterLite: undefined,
serverSettings: {
baseUrl: 'http://localhost:1234',
token: 'qwerty123456',
},
kernelOptions: {
kernelName: 'funky-chicken',
},
},
],
[
'thebe.local.kernelName - overrides binder',
{
binder: true,
local: {
kernelName: 'funky-chicken',
},
},
undefined,
undefined,
{
kernelOptions: {
kernelName: 'funky-chicken',
},
},
],
[
'thebe.local.* - overides server settings',
{
server: {
url: 'http://remote:9999',
token: 'remoteToken',
},
kernelName: 'remoteKernel',
local: {
url: 'http://local:1234',
token: 'localToken',
kernelName: 'localKernel',
},
},
undefined,
undefined,
{
useBinder: undefined,
useJupyterLite: undefined,
serverSettings: {
baseUrl: 'http://local:1234',
token: 'localToken',
},
kernelOptions: {
kernelName: 'localKernel',
},
},
],
])('explicit options %s', (s, thebe: Thebe, githubBadgeUrl, binderBadgeUrl, result) => {
expect(thebeFrontmatterToOptions(thebe, githubBadgeUrl, binderBadgeUrl)).toEqual(result);
});
Expand Down
24 changes: 12 additions & 12 deletions packages/myst-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
"@heroicons/react": "^2.0.18",
"classnames": "^2.3.2",
"js-yaml": "^4.1.0",
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-directives": "^1.0.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"myst-directives": "^1.0.13",
"myst-ext-card": "^1.0.4",
"myst-ext-exercise": "^1.0.4",
"myst-ext-grid": "^1.0.4",
"myst-ext-proof": "^1.0.4",
"myst-ext-proof": "^1.0.6",
"myst-ext-tabs": "^1.0.4",
"myst-frontmatter": "^1.1.8",
"myst-parser": "^1.0.8",
"myst-frontmatter": "^1.1.12",
"myst-parser": "^1.0.13",
"myst-spec": "^0.0.4",
"myst-to-docx": "^1.0.5",
"myst-to-html": "^1.0.8",
"myst-to-jats": "^1.0.13",
"myst-to-docx": "^1.0.7",
"myst-to-html": "^1.0.13",
"myst-to-jats": "^1.0.16",
"myst-to-react": "^0.5.11",
"myst-to-tex": "^1.0.7",
"myst-to-typst": "^0.0.5",
"myst-transforms": "^1.1.2",
"myst-to-tex": "^1.0.12",
"myst-to-typst": "^0.0.6",
"myst-transforms": "^1.1.10",
"unified": "^10.1.2",
"unist-util-visit": "^4.1.2",
"vfile": "^5.3.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/myst-demo/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async function parse(
const jats: any = mystToJats
? unified()
.use(mystToJats, SourceFileKind.Article, frontmatter, undefined, '', {
spaces: 2,
format: 2,
writeFullArticle: options?.jats?.fullArticle,
})
.stringify(mdast as any, jatsFile).result
Expand Down
4 changes: 2 additions & 2 deletions packages/myst-to-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"@radix-ui/react-hover-card": "^1.0.6",
"buffer": "^6.0.3",
"classnames": "^2.3.2",
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"myst-spec": "^0.0.4",
"nanoid": "^4.0.2",
"react-syntax-highlighter": "^15.5.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"peerDependencies": {
"@types/react": "^16.8 || ^17.0 || ^18.0",
"@types/react-dom": "^16.8 || ^17.0 || ^18.0",
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-frontmatter": "^1.1.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"myst-frontmatter": "^1.1.12",
"react": "^16.8 || ^17.0 || ^18.0",
"react-dom": "^16.8 || ^17.0 || ^18.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@radix-ui/react-collapsible": "^1.0.3",
"classnames": "^2.3.2",
"lodash.throttle": "^4.1.1",
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"myst-demo": "^0.5.11",
"myst-spec-ext": "^1.1.8",
"myst-spec-ext": "^1.1.12",
"myst-to-react": "^0.5.11",
"nbtx": "^0.2.3",
"node-cache": "^5.1.2",
Expand Down
4 changes: 2 additions & 2 deletions themes/article/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"@remix-run/node": "~1.17.0",
"@remix-run/react": "~1.17.0",
"@remix-run/vercel": "~1.17.0",
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"node-fetch": "^2.6.11",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
1 change: 1 addition & 0 deletions themes/article/remix.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = {
'swr/immutable',
'devlop',
'@curvenote/ansi-to-react',
'jats-utils',
],
watchPaths: ['../../packages/**/*'],
future: {
Expand Down
4 changes: 2 additions & 2 deletions themes/book/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"@remix-run/node": "~1.17.0",
"@remix-run/react": "~1.17.0",
"@remix-run/vercel": "~1.17.0",
"myst-common": "^1.1.8",
"myst-config": "^1.1.8",
"myst-common": "^1.1.12",
"myst-config": "^1.1.12",
"node-fetch": "^2.6.11",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
1 change: 1 addition & 0 deletions themes/book/remix.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = {
'swr/immutable',
'devlop',
'@curvenote/ansi-to-react',
'jats-utils',
],
watchPaths: ['../../packages/**/*'],
future: {
Expand Down

0 comments on commit d997102

Please sign in to comment.