Skip to content

Commit

Permalink
✨ added II support
Browse files Browse the repository at this point in the history
  • Loading branch information
letmejustputthishere committed Jan 18, 2024
1 parent d8caacb commit 65f3532
Show file tree
Hide file tree
Showing 10 changed files with 292 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dist-ssr
.dfx
.vessel
.mops
deps

# Environment variables
/build
Expand Down
6 changes: 5 additions & 1 deletion backend/main.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
actor class Main() {
public func greet(name : Text) : async Text {
public query func greet(name : Text) : async Text {
return "Hello, " # name # "!";
};

public query ({ caller }) func whoAmI() : async Principal {
return caller;
};
};
6 changes: 5 additions & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"frontend": {
"dependencies": ["backend"],
"type": "assets",
"source": ["dist/"]
"source": ["build/"]
},
"internet_identity": {
"type": "pull",
"id": "rdmx6-jaaaa-aaaaa-aaadq-cai"
}
},
"defaults": {
Expand Down
139 changes: 139 additions & 0 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"version": "0.0.1",
"private": true,
"scripts": {
"setup": "npm i && dfx generate backend && dfx deploy backend",
"setup": "npm i && npm run init-ii && dfx generate backend && dfx generate internet_identity && dfx deploy backend && dfx deps deploy",
"init-ii": "dfx deps pull && dfx deps init internet_identity --argument '(null)'",
"start": "run-p frontend backend",
"frontend": "vite --port 3000",
"backend": "mo-dev --generate --deploy -y",
"build": "vite build",
"test": "run-s test:backend test:frontend",
"test:frontend": "vitest run",
"test:backend": "mo-test",
"test:backend": "mops test",
"format": "prettier --write .",
"sources": "mops sources",
"postinstall": "mops install",
Expand All @@ -22,9 +23,11 @@
},
"devDependencies": {
"@dfinity/agent": "^0.20.2",
"@dfinity/auth-client": "^0.20.2",
"@dfinity/candid": "^0.20.2",
"@dfinity/principal": "^0.20.2",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "8.56.0",
Expand Down
1 change: 0 additions & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/src/global.scss" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
Expand Down
5 changes: 5 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
import '../global.scss';
</script>

<slot />
1 change: 1 addition & 0 deletions src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = true;
Loading

0 comments on commit 65f3532

Please sign in to comment.