Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Jun 6, 2024
1 parent efeeaf8 commit 363788a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 72 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"dedent": "^1.2.0",
"estree-util-to-js": "^2.0.0",
"magic-string": "^0.30.1",
"prettier": "^3.3.1",
"prettier-plugin-svelte": "^3.2.4",
"zimmerframe": "^1.1.2"
},
Expand Down Expand Up @@ -83,7 +84,6 @@
"eslint": "^7.17.0",
"eslint-plugin-storybook": "^0.6.12",
"jsdom": "^24.1.0",
"prettier": "^3.3.1",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"storybook": "^8.1.6",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions src/utils/get-component-name.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// FIXME: Unused module. Verify if it can be freely removed

// Copied from https://github.com/sveltejs/svelte/blob/14ddb87c311ff3280dde0ae44b0a0d864ec26353/packages/svelte/src/compiler/phases/2-analyze/index.js#L57-L69
export function getComponentName(filename: string) {
const parts = filename.split(/[/\\]/);
const basename = parts.pop() as string;
const last_dir = parts.at(-1);
let name = basename.replace('.svelte', '');
if (name === 'index' && last_dir && last_dir !== 'src') {
name = last_dir;
}
return name[0].toUpperCase() + name.slice(1);
const parts = filename.split(/[/\\]/);
const basename = parts.pop() as string;
const last_dir = parts.at(-1);
let name = basename.replace(".svelte", "");
if (name === "index" && last_dir && last_dir !== "src") {
name = last_dir;
}
return name[0].toUpperCase() + name.slice(1);
}
12 changes: 0 additions & 12 deletions test/Test.stories.svelte

This file was deleted.

1 change: 0 additions & 1 deletion test/compile.d.ts

This file was deleted.

47 changes: 0 additions & 47 deletions test/compile.ts

This file was deleted.

0 comments on commit 363788a

Please sign in to comment.