Deno plugins (#42)

Switch from BoaJS to Deno core
This commit is contained in:
Gregory Schier
2024-06-07 10:47:41 -07:00
committed by GitHub
parent f43b38c893
commit acfc254a58
32 changed files with 1378 additions and 5663 deletions

View File

@@ -13,7 +13,11 @@ interface ExportResources {
folders: AtLeast<Folder, 'name' | 'id' | 'model' | 'workspaceId'>[];
}
export function pluginHookImport(contents: string): { resources: ExportResources } | undefined {
export function pluginHookImport(
ctx: any,
contents: string,
): { resources: ExportResources } | undefined {
console.log('CTX', ctx);
const root = parseJSONToRecord(contents);
if (root == null) return;

View File

@@ -23,7 +23,7 @@ describe('importer-postman', () => {
for (const fixture of fixtures) {
test('Imports ' + fixture, () => {
const contents = fs.readFileSync(path.join(p, fixture), 'utf-8');
const imported = pluginHookImport(contents);
const imported = pluginHookImport({}, contents);
const folder0 = newId('folder');
const folder1 = newId('folder');
expect(imported).toEqual({

View File

@@ -8,6 +8,8 @@ export default defineConfig({
fileName: 'index',
formats: ['es'],
},
outDir: resolve(__dirname, '../../src-tauri/plugins/importer-postman'),
emptyOutDir: true,
sourcemap: true,
outDir: resolve(__dirname, 'build'),
},
});