@gilav21/shadcn-angular 0.0.18 → 0.0.20

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.
@@ -4,6 +4,7 @@ interface AddOptions {
4
4
  all?: boolean;
5
5
  path?: string;
6
6
  remote?: boolean;
7
+ branch: string;
7
8
  }
8
9
  export declare function add(components: string[], options: AddOptions): Promise<void>;
9
10
  export {};
@@ -10,9 +10,12 @@ import { installPackages } from '../utils/package-manager.js';
10
10
  import { writeShortcutRegistryIndex } from '../utils/shortcut-registry.js';
11
11
  const __filename = fileURLToPath(import.meta.url);
12
12
  const __dirname = path.dirname(__filename);
13
- // Base URL for the component registry (GitHub raw content)
14
- const REGISTRY_BASE_URL = 'https://raw.githubusercontent.com/gilav21/shadcn-angular/master/packages/components/ui';
15
- const LIB_REGISTRY_BASE_URL = 'https://raw.githubusercontent.com/gilav21/shadcn-angular/master/packages/components/lib';
13
+ function getRegistryBaseUrl(branch) {
14
+ return `https://raw.githubusercontent.com/gilav21/shadcn-angular/${branch}/packages/components/ui`;
15
+ }
16
+ function getLibRegistryBaseUrl(branch) {
17
+ return `https://raw.githubusercontent.com/gilav21/shadcn-angular/${branch}/packages/components/lib`;
18
+ }
16
19
  // Components source directory (relative to CLI dist folder) for local dev
17
20
  function getLocalComponentsDir() {
18
21
  // From dist/commands/add.js -> packages/components/ui
@@ -57,7 +60,7 @@ async function fetchComponentContent(file, options) {
57
60
  }
58
61
  }
59
62
  // 2. Fetch from remote registry
