Skip to content

Commit

Permalink
build: Bundle patched typescript package with compiler and remove pee…
Browse files Browse the repository at this point in the history
…r dependency on algorand-typescript
  • Loading branch information
tristanmenzel committed Oct 2, 2024
1 parent 5a777ab commit 4c3010d
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 48 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,19 @@ jobs:
package: artifacts/algo-ts/package.json
access: 'public'

- name: Update puya-ts' peer dependency on algo-ts
run: npx tsx ../../scripts/update-algo-ts-peer-dep.ts ${{ steps.publish-algo-ts.outputs.version }}
- name: Install @algorandfoundation/puya-ts dependencies and patch for bundling
run: npm i --include=prod && npx patch-package --patch-dir ../../patches
working-directory: artifacts/puya-ts

- name: Publish @algorandfoundation/puya-ts
- name: Generate semantic version for @algorandfoundation/puya-ts
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @algorandfoundation/puya-ts
uses: JS-DevTools/npm-publish@v3
id: publish-puya-ts
with:
token: ${{ secrets.NPM_TOKEN }}
package: artifacts/puya-ts/package.json
access: 'public'
1 change: 1 addition & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
[
"@semantic-release/npm",
{
"npmPublish": false,
"pkgRoot": "artifacts/puya-ts"
}
],
Expand Down
1 change: 1 addition & 0 deletions .tstoolkitrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const config: TsToolkitConfig = {
'puya-ts': 'bin/run-cli.ts',
puyats: 'bin/run-cli.ts',
},
customSections: ['bundledDependencies'],
},
}
export default config
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Algorand Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 16 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@algorandfoundation/puya-ts",
"version": "1.0.0",
"description": "",
"description": "Compiles Algorand TypeScript into byte code which runs on the Algorand Virtual Machine (AVM)",
"private": false,
"types": "src/index.ts",
"scripts": {
Expand All @@ -10,7 +10,7 @@
"dev:auction": "tsx src/cli.ts build examples/auction --dry-run",
"dev:voting": "tsx src/cli.ts build examples/voting/contract.algo.ts --output-awst --output-awst-json",
"dev:hello": "tsx src/cli.ts build examples/hello-world/contract.algo.ts --output-awst --output-awst-json",
"dev:hello-abi": "tsx src/cli.ts build examples/hello-world-abi/contract.algo.ts",
"dev:hello-abi": "tsx src/cli.ts build examples/hello-world-abi",
"dev:calculator": "tsx src/cli.ts build examples/calculator/contract.algo.ts",
"dev:tealscript": "tsx src/cli.ts build examples/tealscript/example.algo.ts",
"dev:approvals": "tsx src/cli.ts build tests/approvals --output-awst --output-awst-json --dry-run",
Expand Down Expand Up @@ -44,7 +44,7 @@
"script:op-metadata": "tsx ./scripts/generate-op-metadata.ts src/awst_build/op-metadata.ts && eslint src/awst_build/op-metadata.ts --fix",
"script:op-ptypes": "tsx ./scripts/generate-op-ptypes.ts src/awst_build/ptypes/op-ptypes.ts && eslint src/awst_build/ptypes/op-ptypes.ts --fix"
},
"author": "",
"author": "Algorand foundation",
"license": "MIT",
"devDependencies": {
"@algorandfoundation/algorand-typescript": "file:packages/algo-ts/dist",
Expand Down Expand Up @@ -75,7 +75,6 @@
"rollup": "^4.22.4",
"semantic-release": "^24.1.1",
"tsx": "4.19.1",
"typescript": "^5.6.2",
"vitest": "2.1.1"
},
"dependencies": {
Expand All @@ -85,9 +84,10 @@
"cross-spawn": "^7.0.3",
"glob": "^11.0.0",
"polytype": "^0.17.0",
"typescript": "^5.6.2",
"zod": "^3.23.8"
},
"peerDependencies": {
"@algorandfoundation/algorand-typescript": "0.0.1-alpha.1"
}
"bundledDependencies": [
"typescript"
]
}
4 changes: 2 additions & 2 deletions packages/algo-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@algorandfoundation/algorand-typescript",
"version": "0.0.1-alpha.1",
"description": "",
"version": "0.0.1-alpha.2",
"description": "This package contains definitions for the types which comprise Algorand TypeScript which can be compiled to run on the Algorand Virtual Machine using the Puya compiler.",
"private": false,
"main": "index.js",
"types": "src/index.ts",
Expand Down
30 changes: 0 additions & 30 deletions scripts/update-algo-ts-peer-dep.ts

This file was deleted.

0 comments on commit 4c3010d

Please sign in to comment.