Skip to content

Commit

Permalink
Chore: Release 10.3.0 (#3253)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome authored Jul 16, 2024
1 parent 3e734fc commit c7652cd
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 6 deletions.
4 changes: 4 additions & 0 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ module.exports = function (webpackEnv) {
'sass-loader'
)
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.ttf$/,
type: 'asset/resource'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graph-explorer-v2",
"version": "10.2.1",
"version": "10.3.0",
"private": true,
"dependencies": {
"@augloop/types-core": "file:packages/types-core-2.16.189.tgz",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ const SuffixRenderer = () => {

const getDocumentationLink = (): string | null => {
const { queries } = samples;

const getChildren = ()=> {
if (resources.data && Object.keys(resources.data).length > 0 && sampleQuery.selectedVersion in resources.data){
return resources.data[sampleQuery.selectedVersion].children ?? [];
}
return [];
}
const resourceDocumentationUrl = new DocumentationService({
sampleQuery,
source: Object.keys(resources.data).length > 0 ?
resources.data[sampleQuery.selectedVersion].children! : []
source: getChildren()
}).getDocumentationLink();

const sampleDocumentationUrl = new DocumentationService({
Expand Down
37 changes: 37 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,43 @@ function loadResources() {
}
loadResources();

/**
* Set's up Monaco Editor's Workers.
*/
enum Workers {
Json = 'json',
Editor = 'editor',
Typescript='ts',
Css='css',
Html='html'
}

window.MonacoEnvironment = {
getWorkerUrl(moduleId: any, label: string) {
switch (label) {
case 'json':
return getWorkerFor(Workers.Json);
case 'css':
return getWorkerFor(Workers.Css);
case 'html':
return getWorkerFor(Workers.Html);
case 'typescript':
return getWorkerFor(Workers.Typescript);
default:
return getWorkerFor(Workers.Editor);
}
}
};

function getWorkerFor(worker: string): string {
// tslint:disable-next-line:max-line-length
const WORKER_PATH =
'https://graphstagingblobstorage.blob.core.windows.net/staging/vendor/bower_components/explorer-v2/build';

return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
importScripts('${WORKER_PATH}/${worker}.worker.js');`)}`;
}

variantService.initialize();
const telemetryProvider: ITelemetry = telemetry;
telemetryProvider.initialize();
Expand Down
3 changes: 3 additions & 0 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Environment } from 'monaco-editor/esm/vs/editor/editor.api';

export {};
declare global {
interface Window {
ClientId: string | undefined
MonacoEnvironment: Environment;
}
}

Expand Down

0 comments on commit c7652cd

Please sign in to comment.