60
- const url = `${REGISTRY_BASE_URL}/${file}`;
63
+ const url = `${getRegistryBaseUrl(options.branch)}/${file}`;
61
64
  try {
62
65
  const response = await fetch(url);
63
66
  if (!response.ok) {
@@ -80,7 +83,7 @@ async function fetchLibContent(file, options) {
80
83
  return fs.readFile(localPath, 'utf-8');
81
84
  }
82
85
  }
83
- const url = `${LIB_REGISTRY_BASE_URL}/${file}`;
86
+ const url = `${getLibRegistryBaseUrl(options.branch)}/${file}`;
84
87
  const response = await fetch(url);
85
88
  if (!response.ok) {
86
89
  throw new Error(`Failed to fetch library file from ${url}: ${response.statusText}`);
@@ -1,6 +1,7 @@
1
1
  interface InitOptions {
2
2
  yes?: boolean;
3
3
  defaults?: boolean;
4
+ branch: string;
4
5
  }
5
6
  export declare function init(options: InitOptions): Promise<void>;
6
7
  export {};
@@ -9,7 +9,9 @@ import { getStylesTemplate } from '../templates/styles.js';
9
9
  import { getUtilsTemplate } from '../templates/utils.js';
10
10
  import { installPackages } from '../utils/package-manager.js';
11
11
  import { writeShortcutRegistryIndex } from '../utils/shortcut-registry.js';
12
- const LIB_REGISTRY_BASE_URL = 'https://raw.githubusercontent.com/gilav21/shadcn-angular/master/packages/components/lib';
12
+ function getLibRegistryBaseUrl(branch) {
13
+ return `https://raw.githubusercontent.com/gilav21/shadcn-angular/${branch}/packages/components/lib`;
14
+ }
13
15
  const __filename = fileURLToPath(import.meta.url);
14
16
  const __dirname = path.dirname(__filename);
15
17
  function getLocalLibDir() {
@@ -19,7 +21,7 @@ function getLocalLibDir() {
19
21
  }
20
22
  return null;
21
23
  }
22
- async function fetchLibFileContent(file) {
24
+ async function fetchLibFileContent(file, branch) {
23
25
  const localLibDir = getLocalLibDir();
24
26
  if (localLibDir) {
25
27
  const localPath = path.join(localLibDir, file);
@@ -27,7 +29,7 @@ async function fetchLibFileContent(file) {
27
29
  return fs.readFile(localPath, 'utf-8');
28
30
  }
29
31
  }
30
- const url = `${LIB_REGISTRY_BASE_URL}/${file}`;
32
+ const url = `${getLibRegistryBaseUrl(branch)}/${file}`;
31
33
  const response = await fetch(url);
32
34
  if (!response.ok) {
33
35
  throw new Error(`Failed to fetch library file from ${url}: ${response.statusText}`);
@@ -200,7 +202,7 @@ export async function init(options) {
200
202
  await fs.writeFile(path.join(libDir, 'utils.ts'), getUtilsTemplate());
201
203
  spinner.text = 'Created utils.ts';
202
204
  const shortcutServicePath = path.join(libDir, 'shortcut-binding.service.ts');
203
- const shortcutServiceContent = await fetchLibFileContent('shortcut-binding.service.ts');
205
+ const shortcutServiceContent = await fetchLibFileContent('shortcut-binding.service.ts', options.branch);
204
206
  await fs.writeFile(shortcutServicePath, shortcutServiceContent);
205
207
  spinner.text = 'Created shortcut-binding.service.ts';
206
208
  if (createShortcutRegistry) {
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ program
12
12
  .description('Initialize shadcn-angular in your project')
13
13
  .option('-y, --yes', 'Skip confirmation prompt')
14
14
  .option('-d, --defaults', 'Use default configuration')
15
+ .option('-b, --branch <branch>', 'GitHub branch to fetch components from', 'master')
15
16
  .action(init);
16
17
  program
17
18
  .command('add')
@@ -22,5 +23,6 @@ program
22
23
  .option('-a, --all', 'Add all available components')
23
24
  .option('-p, --path <path>', 'The path to add the component to')
24
25
  .option('--remote', 'Force remote fetch from GitHub registry')
26
+ .option('-b, --branch <branch>', 'GitHub branch to fetch components from', 'master')
25
27
  .action(add);
26
28
  program.parse();
@@ -201,7 +201,7 @@ export const registry = {
201
201
  },
202
202
  input: {
203
203
  name: 'input',
204
- files: ['input.component.ts'],
204
+ files: ['input.component.ts', 'input-group.token.ts'],
205
205
  },
206
206
  'input-group': {
207
207
  name: 'input-group',
@@ -311,7 +311,7 @@ export const registry = {
311
311
  },
312
312
  textarea: {
313
313
  name: 'textarea',
314
- files: ['textarea.component.ts'],
314
+ files: ['textarea.component.ts', 'input-group.token.ts'],
315
315
  },
316
316
  timeline: {
317
317
  name: 'timeline',
@@ -554,7 +554,12 @@ export const registry = {
554
554
  // Kanban
555
555
  kanban: {
556
556
  name: 'kanban',
557
- files: ['kanban.component.ts'],
558
- dependencies: ['badge', 'avatar', 'scroll-area', 'separator'],
557
+ files: ['kanban.component.ts', 'kanban-locales.ts'],
558
+ dependencies: [
559
+ 'badge', 'avatar', 'scroll-area', 'separator',
560
+ 'button', 'input', 'textarea', 'label',
561
+ 'chip-list', 'autocomplete',
562
+ 'dialog', 'alert-dialog', 'context-menu',
563
+ ],
559
564
  },
560
565
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gilav21/shadcn-angular",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "CLI for adding shadcn-angular components to your project",
5
5
  "bin": {
6
6
  "shadcn-angular": "./dist/index.js"
@@ -12,9 +12,13 @@ import { writeShortcutRegistryIndex, type ShortcutRegistryEntry } from '../utils
12
12
  const __filename = fileURLToPath(import.meta.url);
13
13
  const __dirname = path.dirname(__filename);
14
14
 
15
- // Base URL for the component registry (GitHub raw content)
16
- const REGISTRY_BASE_URL = 'https://raw.githubusercontent.com/gilav21/shadcn-angular/master/packages/components/ui';
17
- const LIB_REGISTRY_BASE_URL = 'https://raw.githubusercontent.com/gilav21/shadcn-angular/master/packages/components/lib';
15
+ function getRegistryBaseUrl(branch: string) {
16
+ return `https://raw.githubusercontent.com/gilav21/shadcn-angular/${branch}/packages/components/ui`;
17
+ }
18
+
19
+ function getLibRegistryBaseUrl(branch: string) {
20
+ return `https://raw.githubusercontent.com/gilav21/shadcn-angular/${branch}/packages/components/lib`;
21
+ }
18
22
 
19
23
  // Components source directory (relative to CLI dist folder) for local dev
20
24
  function getLocalComponentsDir(): string | null {
@@ -36,7 +40,8 @@ interface AddOptions {
36
40
  overwrite?: boolean;
37
41
  all?: boolean;
38
42
  path?: string;
39
- remote?: boolean; // Force remote fetch
43
+ remote?: boolean;
44
+ branch: string;
40
45
  }
41
46
 
42
47
  function getLocalLibDir(): string | null {
@@ -74,7 +79,7 @@ async function fetchComponentContent(file: string, options: AddOptions): Promise
74
79
  }
75
80
 
76
81
  // 2. Fetch from remote registry
77
- const url = `${REGISTRY_BASE_URL}/${file}`;
82
+ const url = `${getRegistryBaseUrl(options.branch)}/${file}`;
78
83
  try {
79
84
  const response = await fetch(url);
80
85
  if (!response.ok) {
@@ -99,7 +104,7 @@ async function fetchLibContent(file: string, options: AddOptions): Promise<strin
99
104
  }
100
105
  }
101
106
 
102
- const url = `${LIB_REGISTRY_BASE_URL}/${file}`;
107
+ const url = `${getLibRegistryBaseUrl(options.branch)}/${file}`;
103
108
  const response = await fetch(url);
104
109
  if (!response.ok) {
105
110
  throw new Error(`Failed to fetch library file from ${url}: ${response.statusText}`);
@@ -10,7 +10,9 @@ import { getUtilsTemplate } from '../templates/utils.js';
10
10
  import { installPackages } from '../utils/package-manager.js';
11
11
  import { writeShortcutRegistryIndex } from '../utils/shortcut-registry.js';
12
12
 
13
- const LIB_REGISTRY_BASE_URL = 'https://raw.githubusercontent.com/gilav21/shadcn-angular/master/packages/components/lib';
13
+ function getLibRegistryBaseUrl(branch: string) {
14
+ return `https://raw.githubusercontent.com/gilav21/shadcn-angular/${branch}/packages/components/lib`;
15
+ }
14
16
  const __filename = fileURLToPath(import.meta.url);
15
17
  const __dirname = path.dirname(__filename);
16
18
 
@@ -22,7 +24,7 @@ function getLocalLibDir(): string | null {
22
24
  return null;
23
25
  }
24
26
 
25
- async function fetchLibFileContent(file: string): Promise<string> {
27
+ async function fetchLibFileContent(file: string, branch: string): Promise<string> {
26
28
  const localLibDir = getLocalLibDir();
27
29
  if (localLibDir) {
28
30
  const localPath = path.join(localLibDir, file);
@@ -31,7 +33,7 @@ async function fetchLibFileContent(file: string): Promise<string> {
31
33
  }
32
34
  }
33
35
 
34
- const url = `${LIB_REGISTRY_BASE_URL}/${file}`;
36
+ const url = `${getLibRegistryBaseUrl(branch)}/${file}`;
35
37
  const response = await fetch(url);
36
38
  if (!response.ok) {
37
39
  throw new Error(`Failed to fetch library file from ${url}: ${response.statusText}`);
@@ -42,6 +44,7 @@ async function fetchLibFileContent(file: string): Promise<string> {
42
44
  interface InitOptions {
43
45
  yes?: boolean;
44
46
  defaults?: boolean;
47
+ branch: string;
45
48
  }
46
49
 
47
50
  function resolveProjectPath(cwd: string, inputPath: string): string {
@@ -227,7 +230,7 @@ export async function init(options: InitOptions) {
227
230
  spinner.text = 'Created utils.ts';
228
231
 
229
232
  const shortcutServicePath = path.join(libDir, 'shortcut-binding.service.ts');
230
- const shortcutServiceContent = await fetchLibFileContent('shortcut-binding.service.ts');
233
+ const shortcutServiceContent = await fetchLibFileContent('shortcut-binding.service.ts', options.branch);
231
234
  await fs.writeFile(shortcutServicePath, shortcutServiceContent);
232
235
  spinner.text = 'Created shortcut-binding.service.ts';
233
236
 
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ program
15
15
  .description('Initialize shadcn-angular in your project')
16
16
  .option('-y, --yes', 'Skip confirmation prompt')
17
17
  .option('-d, --defaults', 'Use default configuration')
18
+ .option('-b, --branch <branch>', 'GitHub branch to fetch components from', 'master')
18
19
  .action(init);
19
20
 
20
21
  program
@@ -26,6 +27,7 @@ program
26
27
  .option('-a, --all', 'Add all available components')
27
28
  .option('-p, --path <path>', 'The path to add the component to')
28
29
  .option('--remote', 'Force remote fetch from GitHub registry')
30
+ .option('-b, --branch <branch>', 'GitHub branch to fetch components from', 'master')
29
31
  .action(add);
30
32
 
31
33
  program.parse();
@@ -218,7 +218,7 @@ export const registry: Record<string, ComponentDefinition> = {
218
218
  },
219
219
  input: {
220
220
  name: 'input',
221
- files: ['input.component.ts'],
221
+ files: ['input.component.ts', 'input-group.token.ts'],
222
222
  },
223
223
  'input-group': {
224
224
  name: 'input-group',
@@ -328,7 +328,7 @@ export const registry: Record<string, ComponentDefinition> = {
328
328
  },
329
329
  textarea: {
330
330
  name: 'textarea',
331
- files: ['textarea.component.ts'],
331
+ files: ['textarea.component.ts', 'input-group.token.ts'],
332
332
  },
333
333
  timeline: {
334
334
  name: 'timeline',
@@ -571,7 +571,12 @@ export const registry: Record<string, ComponentDefinition> = {
571
571
  // Kanban
572
572
  kanban: {
573
573
  name: 'kanban',
574
- files: ['kanban.component.ts'],
575
- dependencies: ['badge', 'avatar', 'scroll-area', 'separator'],
574
+ files: ['kanban.component.ts', 'kanban-locales.ts'],
575
+ dependencies: [
576
+ 'badge', 'avatar', 'scroll-area', 'separator',
577
+ 'button', 'input', 'textarea', 'label',
578
+ 'chip-list', 'autocomplete',
579
+ 'dialog', 'alert-dialog', 'context-menu',
580
+ ],
576
581
  },
577
582
  };