-
Notifications
You must be signed in to change notification settings - Fork 72
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
526 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tmp |
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,55 @@ | ||
/* global process */ | ||
import 'ses'; | ||
Check failure on line 2 in packages/ses/scripts/generate-test-xs.js GitHub Actions / lint (18.x, ubuntu-latest)
|
||
import { promises as fs } from 'fs'; | ||
// Lerna does not like dependency cycles. | ||
// With an explicit devDependency from module-source to compartment-mapper, | ||
// the build script stalls before running every package's build script. | ||
// yarn lerna run build | ||
// Omitting the dependency from package.json solves the problem and works | ||
// by dint of shared workspace node_modules. | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { makeBundle } from '@endo/compartment-mapper/bundle.js'; | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { ModuleSource } from '@endo/module-source'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const read = async location => { | ||
const path = fileURLToPath(location); | ||
return fs.readFile(path); | ||
}; | ||
const write = async (location, content) => { | ||
const path = fileURLToPath(location); | ||
await fs.writeFile(path, content); | ||
}; | ||
|
||
const main = async () => { | ||
const meaningText = await fs.readFile( | ||
fileURLToPath(new URL('../test/_meaning.js', import.meta.url)), | ||
'utf8', | ||
); | ||
const meaningModuleSource = new ModuleSource(meaningText); | ||
|
||
await fs.writeFile( | ||
fileURLToPath(new URL('../tmp/_meaning.pre-mjs.json', import.meta.url)), | ||
JSON.stringify(meaningModuleSource), | ||
); | ||
|
||
const xsPrelude = await makeBundle( | ||
read, | ||
new URL('../test/_xs.js', import.meta.url).href, | ||
{ | ||
tags: new Set(['xs']), | ||
}, | ||
); | ||
|
||
await fs.mkdir(fileURLToPath(new URL('../tmp', import.meta.url)), { | ||
recursive: true, | ||
}); | ||
|
||
await write(new URL('../tmp/test-xs.js', import.meta.url).href, xsPrelude); | ||
}; | ||
|
||
main().catch(err => { | ||
console.error('Error running main:', err); | ||
process.exitCode = 1; | ||
}); |
Oops, something went wrong.