Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #824

Merged
merged 35 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9fdd82f
chore: Rework dependencies + migrate from `pnpm` to `bun`
maxmilton Jul 15, 2024
3bd4175
chore: Refactor tooling configs part 1
maxmilton Jul 15, 2024
1ddd536
chore: Refactor TypeScript configs
maxmilton Jul 15, 2024
806073b
chore: Migrate to eslint v9 + improve configs
maxmilton Jul 15, 2024
bf3328d
chore: Migrate from `prettier` to `biome`
maxmilton Jul 15, 2024
70d5091
chore: Refactor VS Code settings
maxmilton Jul 15, 2024
6e6c550
chore: More tooling changes
maxmilton Jul 15, 2024
320b11e
chore: Update year to 2024
maxmilton Jul 15, 2024
50bff36
chore: Refactor CI workflows
maxmilton Jul 15, 2024
13ec651
bug(framework): Fix linting and file spelling typo
maxmilton Jul 15, 2024
447d96e
bug(framework): Add new `.dfcc` CSS class
maxmilton Jul 15, 2024
495eda7
feat: Refactor and simplify builds + update package.json files
maxmilton Jul 15, 2024
47433a6
chore: Refactor package dependencies
maxmilton Jul 15, 2024
931fad5
test: Refactor and improve tooling + add more tests
maxmilton Jul 15, 2024
811d7f8
feat(cli): Improve and clean up
maxmilton Jul 15, 2024
ace5858
chore: Fix lint issues
maxmilton Jul 15, 2024
8efebb3
bug(svelte-ekscss): Fix type and linting issues
maxmilton Jul 15, 2024
9eb5736
bug(rollup-plugin-ekscss): Fix type and linting issues
maxmilton Jul 15, 2024
1a6ed7a
feat(postcss-ekscss): Manually declare types
maxmilton Jul 15, 2024
622f04d
bug(postcss-ekscss): Fix external types
maxmilton Jul 15, 2024
1a49618
feat(postcss-ekscss): Sync with latest upstream change + fix type and…
maxmilton Jul 15, 2024
6b60085
bug(ekscss): Fix types and lint issues
maxmilton Jul 15, 2024
bf67320
feat(ekscss): Migrate from `source-map` to `source-map-js`
maxmilton Jul 15, 2024
3b1c6c4
test: Possibly fix race condition in test
maxmilton Jul 15, 2024
bd25aa3
chore: Fix pnpm version in CI for node tests
maxmilton Jul 15, 2024
70f99fe
chore: Workaround for failing CI on old node versions
maxmilton Jul 15, 2024
63b67e9
chore: Exclude bad node version matrix combinations
maxmilton Jul 15, 2024
a91596c
chore: Refactor CI test matrix
maxmilton Jul 15, 2024
d78c650
chore: Experimental node v10 tests in CI
maxmilton Jul 15, 2024
693dd4d
chore: Fix missing pnpm in CI
maxmilton Jul 15, 2024
fa6cc34
chore: Fix pnpm version in CI for node v10
maxmilton Jul 15, 2024
7544214
chore: Remove node v10 from CI due to poor compat with tooling
maxmilton Jul 15, 2024
a99d225
chore: More CI tweaks
maxmilton Jul 15, 2024
6c08f2e
chore: Downgrade lint error to warning
maxmilton Jul 15, 2024
524343d
chore: Add naming convention lint rule
maxmilton Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .eslintrc.cjs

This file was deleted.

