Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work #27

Merged
merged 18 commits into from
Oct 30, 2024
Merged

Work #27

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b4c5f9c
fix: Respect declaration order of object properties and use field exp…
tristanmenzel Oct 22, 2024
9c740c9
fix: Destructuring into iterator items
tristanmenzel Oct 22, 2024
8cd1408
feat: Support empty statements
tristanmenzel Oct 22, 2024
5973e2a
feat: Provide struct definitions to puya for arc4 methods
tristanmenzel Oct 23, 2024
92dd870
feat: Allow replacement tokens in outpath
tristanmenzel Oct 23, 2024
683a832
fix: Use correct case for copy readme script
tristanmenzel Oct 23, 2024
4638428
build: Validate that the code built for the algo-ts package matches
tristanmenzel Oct 23, 2024
3d1eea5
build: Use "./" instead of "."
tristanmenzel Oct 23, 2024
3e0e3f8
build: Remove commit lint warnings
tristanmenzel Oct 23, 2024
a57123c
test: Add test fixture for running Algorand TypeScript code on chain
tristanmenzel Oct 24, 2024
2a1bfcc
feat: Add implicit create methods to contracts which don't have an ex…
tristanmenzel Oct 24, 2024
14dbd35
fix: Expand implicit create method logic to check base contracts and …
tristanmenzel Oct 25, 2024
271a929
build: Start algokit localnet for testing
tristanmenzel Oct 25, 2024
38252ce
refactor: Support puya refactor to surface MRO and inheritance concer…
tristanmenzel Oct 26, 2024
18cecdb
test: Increase test timeout
tristanmenzel Oct 29, 2024
dd15e8c
feat: Expand arc4 type support
tristanmenzel Oct 29, 2024
8202823
chore: Bump package version
tristanmenzel Oct 29, 2024
7d0176b
feat: Array indexing + bug fixes
tristanmenzel Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/ci-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ jobs:
working-directory: packages/algo-ts
upload-artifact-name: algo-ts
upload-artifact-path: ./packages/algo-ts/dist
post-build-script: |
cd dist
set +e # Continue on error
thisVersion=$(npm view ./ version)
diffText=$(npm diff --diff=./ --diff=@algorandfoundation/algorand-typescript@$thisVersion)
diffExitCode=$?
set -e # Exit on error
[ $diffExitCode -ne 0 ] && (echo "$thisVersion has not been published yet"; exit 0;) || echo "$thisVersion already published, checking diff against local build"
diffTextLen=${#diffText}
[ $diffTextLen -eq 0 ] && echo 'No changes' || (echo 'ERROR: Code differs to published version. Please bump package version or revert changes'; echo $diffText; exit 1;)


ci-puya-ts:
name: 'Build @algorandfoundation/puya-ts'
uses: ./.github/workflows/node-ci.yml
Expand All @@ -30,4 +42,6 @@ jobs:
upload-artifact-path: ./dist
python-version: 3.12.6
pre-test-script: |
pipx install puyapy --python 3.12.6
pipx install algokit --python 3.12.6
algokit localnet start
pipx install git+https://github.com/algorandfoundation/puya --python 3.12.6
7 changes: 7 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ on:
required: false
type: string
default: npm run build
post-build-script:
required: false
type: string
run-build:
required: false
type: boolean
Expand Down Expand Up @@ -178,6 +181,10 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token || secrets.GITHUB_TOKEN }}

- name: Post build
if: ${{ inputs.post-build-script }}
run: ${{ inputs.post-build-script }}

- name: Publish artifact
if: ${{ inputs.upload-artifact-name }}
uses: actions/upload-artifact@v4
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ test-results.xml

# Website & Code docs generation
code-docs/
out/
debug-out/
!tests/approvals/out

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local


tests/expected-output/out
15 changes: 7 additions & 8 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
// Allow sentence case commit messages
'subject-case': [1, 'always', ['pascal-case', 'upper-case']],
'type-empty': [1, 'never'],
'subject-empty': [1, 'always'],
'subject-case': [0, 'always', ['pascal-case', 'upper-case']],
'type-empty': [2, 'never'],
'subject-empty': [0, 'always'],
'body-leading-blank': [0, 'always'],
'body-max-line-length': [1, 'always', 200],
'header-max-length': [1, 'always', 150],
'footer-max-length': [1, 'always', 150],
'footer-max-line-length': [1, 'always', 150],
'body-max-line-length': [0, 'always', 200],
'header-max-length': [0, 'always', 150],
'footer-max-length': [0, 'always', 150],
'footer-max-line-length': [0, 'always', 150],
},
}

4 changes: 2 additions & 2 deletions examples/calculator/contract.algo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { uint64 } from '@algorandfoundation/algorand-typescript'
import { assert, Bytes, Contract, err, log, op, Txn, Uint64 } from '@algorandfoundation/algorand-typescript'
import { assert, BaseContract, Bytes, err, log, op, Txn, Uint64 } from '@algorandfoundation/algorand-typescript'

const ADD = Uint64(1)
const SUB = Uint64(2)
Expand All @@ -13,7 +13,7 @@ function itoa(i: uint64): string {
}
return itoa(i / radix).concat(digits.at(i % radix).toString())
}
export default class MyContract extends Contract {
export default class MyContract extends BaseContract {
public approvalProgram(): boolean {
const numArgs = Txn.numAppArgs
let a: uint64, b: uint64, action: uint64
Expand Down
1 change: 0 additions & 1 deletion examples/voting/contract.algo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const BOX_BYTE_MIN_BALANCE: uint64 = 400
// The min balance increase for each asset opted into
const ASSET_MIN_BALANCE: uint64 = 100000

// TODO: ObjectPType should hopefully respect this ordering of properties
type VotingPreconditions = {
is_voting_open: uint64
is_allowed_to_vote: uint64
Expand Down
189 changes: 188 additions & 1 deletion package-lock.json

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

Loading