shadcn-svelte 0.3.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +24 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4745,8 +4745,15 @@ async function getPackageManager(targetDir) {
|
|
|
4745
4745
|
return "yarn";
|
|
4746
4746
|
if (packageManager === "pnpm@6")
|
|
4747
4747
|
return "pnpm";
|
|
4748
|
-
if (packageManager ===
|
|
4749
|
-
|
|
4748
|
+
if (packageManager === null) {
|
|
4749
|
+
const userAgent = process.env.npm_config_user_agent;
|
|
4750
|
+
if (userAgent === void 0)
|
|
4751
|
+
return "npm";
|
|
4752
|
+
if (userAgent.startsWith("yarn"))
|
|
4753
|
+
return "yarn";
|
|
4754
|
+
if (userAgent.startsWith("pnpm"))
|
|
4755
|
+
return "pnpm";
|
|
4756
|
+
}
|
|
4750
4757
|
return packageManager ?? "npm";
|
|
4751
4758
|
}
|
|
4752
4759
|
|
|
@@ -4847,6 +4854,12 @@ async function getRawConfig(cwd) {
|
|
|
4847
4854
|
}
|
|
4848
4855
|
}
|
|
4849
4856
|
|
|
4857
|
+
// src/utils/get-env-proxy.ts
|
|
4858
|
+
function getEnvProxy() {
|
|
4859
|
+
const { HTTP_PROXY, http_proxy } = process.env;
|
|
4860
|
+
return HTTP_PROXY || http_proxy;
|
|
4861
|
+
}
|
|
4862
|
+
|
|
4850
4863
|
// src/utils/logger.ts
|
|
4851
4864
|
import chalk from "chalk";
|
|
4852
4865
|
var logger = {
|
|
@@ -4883,6 +4896,7 @@ function handleError(error) {
|
|
|
4883
4896
|
|
|
4884
4897
|
// src/utils/registry/index.ts
|
|
4885
4898
|
import path3 from "path";
|
|
4899
|
+
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
4886
4900
|
import fetch from "node-fetch";
|
|
4887
4901
|
|
|
4888
4902
|
// src/utils/registry/schema.ts
|
|
@@ -4927,15 +4941,6 @@ var registryBaseColorSchema = z2.object({
|
|
|
4927
4941
|
cssVarsTemplate: z2.string()
|
|
4928
4942
|
});
|
|
4929
4943
|
|
|
4930
|
-
// src/utils/registry/index.ts
|
|
4931
|
-
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
4932
|
-
|
|
4933
|
-
// src/utils/get-env-proxy.ts
|
|
4934
|
-
function getEnvProxy() {
|
|
4935
|
-
const { HTTP_PROXY, http_proxy } = process.env;
|
|
4936
|
-
return HTTP_PROXY || http_proxy;
|
|
4937
|
-
}
|
|
4938
|
-
|
|
4939
4944
|
// src/utils/registry/index.ts
|
|
4940
4945
|
var baseUrl = process.env.COMPONENTS_REGISTRY_URL ?? "https://shadcn-svelte.com";
|
|
4941
4946
|
var proxyUrl = getEnvProxy();
|
|
@@ -6191,8 +6196,10 @@ var add = new Command().command("add").description("add components to your proje
|
|
|
6191
6196
|
process.exitCode = 0;
|
|
6192
6197
|
return;
|
|
6193
6198
|
}
|
|
6194
|
-
logger.info(
|
|
6195
|
-
|
|
6199
|
+
logger.info(
|
|
6200
|
+
`Selected components:
|
|
6201
|
+
${highlight(selectedComponents)}`
|
|
6202
|
+
);
|
|
6196
6203
|
if (!options.yes) {
|
|
6197
6204
|
const { proceed } = await prompts2({
|
|
6198
6205
|
type: "confirm",
|
|
@@ -6663,10 +6670,11 @@ import ora3 from "ora";
|
|
|
6663
6670
|
import prompts4 from "prompts";
|
|
6664
6671
|
import { z as z4 } from "zod";
|
|
6665
6672
|
var updateOptionsSchema = z4.object({
|
|
6673
|
+
all: z4.boolean(),
|
|
6666
6674
|
components: z4.array(z4.string()).optional(),
|
|
6667
6675
|
cwd: z4.string()
|
|
6668
6676
|
});
|
|
6669
|
-
var update = new Command3().command("update").description("update components in your project").argument("[components...]", "name of components").option(
|
|
6677
|
+
var update = new Command3().command("update").description("update components in your project").argument("[components...]", "name of components").option("-a, --all", "update all existing components.", false).option(
|
|
6670
6678
|
"-c, --cwd <cwd>",
|
|
6671
6679
|
"the working directory. defaults to the current directory.",
|
|
6672
6680
|
process.cwd()
|
|
@@ -6724,8 +6732,8 @@ var update = new Command3().command("update").description("update components in
|
|
|
6724
6732
|
component && existingComponents.push(component);
|
|
6725
6733
|
}
|
|
6726
6734
|
}
|
|
6727
|
-
let selectedComponents = [];
|
|
6728
|
-
if (components !== void 0) {
|
|
6735
|
+
let selectedComponents = options.all ? existingComponents : [];
|
|
6736
|
+
if (!selectedComponents.length && components !== void 0) {
|
|
6729
6737
|
selectedComponents = existingComponents.filter(
|
|
6730
6738
|
(component) => components.includes(component.name)
|
|
6731
6739
|
);
|