Skip to content

Commit

Permalink
fix: reapply the existing component on index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
irsyadadl committed Feb 10, 2025
1 parent 8350366 commit 7312d0f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
16 changes: 2 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
"bin": {
"justd": "dist/index.js"
},
"files": [
"dist",
"src/resources",
"LICENSE",
"README.md",
"package.json"
],
"files": ["dist", "src/resources", "LICENSE", "README.md", "package.json"],
"repository": {
"type": "git",
"url": "git+https://github.com/justdlabs/cli.git"
Expand All @@ -32,13 +26,7 @@
"release": "export GITHUB_TOKEN=$(cat .github_token) && release-it",
"typecheck": "tsc --noEmit"
},
"keywords": [
"cli",
"justd cli",
"Justd",
"design-system",
"justd"
],
"keywords": ["cli", "justd cli", "Justd", "design-system", "justd"],
"author": "Irsyad A. Panjaitan",
"license": "MIT",
"devDependencies": {
Expand Down
6 changes: 2 additions & 4 deletions src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function updateIndexFile(
* Sort the existing exports and add the primitive export at the beginning.
* This ensures that the primitive export is always included first in the index file.
*/
existingExports = [primitiveExport, ...existingExports.sort()]
existingExports = [primitiveExport, ...[...new Set(existingExports)].sort()]

fs.writeFileSync(indexPath, `${existingExports.join("\n")}\n`, { flag: "w" })

Expand Down Expand Up @@ -292,9 +292,7 @@ export async function add(options: {
})
}

if (!overwrite) {
await updateIndexFile(config, componentName)
}
await updateIndexFile(config, componentName)
} catch (error) {
console.error(warningText(`Error processing '${componentName}'.`))
}
Expand Down
8 changes: 7 additions & 1 deletion src/resources/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ const components: any[] = [
},
{
name: "select",
children: [{ name: "field" }, { name: "list-box" }, { name: "popover" }],
children: [
{ name: "field" },
{ name: "list-box" },
{ name: "popover" },
{ name: "dialog" },
{ name: "keyboard" },
],
},
{
name: "multiple-select",
Expand Down

0 comments on commit 7312d0f

Please sign in to comment.