Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Add better exports first pass (still busted)

Fix package lock

Start improving build scripts

WIP

I have no idea how to make this work

Update configs

Fix storybook

Fix build error

Partial port to vitest

Maybe working reliably now

Fix other package tests

Bump hypertxt version

Fix build issue with react-select

I dont know if I'm getting closer

Start cleaning up the build scripts now that we are closer

Improve build setup further

Simplify

Add support for more minimal imports

Move files around so that the exports are cleaner

Fix up css gen

Extra line

Hopefully make coverage work agian

sync package lock

Fix react 18 script

Github actions being super weird

Im dumb

Hopefully move forward for now

Remove cra4 support

Hopefully fix script on ci

Fix coverage reporting?
  • Loading branch information
jassmith committed Nov 26, 2023
1 parent 40cfc4b commit 68ad557
Show file tree
Hide file tree
Showing 247 changed files with 19,218 additions and 62,733 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/beta.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Build
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 16.16.0
- run: npm install
- run: npm run build
- run: npm run test -- --coverage
Expand All @@ -30,8 +30,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 16.16.0
- run: npm install
- run: npm run test-18
6 changes: 3 additions & 3 deletions .github/workflows/release.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Bootstrap
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Bootstrap
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Bootstrap
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/storybook.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/[email protected]
with:
persist-credentials: false
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Install and Build 🔧
Expand Down
2 changes: 1 addition & 1 deletion .storybook/.babelrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"@babel/preset-react",
"@babel/preset-typescript",
"@linaria/babel-preset"
"@linaria"
],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
2 changes: 2 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const ResolveTypeScriptPlugin = require("resolve-typescript-plugin");

module.exports = {
stories: ["../**/src/**/*.stories.tsx"],
Expand Down Expand Up @@ -32,6 +33,7 @@ module.exports = {
});

config.optimization.minimize = false;
config.resolve.plugins = [new ResolveTypeScriptPlugin()];

return config;
},
Expand Down
48 changes: 48 additions & 0 deletions config/build-util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
run_in_parallel() {
local funcs=("$@")
local pids=()

# Start the functions in the background and store their PIDs
for func in "${funcs[@]}"; do
($func) &
pids+=($!)
done

# Wait for all functions and exit if any of them fail
for pid in "${pids[@]}"; do
wait $pid || exit $?
done
}

generate_index_css() {
echo "/* Auto-generated file */" > dist/index.css
find dist/esm -name '*.css' -print | sed 's/^dist\/esm\//\@import ".\/esm\//' | sed 's/$/";/' >> dist/index.css
}

ensure_bash_4() {
if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
if [ -x "/opt/homebrew/bin/bash" ]; then
exec /opt/homebrew/bin/bash "$0" "$@"
elif [ -x "/usr/local/bin/bash" ]; then
exec /usr/local/bin/bash "$0" "$@"
else
echo "Bash 4 or higher is required."
exit 1
fi
fi
}

remove_all_css_imports() {
local directory=$1
local sed_cmd="sed -i"

# Check if sed is GNU sed or BSD sed
if sed --version 2>/dev/null | grep -q GNU; then
sed_cmd="sed -i" # GNU sed
else
sed_cmd="sed -i ''" # BSD sed
fi

find "$directory" -type f -name "*.js" -exec $sed_cmd "/require('.\/.*\.css');/d" {} +
find "$directory" -type f -name "*.js" -exec $sed_cmd "/import \".\/.*\.css\";/d" {} +
}
3 changes: 3 additions & 0 deletions config/linaria.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"classNameSlug": "gdg-[hash]"
}
Loading

0 comments on commit 68ad557

Please sign in to comment.