Skip to content

Commit

Permalink
release everything
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnichase committed Jun 20, 2024
1 parent 510c88c commit 4ae8f94
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release-got-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ jobs:
working-directory: ./packages/got-core
shell: bash
run: pnpm build
- name: Build
working-directory: ./packages/got-api
shell: bash
run: pnpm build
- name: Publish
working-directory: ./packages/got-core
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions packages/got-api/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import build from '@gothub/typescript-util/esbuild.js';

build({ srcDir: './client-js' });
10 changes: 5 additions & 5 deletions packages/got-api/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@gothub/got-api",
"version": "0.0.7",
"version": "0.0.8",
"license": "MIT",
"type": "module",
"module": "client-js/index.ts",
"types": "client-js/index.ts",
"main": "client-js/index.ts",
"types": "dist/module/index.d.ts",
"main": "dist/module/index.js",
"scripts": {
"generate:client-js": "bun client-js/generate.ts",
"build": "bun ./esbuild.lambda.js",
"build:lambda": "bun ./esbuild.lambda.js",
"build": "bun ./esbuild.js",
"lint": "eslint ."
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/got-api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@gothub/typescript-util/tsconfig-backend.json",
"extends": "@gothub/typescript-util/tsconfig-frontend.json",
"include": ["**/*.ts"]
}
2 changes: 1 addition & 1 deletion packages/got-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gothub/got-core",
"version": "0.0.7",
"version": "0.0.8",
"license": "MIT",
"type": "module",
"main": "dist/module/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/got-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gothub/got-react",
"version": "0.0.12",
"version": "0.0.13",
"license": "MIT",
"type": "module",
"main": "dist/module/index.js",
Expand Down
50 changes: 26 additions & 24 deletions packages/typescript-util/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const clean = () => {

const buildTs = async (options = {}) => {
clean();

const entryFiles = getAllFiles('./src');
const srcDir = options.srcDir || './src';
const entryFiles = getAllFiles(srcDir);

// compile CJS
await build({
Expand All @@ -48,30 +48,32 @@ const buildTs = async (options = {}) => {
});

// compile minified CJS
await build({
logLevel: 'info',
minify: true,
treeShaking: true,
target: 'node18.0',
platform: 'node',
format: 'cjs',
entryPoints: entryFiles,
outdir: './dist/min',
});
options.minBundle &&
(await build({
logLevel: 'info',
minify: true,
treeShaking: true,
target: 'node18.0',
platform: 'node',
format: 'cjs',
entryPoints: entryFiles,
outdir: './dist/min',
}));

// compile minified bundle CJS
await build({
logLevel: 'info',
bundle: true,
minify: true,
treeShaking: true,
target: 'node18.0',
platform: 'node',
format: 'cjs',
external: options?.min?.external || [],
entryPoints: ['./src/index.ts'],
outfile: './dist/min-bundle/index.js',
});
options.minBundle &&
(await build({
logLevel: 'info',
bundle: true,
minify: true,
treeShaking: true,
target: 'node18.0',
platform: 'node',
format: 'cjs',
external: options?.min?.external || [],
entryPoints: [path.join(srcDir, '/index.ts')],
outfile: './dist/min-bundle/index.js',
}));

// compile ESM with types
await build({
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gothub/typescript-util",
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",
"type": "module",
"devDependencies": {
Expand Down

0 comments on commit 4ae8f94

Please sign in to comment.