Skip to content

Commit

Permalink
Merge branch 'pnpm-clean' into bun-sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatOneCalculator committed Oct 7, 2023
2 parents 23d1e28 + 04c9439 commit dc8517a
Show file tree
Hide file tree
Showing 4 changed files with 599 additions and 775 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- name: Typescript example (Bun)
run: |
cd megalodon && bun run test
pnpm -r run build
example:
runs-on: ubuntu-latest
Expand All @@ -73,19 +74,18 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
yarn install
- name: Build
corepack enable && pnpm install
- name: Build library
run: |
yarn workspace megalodon run build
pnpm --filter megalodon run test
- name: Browser example
pnpm --filter megalodon run build
- name: Build examples
run: |
pnpm --filter browser run build
pnpm --filter !megalodon run build
- name: Typescript example
env:
MASTODON_URL: https://fedibird.com
PLEROMA_URL: https://pleroma.io
FIREFISH_URL: https://cybre.club
FIREFISH_URL: https://fedi.software
FRIENDICA_URL: https://squeet.me
run: |
pnpm --filter example run build
Expand Down Expand Up @@ -114,10 +114,8 @@ jobs:
run: cd megalodon && bun run build:bun-node && bun run build:bun
- name: Testing (Bun)
run: cd megalodon && bun run test
- name: Browser example (Bun)
run: cd example/browser && bun run build:bun-node && bun run build:bun
- name: Typescript example (Bun)
run: cd example/typescript && bun run build:bun-node && bun run build:bun
run: cd example/typescript && bun run build:bun
bun run example/typescript/dist/mastodon/instance.js
bun run example/typescript/dist/pleroma/instance.js
bun run example/typescript/dist/firefish/instance.js
Expand Down
16 changes: 9 additions & 7 deletions example/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "4.0.0",
"private": true,
"scripts": {
"build": "webpack",
"build:bun-node": "bun build ./src --outdir=lib --minify --target=node",
"build:bun": "bun build ./src --outdir=lib --minify --target=bun",
"build": "vite build",
"start": "http-server -p 8000 -s index.html",
"lint": "eslint --ext .js,.ts src"
"lint": "eslint --ext .js,.ts src",
"serve": "vite",
"preview": "vite preview"
},
"author": "Akira Fukushima <[email protected]> (https://github.com/h3poteto)",
"license": "MIT",
Expand All @@ -29,7 +29,9 @@
"ts-loader": "^9.4.4",
"typescript": "5.2.2",
"url": "^0.11.3",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
"vite-plugin-env-compatible": "^1.1.1",
"vite-plugin-html": "3.2.0",
"vite": "^2.7.2",
"@originjs/vite-plugin-commonjs": "^1.0.1"
}
}
}
42 changes: 42 additions & 0 deletions example/browser/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { defineConfig } from 'vite';
import path from 'path';
import envCompatible from 'vite-plugin-env-compatible';
import { createHtmlPlugin } from 'vite-plugin-html';
import { viteCommonjs } from '@originjs/vite-plugin-commonjs';

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: [
{
find: /^~/,
replacement: ''
},
{
find: '@',
replacement: path.resolve(__dirname, 'src')
}
],
extensions: [
'.mjs',
'.js',
'.ts',
'.jsx',
'.tsx',
'.json',
'.vue'
]
},
plugins: [
viteCommonjs(),
envCompatible(),
createHtmlPlugin({
inject: {
data: {
title: 'browser'
}
}
})
],
build: {}
})
Loading

0 comments on commit dc8517a

Please sign in to comment.