mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
Take the version of monaco-editor from package.json (#2010)
This commit is contained in:
parent
1f4f7fef4f
commit
09af07fbe1
4 changed files with 22 additions and 3 deletions
|
|
@ -1,7 +1,13 @@
|
|||
import { readFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import * as cf from '@pulumi/cloudflare';
|
||||
import * as pulumi from '@pulumi/pulumi';
|
||||
|
||||
const webAppPkgJsonFilepath = join(__dirname, '../../packages/web/app/package.json');
|
||||
const webAppPkg = JSON.parse(readFileSync(webAppPkgJsonFilepath, 'utf8'));
|
||||
|
||||
const cfConfig = new pulumi.Config('cloudflareCustom');
|
||||
const monacoEditorVersion = webAppPkg.dependencies['monaco-editor'];
|
||||
|
||||
function toExpressionList(items: string[]): string {
|
||||
return items.map(v => `"${v}"`).join(' ');
|
||||
|
|
@ -25,7 +31,7 @@ export function deployCloudFlareSecurityTransform(options: {
|
|||
options.ignoredPaths,
|
||||
)} } and not http.host in { ${toExpressionList(options.ignoredHosts)} }`;
|
||||
|
||||
const monacoCdnBasePath: `https://${string}/` = `https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/`;
|
||||
const monacoCdnBasePath: `https://${string}/` = `https://cdn.jsdelivr.net/npm/monaco-editor@${monacoEditorVersion}/`;
|
||||
const crispHost = 'client.crisp.chat';
|
||||
const stripeHost = 'js.stripe.com';
|
||||
const gtmHost = 'www.googletagmanager.com';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,14 @@
|
|||
import dynamic from 'next/dynamic';
|
||||
import { loader, DiffEditor as MonacoDiffEditor } from '@monaco-editor/react';
|
||||
import * as pkg from '../../package.json' assert { type: 'json' };
|
||||
|
||||
loader.config({
|
||||
paths: {
|
||||
vs: `https://cdn.jsdelivr.net/npm/monaco-editor@${pkg.dependencies['monaco-editor']}/min/vs`,
|
||||
},
|
||||
});
|
||||
|
||||
export { MonacoDiffEditor };
|
||||
|
||||
export const SchemaEditor = dynamic({
|
||||
async loader() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ReactElement } from 'react';
|
||||
import { MonacoDiffEditor } from '@/components/schema-editor';
|
||||
import { Spinner } from '@/components/v2';
|
||||
import { usePrettify } from '@/lib/hooks';
|
||||
import { DiffEditor as MonacoDiffEditor } from '@monaco-editor/react';
|
||||
|
||||
export const DiffEditor = ({ before, after }: { before: string; after: string }): ReactElement => {
|
||||
const sdlBefore = usePrettify(before);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
const { plugins, ...prettierConfig } = require('@theguild/prettier-config');
|
||||
|
||||
/**
|
||||
* @type {import('prettier').Config}
|
||||
*/
|
||||
module.exports = {
|
||||
...prettierConfig,
|
||||
importOrderParserPlugins: ['importAssertions', ...prettierConfig.importOrderParserPlugins],
|
||||
plugins: [
|
||||
require('prettier-plugin-sql'),
|
||||
// For sort CSS classes
|
||||
|
|
|
|||
Loading…
Reference in a new issue