Skip to content

Commit

Permalink
Merge branch 'master' into Remove-default-props
Browse files Browse the repository at this point in the history
  • Loading branch information
ghsteff committed May 8, 2024
2 parents a388357 + 57e8aae commit 4ed6692
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 7.5.2 - 5/8/24
- [chore] add storybook stories to dist
- [chore] migrate @reaviz/ctrl-keys to ctrl-keys 1.0.2

# 7.5.1 - 5/1/24
- [fix] onBlur call for Input component #164

Expand Down
67 changes: 58 additions & 9 deletions package-lock.json

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

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "reablocks",
"version": "7.5.1",
"version": "7.5.2",
"description": "Component library for React",
"scripts": {
"build": "npm run build:js && npm run build:styles",
"build": "npm run build:js && npm run build:styles && npm run rewrite",
"build-storybook": "storybook build",
"build:js": "vite build --mode library",
"build:styles": "tailwindcss -i ./src/index.css -o ./dist/index.css",
"rewrite": "node scripts/rewrite.cjs",
"lint": "eslint --ext js,ts,tsx",
"lint:fix": "eslint --ext js,ts,tsx --fix src",
"lint:prettier": "prettier --loglevel warn --write 'src/**/*.{ts,tsx,js,jsx}'",
Expand Down Expand Up @@ -55,7 +56,7 @@
"homepage": "https://github.com/reaviz/reablocks#readme",
"dependencies": {
"@marko19907/string-to-color": "^1.0.0",
"@reaviz/ctrl-keys": "^1.0.0",
"ctrl-keys": "^1.0.2",
"@reaviz/react-use-fuzzy": "^1.0.3",
"body-scroll-lock-upgrade": "^1.1.0",
"chroma-js": "^2.4.2",
Expand Down Expand Up @@ -108,6 +109,7 @@
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-storybook": "^0.8.0",
"fast-glob": "^3.3.2",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"lint-staged": "^15.2.2",
Expand All @@ -122,10 +124,12 @@
"tailwindcss": "^3.4.1",
"tw-colors": "^3.3.1",
"typescript": "^4.9.5",
"typescript-rewrite-paths": "^1.3.1",
"vite": "^5.2.2",
"vite-plugin-checker": "^0.6.4",
"vite-plugin-css-injected-by-js": "^3.5.0",
"vite-plugin-dts": "^3.7.3",
"vite-plugin-static-copy": "^1.0.4",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.4.0"
Expand Down
20 changes: 20 additions & 0 deletions scripts/rewrite.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const fs = require('fs');
const fg = require('fast-glob');
const { rewritePaths } = require('typescript-rewrite-paths');

const files = fg.sync('dist/stories/*.tsx');

files.forEach((file) => {
const code = fs.readFileSync(file, { encoding: 'utf-8' });

const output = rewritePaths(code, path => {
if (path.startsWith('./') || path.startsWith('../')) {
console.info(`Replacing ${path} with reablocks`);
return 'reablocks';
}

return path;
});

fs.writeFileSync(file, output);
});
9 changes: 9 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { resolve } from 'path';
import external from 'rollup-plugin-peer-deps-external';
import dts from 'vite-plugin-dts';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
import { viteStaticCopy } from 'vite-plugin-static-copy';

export default defineConfig(({ mode }) =>
mode === 'library'
Expand All @@ -24,6 +25,14 @@ export default defineConfig(({ mode }) =>
}),
checker({
typescript: true
}),
viteStaticCopy({
targets: [
{
src: 'src/**/*.story.tsx',
dest: 'stories/'
}
]
})
],
test: {
Expand Down

0 comments on commit 4ed6692

Please sign in to comment.