Skip to content

Commit

Permalink
refactor: use files field instead of .npmignore
Browse files Browse the repository at this point in the history
Renamed `lib/` to `src/`. Amended `tsconfig`, `.gitignore`, `post-merge`. Deleted `.npmignore`
  • Loading branch information
theisel committed Sep 8, 2022
1 parent 1e2005a commit 7ba0e57
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"

pnpm install
pnpm --filter astro-portabletext compile
4 changes: 1 addition & 3 deletions component/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
lib/*.js
lib/*.d.ts
!lib/astro.d.ts
lib/
6 changes: 0 additions & 6 deletions component/.npmignore

This file was deleted.

4 changes: 4 additions & 0 deletions component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
]
}
},
"files": [
"components",
"lib"
],
"scripts": {
"build:fixture": "astro --root test/components/fixture/ build --silent",
"check": "astro check --root components",
Expand Down
4 changes: 2 additions & 2 deletions component/lib/astro.d.ts → component/src/astro.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare module "*.astro" {
type Props = any;
const component: (props: Props) => any;
const Component: (props: Props) => any;

export default component;
export default Component;
export type { Props };
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion component/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"outDir": "lib",
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"declaration": true,
Expand All @@ -9,5 +10,5 @@
"strict": true,
"forceConsistentCasingInFileNames": true
},
"include": ["lib"]
"include": ["src"]
}

0 comments on commit 7ba0e57

Please sign in to comment.