Skip to content

Commit 743f58d

Browse files
committed
fix(#228): remove no longer needed platforms in components.json for cli
1 parent bcf88df commit 743f58d

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

packages/cli/src/commands/add.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,7 @@ export const add = new Command()
105105
for (const comp of componentsToWrite) {
106106
spinner.text = `Installing ${comp.name}...`;
107107

108-
if (Array.isArray(comp.paths)) {
109-
await writeFiles(comp, comp.paths, config, spinner, options.overwrite);
110-
} else {
111-
await writeFiles(
112-
comp,
113-
comp.paths[config.platforms === 'universal' ? 'universal' : 'native-only'],
114-
config,
115-
spinner,
116-
options.overwrite
117-
);
118-
}
108+
await writeFiles(comp, comp.paths, config, spinner, options.overwrite);
119109

120110
npmPackages.push(...comp.npmPackages);
121111
}
@@ -257,15 +247,6 @@ async function promptForConfig(cwd: string) {
257247
const highlight = (text: string) => chalk.cyan(text);
258248

259249
const options = await prompts([
260-
{
261-
type: 'select',
262-
name: 'platforms',
263-
message: `Which ${highlight('platforms')} do you support?`,
264-
choices: [
265-
{ title: 'Universal (Web, iOS, and Android)', value: 'universal' },
266-
{ title: 'Native Only (iOS and Android)', value: 'native-only' },
267-
],
268-
},
269250
{
270251
type: 'text',
271252
name: 'components',
@@ -281,7 +262,6 @@ async function promptForConfig(cwd: string) {
281262
]);
282263

283264
const config = rawConfigSchema.parse({
284-
platforms: options.platforms,
285265
aliases: {
286266
lib: options.lib,
287267
components: options.components,

packages/cli/src/utils/get-config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { cosmiconfig } from 'cosmiconfig';
33
import { loadConfig } from 'tsconfig-paths';
44
import { z } from 'zod';
55

6-
export const DEFAULT_PLATFORMS = 'universal';
76
export const DEFAULT_COMPONENTS = '~/components';
87
export const DEFAULT_LIB = '~/lib';
98

@@ -13,7 +12,6 @@ const explorer = cosmiconfig('components', {
1312

1413
export const rawConfigSchema = z
1514
.object({
16-
platforms: z.string().optional(),
1715
aliases: z.object({
1816
components: z.string(),
1917
lib: z.string(),
@@ -24,7 +22,6 @@ export const rawConfigSchema = z
2422
export type RawConfig = z.infer<typeof rawConfigSchema>;
2523

2624
export const configSchema = rawConfigSchema.extend({
27-
platforms: z.string().optional(),
2825
resolvedPaths: z.object({
2926
lib: z.string(),
3027
components: z.string(),

0 commit comments

Comments
 (0)