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
use cached::proc_macro::cached; | |
use egui::text::LayoutJob; | |
use egui::FontFamily; | |
use egui::{Color32, FontId, TextFormat}; | |
use lazy_static::lazy_static; | |
use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter}; | |
lazy_static! { | |
static ref AST_TOKEN_TYPES: [(&'static str, &'static str); 20] = [ | |
("attribute", "#9cdcfe"), |
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
#[cfg(target_arch = "wasm32")] | |
use wasm_bindgen::prelude::*; | |
use std::sync::Arc; | |
use glyphon::{ | |
Attrs, Buffer, Color, Family, FontSystem, Metrics, Resolution, Shaping, SwashCache, TextArea, | |
TextAtlas, TextBounds, TextRenderer, | |
}; |
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
ARG ALPINE_VERSION=3.18 | |
ARG NGINX_VERSION=1.25.1 | |
ARG HEADERS_MORE_VERSION=0.37 | |
ARG NJS_VERSION=0.8.5 | |
FROM alpine:${ALPINE_VERSION} | |
ARG NGINX_DIR=nginx | |
ARG WORKSPACE_DIR=workspace | |
ARG MODULES_DIR=modules |
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
import { useCallback, useEffect, useRef } from 'react' | |
import dedent from 'ts-dedent' | |
export interface IOptions extends Omit<WorkerOptions, 'type'> { | |
mimeType?: BlobPropertyBag['type'] | |
workerType?: WorkerOptions['type'] | |
} | |
export type IFunc<R, P = any> = (...args: P[]) => R | Promise<R> |
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
/** | |
* Workaround for NX's lack of ESM support | |
* | |
* See the following issues: | |
* - {@link https://github.com/nrwl/nx/issues/16776 require() of ES Module executor.js ... not supported with custom plugin using es2015 module #16776 } | |
* - {@link https://github.com/nrwl/nx/issues/15682 ESM Support for Nx Plugins #15682} | |
* | |
* @type {<T, P = PromiseLike<T>>(module: string) => P} | |
*/ | |
const requireEsm = async module => { |