diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aebd6eb..35a7c15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,27 +5,49 @@ name: Build on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x, 14.x, 16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run build - - run: npm test + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 8 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Lint + run: pnpm run lint + + - name: Typecheck + run: pnpm run typecheck diff --git a/src/specialAssign.ts b/src/specialAssign.ts deleted file mode 100644 index e506c7f..0000000 --- a/src/specialAssign.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default function specialAssign(a, b, reserved) { - reserved = reserved || {}; - // This will get id, className, style, etc. - for (var x in b) { - if (!Object.prototype.hasOwnProperty.call(b, x)) continue; - if (reserved[x]) continue; - a[x] = b[x]; - } -} diff --git a/webpack-demo.config.js b/webpack-demo.config.js deleted file mode 100644 index 71c43a7..0000000 --- a/webpack-demo.config.js +++ /dev/null @@ -1,14 +0,0 @@ -const path = require("path"); - -module.exports = { - entry: { - demo: "./demo/js/index.js" - }, - output: { - path: path.join(__dirname, "demo"), - filename: "demo-bundle.js" - }, - module: { - rules: [{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }] - } -}; diff --git a/webpack-umd.config.js b/webpack-umd.config.js deleted file mode 100644 index b088bf6..0000000 --- a/webpack-umd.config.js +++ /dev/null @@ -1,35 +0,0 @@ -const path = require("path"); - -const filename = process.env.MINIFY - ? "ReactAriaMenuButton.min.js" - : "ReactAriaMenuButton.js"; - -module.exports = { - entry: { - AriaMenuButton: "./src/index.js" - }, - output: { - library: "ReactAriaMenuButton", - libraryTarget: "umd", - path: path.join(__dirname, "umd"), - filename: filename - }, - externals: [ - { - react: { - root: "React", - commonjs2: "react", - commonjs: "react", - amd: "react" - } - }, - ], - module: { - rules: [{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }] - }, - node: { - Buffer: false, - process: false, - setImmediate: false - } -};