Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
balanza committed Jun 18, 2024
1 parent c2bbc32 commit a61d663
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion assets/js/lib/test-utils/ui/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react';

// eslint-disable-next-line import/no-dynamic-require
const pkg = require(`${process.cwd()}/package.json`);

// Application global css
const css = require('fs').readFileSync(
`${__dirname}/../../../../../priv/static/assets/app.css`,
`${process.cwd()}/${pkg.variables.css}`,
'utf8'
);

Expand Down
9 changes: 6 additions & 3 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,19 @@
"overrides": {
"@testing-library/dom": "^9.0.1"
},
"variables": {
"css": "../priv/static/assets/app.css"
},
"scripts": {
"tailwind:build": "tailwindcss --postcss --minify --input=css/app.css --output=../priv/static/assets/app.css",
"tailwind:build": "tailwindcss --postcss --minify --input=css/app.css --output=$npm_package_variables_css",
"build": "node build.js",
"deploy": "tailwindcss --postcss --minify --input=css/app.css --output=../priv/static/assets/app.css && node build.js",
"deploy": "tailwind:build && npm run build",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"lint": "eslint . --ext js,jsx",
"format:check": "prettier -c .",
"format": "prettier --write .",
"pretest": "ls ../priv/static/assets/app.css || npm run tailwind:build",
"pretest": "ls $npm_package_variables_css || npm run tailwind:build",
"test": "jest",
"chromatic": "npx chromatic --exit-zero-on-changes"
}
Expand Down

0 comments on commit a61d663

Please sign in to comment.