mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
* chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks
27 lines
842 B
JavaScript
27 lines
842 B
JavaScript
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
|
|
|
|
// Dev-only script to ensure named exports only and ESM shape (ok to use Node here)
|
|
import { readFile } from 'node:fs/promises';
|
|
import { readdir } from 'node:fs/promises';
|
|
import { join } from 'node:path';
|
|
|
|
const dist = new URL('../dist/', import.meta.url);
|
|
const files = await readdir(dist);
|
|
let hasDefault = false;
|
|
|
|
for (const f of files) {
|
|
if (!f.endsWith('.js')) continue;
|
|
const src = await readFile(join(dist.pathname, f), 'utf8');
|
|
if (/\bexport\s+default\b/.test(src)) {
|
|
console.error(`Default export found in dist/${f}`);
|
|
hasDefault = true;
|
|
}
|
|
}
|
|
if (hasDefault) {
|
|
process.exitCode = 1;
|
|
} else {
|
|
console.log('OK: no default exports, ESM build looks clean.');
|
|
}
|