Files
phishing/deno/setup.ts
T
Jaco 3dd66ff0f5 Additional CI checks (#1754)
* Additional CI checks

* if: always()
2022-07-06 00:15:33 +03:00

28 lines
1.1 KiB
TypeScript

// Copyright 2020-2022 @polkadot/phishing authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable sort-keys */
import { stringCamelCase } from 'https://deno.land/x/polkadot/util/mod.ts';
const exports: string[] = [];
const imports: Record<string, string> = {};
for await (const entry of Deno.readDir('packages')) {
if (entry.isDirectory) {
try {
await Deno.readTextFile(`packages/${entry.name}/src/mod.ts`);
exports.push(`export * as ${stringCamelCase(entry.name)} from 'https://deno.land/x/polkadot/${entry.name}/mod.ts';`);
imports[`https://deno.land/x/polkadot/${entry.name}/`] = `../packages/${entry.name}/build-deno/`;
} catch {
// ignore
}
}
}
await Deno.writeTextFile('deno/check.ts', `// Copyright 2020-${new Date().getFullYear()} @polkadot/phishing authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\n// auto-generated via deno/setup.ts, do not edit\n\n${exports.sort().join('\n')}\n`);
await Deno.writeTextFile('deno/import_map.json', `${JSON.stringify({ imports }, null, 2)}\n`);