-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
126 additions
and
981 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
import { isJvm } from '../util/detect' | ||
|
||
async function resolveImports() { | ||
if (isJvm) { | ||
const javaImpl = await import('./ffiJvm') | ||
return javaImpl | ||
} else { | ||
const wasmImpl = await import('./ffiWasm') | ||
return wasmImpl | ||
} | ||
declare global { | ||
function parse_tree(code: string): Uint8Array; | ||
function parse_doc_to_json(docs: string): string; | ||
function is_ident_or_operator(code: string): number; | ||
function xxHash128(input: string): string; | ||
} | ||
|
||
const { is_ident_or_operator, parse_doc_to_json, parse_tree, initializeFFI, xxHash128 } = | ||
await resolveImports() | ||
|
||
// TODO[ao]: We cannot to that, because the ffi is used by cjs modules. | ||
// await initializeFFI() | ||
export async function initializeFFI(path?: string | undefined) {} | ||
|
||
/* eslint-disable-next-line camelcase */ | ||
export { initializeFFI, is_ident_or_operator, parse_doc_to_json, parse_tree, xxHash128 } | ||
export const { is_ident_or_operator, parse_doc_to_json, parse_tree, xxHash128 } = globalThis; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// <reference types="histoire" /> | ||
|
||
import { getDefines, readEnvironmentFromFile } from 'enso-common/src/appConfig' | ||
import { fileURLToPath } from 'node:url' | ||
import { defineConfig } from 'vite' | ||
const localServerPort = 8080 | ||
const projectManagerUrl = 'ws://127.0.0.1:30535' | ||
|
||
const IS_CLOUD_BUILD = process.env.CLOUD_BUILD === 'true' | ||
|
||
await readEnvironmentFromFile() | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
root: fileURLToPath(new URL('.', import.meta.url)), | ||
cacheDir: fileURLToPath(new URL('../../node_modules/.cache/vite', import.meta.url)), | ||
publicDir: fileURLToPath(new URL('./public', import.meta.url)), | ||
envDir: fileURLToPath(new URL('.', import.meta.url)), | ||
resolve: { | ||
alias: { | ||
shared: fileURLToPath(new URL('./shared', import.meta.url)), | ||
'@': fileURLToPath(new URL('./src', import.meta.url)), | ||
}, | ||
}, | ||
define: { | ||
...getDefines(localServerPort), | ||
IS_CLOUD_BUILD: JSON.stringify(IS_CLOUD_BUILD), | ||
PROJECT_MANAGER_URL: JSON.stringify(projectManagerUrl), | ||
RUNNING_VITEST: false, | ||
'import.meta.vitest': false, | ||
// Single hardcoded usage of `global` in aws-amplify. | ||
'global.TYPED_ARRAY_SUPPORT': true, | ||
}, | ||
build: { | ||
minify: false, | ||
outDir: '../../lib/java/js-websocket/target/classes/dist', | ||
rollupOptions: { | ||
input: { | ||
ydocServer: fileURLToPath(new URL('ydoc-server/server.ts', import.meta.url)), | ||
}, | ||
output: { | ||
entryFileNames: `assets/[name].js`, | ||
}, | ||
}, | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.