@sentry/wizard
Version:
Sentry wizard helping you to configure your project
27 lines • 1.42 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWranglerConfig = void 0;
// @ts-expect-error - clack is ESM and TS complains about that. It works though
const prompts_1 = __importDefault(require("@clack/prompts"));
const chalk_1 = __importDefault(require("chalk"));
const node_fs_1 = __importDefault(require("node:fs"));
const node_path_1 = __importDefault(require("node:path"));
/**
* Creates a basic wrangler.jsonc config file for a Cloudflare Worker
*/
function createWranglerConfig() {
const configPath = node_path_1.default.join(process.cwd(), 'wrangler.jsonc');
const config = {
$schema: 'node_modules/wrangler/config-schema.json',
name: 'my-worker',
main: 'src/index.ts',
};
node_fs_1.default.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
prompts_1.default.log.success(`Created ${chalk_1.default.cyan('wrangler.jsonc')} configuration file.`);
prompts_1.default.log.info(`Please update the ${chalk_1.default.cyan('name')} and ${chalk_1.default.cyan('main')} fields in ${chalk_1.default.cyan('wrangler.jsonc')} to match your worker name and entry point.`);
}
exports.createWranglerConfig = createWranglerConfig;
//# sourceMappingURL=create-wrangler-config.js.map