Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/svelte-motoko-starter-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: svelte-motoko-starter
on:
push:
branches:
- master
pull_request:
jobs:
svelte-motoko-starter-darwin:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v1
- name: Provision Darwin
run: bash .github/workflows/provision-darwin.sh
- name: Svelte Motoko Starter Example Darwin
run: |
dfx start --background
pushd svelte-motoko-starter
make test
popd
svelte-motoko-starter-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Provision Linux
run: bash .github/workflows/provision-linux.sh
- name: Svelte Motoko Starter Example Linux
run: |
dfx start --background
pushd svelte-motoko-starter
make test
popd
31 changes: 31 additions & 0 deletions .github/workflows/svelte-starter-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: svelte-starter
on:
push:
branches:
- master
pull_request:
jobs:
svelte-starter-darwin:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v1
- name: Provision Darwin
run: bash .github/workflows/provision-darwin.sh
- name: Svelte Starter Example Darwin
run: |
dfx start --background
pushd svelte-starter
make test
popd
svelte-starter-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Provision Linux
run: bash .github/workflows/provision-linux.sh
- name: Svelte Starter Example Linux
run: |
dfx start --background
pushd svelte-starter
make test
popd
1 change: 1 addition & 0 deletions svelte-motoko-starter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
# frontend code
node_modules/
dist/
internet_identity/
3 changes: 0 additions & 3 deletions svelte-motoko-starter/.gitmodules

This file was deleted.

31 changes: 31 additions & 0 deletions svelte-motoko-starter/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.PHONY: all
all: build

.PHONY: build
.SILENT: build
build:
dfx canister create --all
cd src/frontend && npm i
dfx build

.PHONY: install
.SILENT: install
install: build
dfx deploy

.PHONY: upgrade
.SILENT: upgrade
upgrade: build
dfx canister install --all --mode=upgrade

.PHONY: test
.SILENT: test
test: install
cd src/frontend && npm run test
cd src/frontend && node scripts/setupTypeScript.js && npm i
cd src/frontend && npm run build && npm run test

.PHONY: clean
.SILENT: clean
clean:
rm -fr .dfx
30 changes: 25 additions & 5 deletions svelte-motoko-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ from the project directory will stop the local replica.

## Install Internet Identity

To use Internet Identity during development you need to have it running on your local replica. This repository includes it in a submodule.
To use Internet Identity during development you need to have it running on your local replica. Clone the repository in the project directory, then build and deploy it locally.

To clone the II repository, run:
Make sure you're in the `svelte-motoko-starter` project directory, then clone the repository by running:

```
git submodule update --init --recursive
git clone https://github.com/dfinity/internet-identity
```

When the repository is cloned, switch to its directory and install it:
Expand All @@ -111,15 +111,35 @@ This will take several minutes to complete.

Make sure you switch back to the project root directory.

First, install the frontend dependencies by running
First, switch to the frontend directory:

```
cd src/frontend
```

### Typescript support

The Svelte starter comes with a script to enable using Typescript. If you want to use Typescript run the following commands:

```
node scripts/setupTypeScript.js
```

### Install & run the dapp locally

Install the frontend dependencies by running:

```
npm install
```

Switch back to the project root directory:

```
cd ..
```

To build and deploy the project run
To build and deploy the project to the local replica, run

```
dfx deploy
Expand Down
2 changes: 1 addition & 1 deletion svelte-motoko-starter/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
}
},
"version": 1
}
}
3 changes: 3 additions & 0 deletions svelte-motoko-starter/src/frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
};
3 changes: 3 additions & 0 deletions svelte-motoko-starter/src/frontend/jest-env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { TextEncoder, TextDecoder } from 'util';
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
Loading