@react-native-reusables/cli 0.6.2 → 0.6.3
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/bin.cjs +19 -11
- package/package.json +1 -1
package/bin.cjs
CHANGED
|
@@ -55896,13 +55896,16 @@ var ProjectConfig = class extends Effect_exports.Service()("ProjectConfig", {
|
|
|
55896
55896
|
if (metroContent?.includes("withUniwindConfig")) {
|
|
55897
55897
|
return "uniwind";
|
|
55898
55898
|
}
|
|
55899
|
-
|
|
55899
|
+
if (metroContent?.toLowerCase().includes("withnativewind")) {
|
|
55900
|
+
return "nativewind";
|
|
55901
|
+
}
|
|
55902
|
+
return "unknown";
|
|
55900
55903
|
});
|
|
55901
55904
|
const handleInvalidComponentJson = (exists4) => Effect_exports.gen(function* () {
|
|
55902
55905
|
yield* Effect_exports.logWarning(
|
|
55903
55906
|
`${exists4 ? "Invalid components.json" : "Missing components.json"}${" (required to continue)"}`
|
|
55904
55907
|
);
|
|
55905
|
-
const agreeToWrite =
|
|
55908
|
+
const agreeToWrite = yield* Prompt_exports.confirm({
|
|
55906
55909
|
message: `Would you like to ${exists4 ? "update the" : "write a"} components.json file?`,
|
|
55907
55910
|
label: { confirm: "y", deny: "n" },
|
|
55908
55911
|
initial: true,
|
|
@@ -55928,8 +55931,9 @@ var ProjectConfig = class extends Effect_exports.Service()("ProjectConfig", {
|
|
|
55928
55931
|
message: "What is the name of the CSS file and path to it? (e.g. global.css or src/global.css)",
|
|
55929
55932
|
default: detectedCss
|
|
55930
55933
|
});
|
|
55934
|
+
const stylingLibrary = yield* getStylingLibrary();
|
|
55931
55935
|
const hasTailwindConfig = yield* fs2.exists(path8.join(options3.cwd, "tailwind.config.js"));
|
|
55932
|
-
const tailwindConfig = options3.yes && hasTailwindConfig ? "tailwind.config.js" : yield* Prompt_exports.text({
|
|
55936
|
+
const tailwindConfig = stylingLibrary === "uniwind" ? "" : options3.yes && hasTailwindConfig ? "tailwind.config.js" : yield* Prompt_exports.text({
|
|
55933
55937
|
message: "What is the name of the Tailwind config file and path to it? (e.g. tailwind.config.js or src/tailwind.config.js)",
|
|
55934
55938
|
default: "tailwind.config.js"
|
|
55935
55939
|
});
|
|
@@ -58274,9 +58278,11 @@ var Doctor = class extends Effect_exports.Service()("Doctor", {
|
|
|
58274
58278
|
const spinner = yield* Spinner;
|
|
58275
58279
|
const projectConfig = yield* ProjectConfig;
|
|
58276
58280
|
const stylingLibrary = yield* projectConfig.getStylingLibrary();
|
|
58277
|
-
|
|
58278
|
-
|
|
58279
|
-
|
|
58281
|
+
if (stylingLibrary !== "unknown") {
|
|
58282
|
+
console.log(
|
|
58283
|
+
`\x1B[2m${symbols_exports.info} Styling Library: ${stylingLibrary === "uniwind" ? "Uniwind" : "Nativewind"}\x1B[0m`
|
|
58284
|
+
);
|
|
58285
|
+
}
|
|
58280
58286
|
const checkRequiredDependencies = ({
|
|
58281
58287
|
dependencies,
|
|
58282
58288
|
devDependencies
|
|
@@ -58314,11 +58320,12 @@ var Doctor = class extends Effect_exports.Service()("Doctor", {
|
|
|
58314
58320
|
}
|
|
58315
58321
|
return { uninstalledDependencies, uninstalledDevDependencies };
|
|
58316
58322
|
});
|
|
58323
|
+
const registry = stylingLibrary === "uniwind" ? "uniwind" : "nativewind";
|
|
58317
58324
|
return {
|
|
58318
58325
|
run: (options4) => Effect_exports.gen(function* () {
|
|
58319
58326
|
yield* Effect_exports.logDebug(`Doctor options: ${JSON.stringify(options4, null, 2)}`);
|
|
58320
58327
|
const { uninstalledDependencies, uninstalledDevDependencies } = yield* checkRequiredDependencies({
|
|
58321
|
-
dependencies: PROJECT_MANIFEST.dependencies[
|
|
58328
|
+
dependencies: PROJECT_MANIFEST.dependencies[registry],
|
|
58322
58329
|
devDependencies: PROJECT_MANIFEST.devDependencies
|
|
58323
58330
|
});
|
|
58324
58331
|
const { customFileResults, deprecatedFileResults, fileResults } = yield* requiredFileChecker.run({
|
|
@@ -58326,7 +58333,7 @@ var Doctor = class extends Effect_exports.Service()("Doctor", {
|
|
|
58326
58333
|
deprecatedFromLib: PROJECT_MANIFEST.deprecatedFromLib,
|
|
58327
58334
|
deprecatedFromUi: PROJECT_MANIFEST.deprecatedFromUi,
|
|
58328
58335
|
fileChecks: PROJECT_MANIFEST.fileChecks,
|
|
58329
|
-
stylingLibrary
|
|
58336
|
+
stylingLibrary: registry
|
|
58330
58337
|
});
|
|
58331
58338
|
const result = {
|
|
58332
58339
|
missingFiles: [...fileResults.missingFiles, ...customFileResults.missingFiles],
|
|
@@ -58633,8 +58640,8 @@ var BINARY_RUNNERS = {
|
|
|
58633
58640
|
npm: ["npx"],
|
|
58634
58641
|
bun: ["bunx", "--bun"],
|
|
58635
58642
|
pnpm: ["pnpm", "dlx"],
|
|
58636
|
-
yarn: ["
|
|
58637
|
-
"yarn@berry": ["
|
|
58643
|
+
yarn: ["npx"],
|
|
58644
|
+
"yarn@berry": ["npx"]
|
|
58638
58645
|
};
|
|
58639
58646
|
var detectPackageManager = (cwd2) => Effect_exports.tryPromise({
|
|
58640
58647
|
try: () => {
|
|
@@ -58695,7 +58702,8 @@ var Add = class extends Effect_exports.Service()("Add", {
|
|
|
58695
58702
|
}
|
|
58696
58703
|
yield* Effect_exports.logDebug(`Selected components: ${components.join(", ")}`);
|
|
58697
58704
|
const stylingLibrary = yield* projectConfig.getStylingLibrary();
|
|
58698
|
-
const
|
|
58705
|
+
const registry = stylingLibrary === "uniwind" ? "uniwind" : "nativewind";
|
|
58706
|
+
const baseUrl = process.env.INTERNAL_ENV === "development" ? `http://localhost:3000/local/r/${registry}` : `https://reactnativereusables.com/r/${registry}`;
|
|
58699
58707
|
const componentUrls = components.map((component) => {
|
|
58700
58708
|
const lowerCaseComponent = component.toLocaleLowerCase();
|
|
58701
58709
|
return lowerCaseComponent.startsWith("http") ? lowerCaseComponent : `${baseUrl}/${lowerCaseComponent}.json`;
|