🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@clerk/dev-cli

Package Overview
Dependencies
Maintainers
0
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clerk/dev-cli - npm Package Compare versions

Comparing version

to
0.0.7-canary.v15121ad

src/utils/errors.js

2

package.json
{
"name": "@clerk/dev-cli",
"description": "CLI tool designed to simplify the process of iterating on packages within the clerk/javascript repository",
"version": "0.0.6",
"version": "0.0.7-canary.v15121ad",
"license": "MIT",

@@ -6,0 +6,0 @@ "type": "module",

@@ -69,3 +69,6 @@ import { Command } from 'commander';

program.parseAsync();
program.parseAsync().catch(err => {
console.error(err.message);
process.exit(1);
});
}
import { spawn } from 'node:child_process';
import { existsSync } from 'node:fs';
import { mkdir, writeFile } from 'node:fs/promises';

@@ -12,2 +13,8 @@ import { dirname, join } from 'node:path';

export async function init() {
// If the config file already exists, print a warning and exit.
if (existsSync(CONFIG_FILE)) {
console.warn('Configuration file already exists. Run `clerk-dev config` to open it.');
return;
}
const cliRoot = getCLIRoot();

@@ -14,0 +21,0 @@

@@ -9,2 +9,3 @@ import { spawn } from 'node:child_process';

import { applyCodemod } from '../codemods/index.js';
import { INVALID_INSTANCE_KEYS_ERROR } from '../utils/errors.js';
import { getClerkPackages } from '../utils/getClerkPackages.js';

@@ -68,3 +69,7 @@ import { getConfiguration } from '../utils/getConfiguration.js';

const { activeInstance, instances } = configuration;
return instances[activeInstance];
const activeInstanceConfig = instances[activeInstance];
if (!activeInstanceConfig.publishableKey.startsWith('pk_') || !activeInstanceConfig.secretKey.startsWith('sk_')) {
throw new Error(INVALID_INSTANCE_KEYS_ERROR);
}
return activeInstanceConfig;
}

@@ -71,0 +76,0 @@

@@ -5,2 +5,3 @@ import { join } from 'node:path';

import { NULL_ROOT_ERROR } from '../utils/errors.js';
import { getClerkPackages } from '../utils/getClerkPackages.js';

@@ -28,2 +29,5 @@ import { getDependencies } from '../utils/getDependencies.js';

const cwd = await getMonorepoRoot();
if (!cwd) {
throw new Error(NULL_ROOT_ERROR);
}

@@ -30,0 +34,0 @@ /** @type {import('concurrently').ConcurrentlyCommandInput} */

@@ -6,2 +6,3 @@ import { readFile } from 'node:fs/promises';

import { NULL_ROOT_ERROR } from './errors.js';
import { getMonorepoRoot } from './getMonorepoRoot.js';

@@ -15,2 +16,5 @@

const monorepoRoot = await getMonorepoRoot();
if (!monorepoRoot) {
throw new Error(NULL_ROOT_ERROR);
}
/** @type {Record<string, string>} */

@@ -17,0 +21,0 @@ const packages = {};

@@ -10,13 +10,8 @@ import { join, resolve } from 'node:path';

/**
* Gets the `root` property of the clerk-dev configuration file, falling back to the folder containing the source
* for the running instance of clerk-dev.
* @returns {Promise<string>}
* Gets the `root` property of the clerk-dev configuration file.
* @returns {Promise<string | null>}
*/
export async function getMonorepoRoot() {
const config = await getConfiguration();
if (config.root) {
return config.root;
}
return getCLIRoot();
return config.root;
}