Skip to content

Commit

Permalink
fix: properly generates dist files, updates yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
aviemet committed Dec 6, 2024
1 parent 5f4253a commit a0b987e
Show file tree
Hide file tree
Showing 9 changed files with 5,389 additions and 5,812 deletions.
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.4.1.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.3.cjs

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
nodeLinker: node-modules
compressionLevel: mixed

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
enableGlobalCache: true

yarnPath: .yarn/releases/yarn-3.4.1.cjs
nodeLinker: node-modules

enableGlobalCache: true
yarnPath: .yarn/releases/yarn-4.5.3.cjs
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "dist/useInertiaForm.js",
"cjs": "dist/useInertiaForm.cjs",
"unpkg": "dist/useInertiaForm.umd.min.js",
"types": "dist/index.d.ts",
"homepage": "https://github.com/aviemet/useInertiaForm#readme",
"sideEffects": false,
"files": [
Expand All @@ -24,12 +25,13 @@
},
"author": "Avram Walden <[email protected]>",
"license": "MIT",
"packageManager": "[email protected]",
"bugs": {
"url": "https://github.com/aviemet/useInertiaForm/issues"
},
"scripts": {
"build": "yarn clean && rollup -c --bundleConfigAsCjs",
"watch": "rollup --watch -c --bundleConfigAsCjs",
"build:watch": "yarn clean && rollup --watch -c --bundleConfigAsCjs",
"clean": "rimraf dist",
"lint": "eslint '**/*.{js,ts}'",
"lint:fix": "npm run lint -- --fix",
Expand Down Expand Up @@ -100,6 +102,7 @@
"react-test-renderer": "^18.3.1",
"rimraf": "^6.0.1",
"rollup": "^4.27.4",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-sourcemaps": "^0.6.3",
Expand Down
19 changes: 19 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps'
import terser from '@rollup/plugin-terser'
import filesize from 'rollup-plugin-filesize'
import { dts } from 'rollup-plugin-dts'
import pkg from './package.json'

const externalDeps = [
Expand All @@ -24,6 +25,7 @@ const basePlugins = [
commonjs(),
typescript({
tsconfig: './tsconfig.build.json',
declarationDir: './dist',
}),
sourcemaps(),
filesize({
Expand Down Expand Up @@ -78,4 +80,21 @@ export default [
plugins: basePlugins,
external: externalDeps,
},
{
input: 'src/index.ts',
output: [
{
file: pkg.types,
format: 'es',
},
],
plugins: [
dts({
compilerOptions: {
baseUrl: './dist',
},
}),
],
external: [...externalDeps],
},
]
18 changes: 14 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
export { default as useInertiaForm, type UseInertiaFormProps, type NestedObject } from './useInertiaForm'
export { default as useInertiaInput, type UseInertiaInputProps } from './useInertiaInput'
export {
default as useInertiaForm,
type UseInertiaFormProps,
type NestedObject,
} from './useInertiaForm'

export {
default as useInertiaInput,
type UseInertiaInputProps,
} from './useInertiaInput'

export {
Form,
useForm,
type HTTPVerb,
type UseFormProps,
type FormProps,
} from './Form'

export {
Input,
Submit,
DynamicInputs,
NestedFields,
Submit,
useDynamicInputs,
type NestedFieldsProps,
DynamicInputs,
type DynamicInputsProps,
} from './Inputs'
8 changes: 2 additions & 6 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declarationMap": true,
"rootDir": "./src",
"typeRoots": [
"./node_modules/@types"
],
"removeComments": true,
},
"include": ["src"],
"exclude": ["node_modules", "dist", "**/__tests__/**"]
"exclude": ["node_modules", "dist", "tests", "**/__tests__/**"]
}
Loading

0 comments on commit a0b987e

Please sign in to comment.