Skip to content

Commit

Permalink
chore: update Azle templates to 0.24.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Dec 14, 2024
1 parent 26a976d commit 89d0298
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 28 deletions.
3 changes: 1 addition & 2 deletions src/dfx/assets/project_templates/any_js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"compilerOptions": {
"strict": true,
"target": "ES2020",
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"module": "ES2020",
"moduleResolution": "node",
"allowJs": true,
"outDir": "HACK_BECAUSE_OF_ALLOW_JS"
Expand Down
17 changes: 2 additions & 15 deletions src/dfx/assets/project_templates/azle/dfx.json-patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,8 @@
"path": "/canisters/__backend_name__",
"op": "add",
"value": {
"type": "custom",
"main": "src/__backend_name__/src/index.ts",
"candid": "src/__backend_name__/__backend_name__.did",
"build": "npx azle __backend_name__",
"wasm": ".azle/__backend_name__/__backend_name__.wasm",
"gzip": true,
"tech_stack": {
"language": {
"javascript": {},
"typescript": {}
},
"cdk": {
"azle": {}
}
}
"type": "azle",
"main": "src/__backend_name__/src/index.ts"
}
}
]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"type": "module",
"dependencies": {
"azle": "^0.19.0"
"azle": "^0.24.1"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { Canister, query, text } from 'azle';
import { IDL, query, update } from 'azle';

export default Canister({
greet: query([text], text, (name) => {
return `Hello, ${name}!`;
})
})
export default class {
message: string = 'Hello world!';

@query([], IDL.Text)
getMessage(): string {
return this.message;
}

@update([IDL.Text])
setMessage(message: string): void {
this.message = message;
}
}

0 comments on commit 89d0298

Please sign in to comment.