105 changes: 61 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ on:
paths-ignore: ['**.md']
pull_request: {}
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 20
- run: npm install --global pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run build
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run build
- uses: actions/upload-artifact@v4
with:
name: build
Expand All @@ -26,67 +28,83 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12, 14, 16, 18, 20]
platform: [ubuntu, windows, macos]
name: test (node v${{ matrix.node-version }} ${{ matrix.platform }})
name: test-bun (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}-latest
timeout-minutes: 10
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: build
path: packages
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install --global pnpm@6
if: ${{ matrix.node-version == 12 }}
- run: npm install --global pnpm@7
if: ${{ matrix.node-version == 14 }}
- run: npm install --global pnpm@8
if: ${{ matrix.node-version == 16 }}
- run: npm install --global pnpm
if: ${{ matrix.node-version >= 18 }}
# Old versions of pnpm don't support lockfile format v6 (pnpm v8+)
- run: pnpm install --frozen-lockfile --fix-lockfile
if: ${{ matrix.node-version <= 14 }}
- run: pnpm install --frozen-lockfile
if: ${{ matrix.node-version >= 16 }}
- run: pnpm run test
- run: pnpm run test:raw
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run test --coverage --coverage-reporter=lcov --coverage-reporter=text
- name: Report coverage
if: ${{ matrix.node-version == 20 && matrix.platform == 'ubuntu' && github.repository_owner == 'maxmilton' }}
if: ${{ matrix.platform == 'ubuntu' && github.repository_owner == 'maxmilton' }}
run: |
curl -Lo ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
./cc-test-reporter upload-coverage
curl -LO https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
-LO https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64.sha256
grep test-reporter-latest-linux-amd64 test-reporter-latest-linux-amd64.sha256 | shasum -a 256 -c -
mv test-reporter-latest-linux-amd64 test-reporter
chmod +x ./test-reporter
./test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
./test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
test-bun:
test-node:
needs: build
strategy:
fail-fast: false
matrix:
# TODO: If bun ever gets native windows support, add it
platform: [ubuntu, macos]
name: test-bun (${{ matrix.platform }})
node-version: [12, 14, 16, 18, 20, 22]
platform: [ubuntu, windows, macos]
name: test-node (v${{ matrix.node-version }} ${{ matrix.platform }})
runs-on: ${{ matrix.platform }}-latest
timeout-minutes: 5
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: build
path: packages
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun add -g pnpm
- run: pnpm install --frozen-lockfile
- run: bun run test
- run: bun run test:raw
- run: bun install --global pnpm
- run: bun install --frozen-lockfile
# - run: npm install --global pnpm@6
# if: ${{ matrix.node-version == 12 }}
# - run: npm install --global pnpm@7
# if: ${{ matrix.node-version == 14 }}
# - run: npm install --global pnpm@8
# if: ${{ matrix.node-version == 16 }}
# - run: npm install --global pnpm
# if: ${{ matrix.node-version >= 18 }}
# # Old versions of pnpm don't support lockfile format v6 (pnpm v8+)
# - run: pnpm install --frozen-lockfile --fix-lockfile
# if: ${{ matrix.node-version <= 14 }}
# - run: pnpm install --frozen-lockfile
# if: ${{ matrix.node-version >= 16 }}
- run: pnpm run test:node
- name: Report coverage
if: ${{ matrix.node-version == 22 && matrix.platform == 'ubuntu' && github.repository_owner == 'maxmilton' }}
run: |
curl -LO https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
-LO https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64.sha256
grep test-reporter-latest-linux-amd64 test-reporter-latest-linux-amd64.sha256 | shasum -a 256 -c -
mv test-reporter-latest-linux-amd64 test-reporter
chmod +x ./test-reporter
./test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
./test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
lint:
needs: build
runs-on: ubuntu-latest
Expand All @@ -97,9 +115,8 @@ jobs:
with:
name: build
path: packages
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 20
- run: npm install --global pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run lint
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
workflow_dispatch: {}
schedule:
- cron: '28 6 * * 4'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
runs-on: ubuntu-latest
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml.DISABLED
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: publish
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write
steps:
- name: Check valid version tag
run: |
[[ "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)? ]] || exit 1
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: latest
registry-url: 'https://registry.npmjs.org'
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run test
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/release.yml.DISABLED
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: release
on:
push:
tags: [v*.*.*]
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run test
- run: gh release create "${{ github.ref_name }}" --draft --generate-notes
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/semgrep-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
workflow_dispatch: {}
schedule:
- cron: '28 6 * * 4'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: typos
on:
push:
branches: [master]
pull_request: {}
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
typos:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
*-lock.json*
*-lock.yaml
*.bak
*.lock
*.log
/coverage
dist
node_modules
package-lock.json*
/coverage/
dist/
node_modules/

# auto-generated
packages/framework/*.d.ts
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

6 changes: 4 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"recommendations": [
"biomejs.biome",
"oven.bun-vscode",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint"
"stylelint.vscode-stylelint",
"tekumara.typos-vscode"
]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Bun",
"type": "bun",
"request": "attach",
// use `bun --inspect` to open a debug port
"url": "ws://localhost:6499/"
},
{
"name": "bun test <CURRENT_FILE>",
"type": "bun",
"request": "launch",
"runtimeArgs": ["test"],
"program": "${file}",
"internalConsoleOptions": "openOnSessionStart"
}
// TODO: Add a way to run all tests
]
}
Loading
Loading