Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit f0cc6bf

Browse files
authored
Merge pull request #4 from erhant/bundling
better bundling, publish workflow
2 parents 9a08c64 + 1a0e9d3 commit f0cc6bf

File tree

16 files changed

+54
-38
lines changed

16 files changed

+54
-38
lines changed

.github/workflows/publish.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: oven-sh/setup-bun@v1
14+
15+
- name: Install packages
16+
run: bun install
17+
18+
- name: Build
19+
run: bun run build
20+
21+
- uses: JS-DevTools/npm-publish@v3
22+
id: publish
23+
with:
24+
token: ${{ secrets.NPM_TOKEN }}

bun.lockb

4.16 KB
Binary file not shown.

package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"name": "thuffscript",
33
"author": "erhant",
4-
"version": "0.1.1",
4+
"version": "0.1.2",
55
"license": "MIT",
66
"scripts": {
77
"eg:AddConstant": "bun run ./examples/AddConstant.ts",
88
"eg:Address": "bun run ./examples/Address.ts",
99
"eg:SimpleStore": "bun run ./examples/SimpleStore.ts",
10-
"build:bun": "bun build ./src/index.ts --outdir ./dist --target node",
11-
"build": "bunx parcel build",
10+
"build": "bunx parcel build ",
1211
"prebuild": "bun run format && bun run lint",
1312
"huff": "huffc -b",
1413
"format": "prettier --check '**/*.ts'",
@@ -28,13 +27,17 @@
2827
"targets": {
2928
"cjs": {
3029
"outputFormat": "commonjs",
31-
"isLibrary": true,
32-
"context": "node"
30+
"isLibrary": false,
31+
"context": "node",
32+
"scopeHoist": false,
33+
"includeNodeModules": false
3334
},
3435
"mjs": {
3536
"outputFormat": "esmodule",
36-
"isLibrary": true,
37-
"context": "node"
37+
"isLibrary": false,
38+
"context": "node",
39+
"scopeHoist": false,
40+
"includeNodeModules": false
3841
}
3942
},
4043
"files": [
@@ -82,6 +85,6 @@
8285
"huff",
8386
"solidity",
8487
"ethereum",
85-
"types"
88+
"typescript"
8689
]
8790
}

src/compilables/compilable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {TableSize, TableStart, Declarable, Declarables} from '../declarables';
22
import {JumpSource, JumpDest} from '../labels';
33
import {MacroCall, MacroSize, Macro} from '.';
4-
import {Statements} from '../types';
4+
import type {Statements} from '../types';
55

66
/** A compilable Huff expression.
77
*

src/compilables/macro.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Compilable} from './compilable';
2-
import {Literal} from '../types';
2+
import type {Literal} from '../types';
33

44
/** A [macro](https://docs.huff.sh/get-started/huff-by-example/#macros).
55
*

src/compilables/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Compilable} from './compilable';
2-
import {Literal} from '../types';
2+
import type {Literal} from '../types';
33

44
/** A [test](https://docs.huff.sh/get-started/huff-by-example/#huff-tests).
55
*

src/declarables/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Declarable} from '../declarables/declarable';
2-
import {Primitive} from '../types';
2+
import type {Primitive} from '../types';
33

44
/** A [custom error](https://docs.huff.sh/get-started/huff-by-example/#custom-errors).
55
*

src/declarables/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Declarable} from '../declarables/declarable';
2-
import {Primitive} from '../types';
2+
import type {Primitive} from '../types';
33

44
/** An [event interface](https://docs.huff.sh/get-started/huff-by-example/#defining-your-interface).
55
*

src/declarables/function.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Declarable} from '../declarables/declarable';
2-
import {Primitive} from '../types';
2+
import type {Primitive} from '../types';
33
import {Label} from '..';
44

55
/** A [function interface](https://docs.huff.sh/get-started/huff-by-example/#defining-your-interface).

src/declarables/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ export * from './event';
44
export * from './function';
55
export * from './table';
66
export * from './declarable';
7-
export * from './types';
7+
export type * from './types';

0 commit comments

Comments
 (0)