Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[*.{js,jsx,ts,tsx,vue}]
[*.{js,ts,vue}]
indent_style = space
indent_size = 4
end_of_line = lf
Expand Down
74 changes: 0 additions & 74 deletions .eslintrc.js

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check

on:
- push

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
cache: yarn

- name: Install dependencies
run: yarn --immutable

- name: Typecheck
run: yarn typecheck

- name: Lint
run: yarn lint

- name: Build
run: yarn build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.tsbuildinfo

# Editor directories and files
.idea
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Nimiq
Copyright (c) 2026 Nimiq

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,11 @@

Feel free to use the code and send PRs to improve it!

You can find all the details on how to join the Nimiq Community and talk with devs, traders, and fellow Nimions [here](https://nimiq.com/community).
You can find all the details on how to join the Nimiq Community and talk with devs, traders, and fellow Nimions
[here](https://nimiq.com/community).

New to Nimiq? Check out [nimiq.com](https://nimiq.com).

## How to compile and run the code locally

This app was built with this the [Nimiq App Starter Kit](https://github.com/nimiq/app-starter-kit). It's using Vue.js, TypeScript, Pug, Stylus, and a bit of magic.

### Basic Setup

Add the app starter kit to your project:
```bash
git remote add starter-kit git@github.com:nimiq/app-starter-kit.git
git fetch starter-kit
```

Then merge it into your code base:
```bash
git merge --allow-unrelated-histories starter-kit/master
```

## Build and run

To get started, setup everything and get all dependencies with yarn:
Expand All @@ -37,13 +21,13 @@ Run a development server that watches the project files,
compiles them on demand and hot-reloads the changes to keep your browser in sync:

```bash
yarn serve
yarn dev
```

Lint your code and automatically fix lint errors:

```bash
yarn lint
yarn lint:fix
```

Compile and minify the project to be ready for deployment in production:
Expand Down
5 changes: 0 additions & 5 deletions babel.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import type { DefineComponent } from 'vue';

// eslint-disable-next-line ts/no-empty-object-type
const component: DefineComponent<{}, {}, any>;
export default component;
}
22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import antfu from '@antfu/eslint-config';

export default antfu({
vue: true,
ignores: ['public/**'],
}, {
rules: {
'style/semi': ['error', 'always'],
'style/indent': ['error', 4],
'ts/consistent-type-definitions': ['error', 'type'],
'style/arrow-parens': ['error', 'always'],
'style/member-delimiter-style': ['error', {
multiline: {
delimiter: 'comma',
requireLast: true,
},
}],
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'style/max-len': ['error', { code: 120, ignoreStrings: true, ignoreTemplateLiterals: true, ignoreComments: true }],
'no-console': 'off',
},
});
51 changes: 51 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link href="blocking.css" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="96x96" href="favicon-96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<title>Nimiq Vote</title>
<script>
Object.defineProperty(window, 'Uint8Array', {
writable: false,
configurable: false,
});
</script>
<script type="text/javascript" src="browser-warning.js"></script>
</head>
<body class="nimiq-style">
<div id="testnet-warning" class="nq-gold-bg" style="display: none">
<div class="close"></div>
You are connecting to the Nimiq Testnet. Please
<strong>do not</strong>
use your Mainnet accounts in the Testnet!
</div>
<header class="logo">
<span class="nq-icon nimiq-logo"></span>
<span class="logo-wordmark">Nimiq</span>
<span class="logo-subtitle">Vote</span>
</header>
<div id="app">
<noscript id="browser-warning-container">
<div id="browser-warning">
<h1 id="browser-warning-headline">Please enable JavaScript</h1>
<div id="browser-warning-message">
We're sorry, but this app doesn't work properly without JavaScript enabled. Please enable it to continue.
</div>
</div>
<style>.hide-on-browser-warning{display:none!important}</style>
</noscript>
</div>
<footer>
<a href="https://www.nimiq.com/" target="_blank">Powered by Nimiq</a>
</footer>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
3 changes: 0 additions & 3 deletions jest.config.js

This file was deleted.

55 changes: 20 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,37 @@
{
"name": "nimiq-voting-app",
"type": "module",
"version": "0.1.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint --fix"
"dev": "vite",
"typecheck": "vue-tsc --noEmit",
"build": "vue-tsc -b && vite build",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@nimiq/browser-warning": "^1.1.0",
"@nimiq/core": "^2.2.1",
"@nimiq/hub-api": "^1.2.3",
"@nimiq/style": "^0.8.5",
"@nimiq/utils": "^0.12.4",
"@nimiq/vue-components": "https://github.com/nimiq/vue-components.git#build/vote",
"@types/string-hash": "^1.1.1",
"@types/vuedraggable": "^2.23.0",
"core-js": "^3.6.4",
"@nimiq/vue3-components": "github:nimiq/vue3-components#build/vote",
"distinct-colors": "^2.1.0",
"string-hash": "^1.1.3",
"vue": "^2.6.11",
"vue-class-component": "^7.2.2",
"vue-property-decorator": "^8.3.0",
"vuedraggable": "^2.23.2"
"vue": "^3.5.13",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@types/jest": "^24.0.19",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-eslint": "~4.2.0",
"@vue/cli-plugin-typescript": "~4.2.0",
"@vue/cli-plugin-unit-jest": "~4.2.0",
"@vue/cli-service": "~4.2.0",
"@vue/eslint-config-airbnb": "^5.0.2",
"@vue/eslint-config-typescript": "^5.0.1",
"@vue/test-utils": "1.0.0-beta.31",
"copy-webpack-plugin": "^5.1.1",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-vue": "^6.1.2",
"node-sass": "^9.0.0",
"pug": "^3.0.1",
"pug-plain-loader": "^1.0.0",
"sass-loader": "^8.0.2",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"typescript": "~3.7.5",
"vue-template-compiler": "^2.6.11"
"@antfu/eslint-config": "^7.2.0",
"@types/string-hash": "^1.1.1",
"@vitejs/plugin-vue": "^5.2.0",
"eslint": "^9.39.2",
"typescript": "^5.7.0",
"vite": "^6.0.0",
"vite-plugin-static-copy": "^2.2.0",
"vite-plugin-top-level-await": "^1.6.0",
"vite-plugin-wasm": "^3.5.0",
"vue-tsc": "^2.2.0"
}
}
52 changes: 0 additions & 52 deletions public/index.html

This file was deleted.

Loading