Skip to content

Commit 7274ed8

Browse files
committed
add: project14 start
1 parent 513229c commit 7274ed8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3084
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 jacobcreech
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"extends": ["../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["*.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nx/dependency-checks": [
22+
"error",
23+
{
24+
"ignoredFiles": ["{projectRoot}/rollup.config.{js,ts,mjs,mts}"]
25+
}
26+
]
27+
}
28+
}
29+
]
30+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"jsc": {
3+
"target": "es2017",
4+
"parser": {
5+
"syntax": "typescript",
6+
"decorators": true,
7+
"dynamicImport": true
8+
},
9+
"transform": {
10+
"decoratorMetadata": true,
11+
"legacyDecorator": true
12+
},
13+
"keepClassNames": true,
14+
"externalHelpers": true,
15+
"loose": true
16+
},
17+
"module": {
18+
"type": "es6"
19+
},
20+
"sourceMaps": true,
21+
"exclude": [
22+
"jest.config.ts",
23+
".*\\.spec.tsx?$",
24+
".*\\.test.tsx?$",
25+
"./src/jest-setup.ts$",
26+
"./**/jest-setup.ts$",
27+
".*.js$"
28+
]
29+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[toolchain]
2+
3+
[features]
4+
seeds = false
5+
skip-lint = false
6+
7+
[programs.localnet]
8+
voting = "HDxHrQL4N5GaBo19UjEF3sypkrGiDijjuGyQXBNhnrKB"
9+
10+
[registry]
11+
url = "https://api.apr.dev"
12+
13+
[provider]
14+
cluster = "Localnet"
15+
wallet = "~/.config/solana/id.json"
16+
17+
[scripts]
18+
test = "../node_modules/.bin/nx run anchor:jest"
19+
20+
[test]
21+
startup_wait = 5000
22+
shutdown_wait = 2000
23+
upgradeable = false
24+
25+
[test.validator]
26+
bind_address = "127.0.0.1"
27+
ledger = ".anchor/test-ledger"
28+
rpc_port = 8899
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[workspace]
2+
members = ["programs/*"]
3+
resolver = "2"
4+
[profile.release]
5+
overflow-checks = true
6+
lto = "fat"
7+
codegen-units = 1
8+
9+
[profile.release.build-override]
10+
opt-level = 3
11+
incremental = false
12+
codegen-units = 1
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# anchor
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Building
6+
7+
Run `nx build anchor` to build the library.
8+
9+
## Running unit tests
10+
11+
Run `nx test anchor` to execute the unit tests via [Jest](https://jestjs.io).
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* eslint-disable */
2+
import { readFileSync } from 'fs';
3+
4+
// Reading the SWC compilation config and remove the "exclude"
5+
// for the test files to be compiled by SWC
6+
const { exclude: _, ...swcJestConfig } = JSON.parse(
7+
readFileSync(`${__dirname}/.swcrc`, 'utf-8')
8+
);
9+
10+
// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves.
11+
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude"
12+
if (swcJestConfig.swcrc === undefined) {
13+
swcJestConfig.swcrc = false;
14+
}
15+
16+
// Uncomment if using global setup/teardown files being transformed via swc
17+
// https://nx.dev/packages/jest/documents/overview#global-setup/teardown-with-nx-libraries
18+
// jest needs EsModule Interop to find the default exported setup/teardown functions
19+
// swcJestConfig.module.noInterop = false;
20+
21+
export default {
22+
displayName: 'anchor',
23+
preset: '../jest.preset.js',
24+
transform: {
25+
'^.+\\.[tj]s$': ['@swc/jest', swcJestConfig],
26+
},
27+
moduleFileExtensions: ['ts', 'js', 'html'],
28+
testEnvironment: '',
29+
coverageDirectory: '../coverage/anchor',
30+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Migrations are an early feature. Currently, they're nothing more than this
2+
// single deploy script that's invoked from the CLI, injecting a provider
3+
// configured from the workspace's Anchor.toml.
4+
5+
import * as anchor from '@coral-xyz/anchor';
6+
7+
module.exports = async function (provider) {
8+
// Configure client to use the provider.
9+
anchor.setProvider(provider);
10+
11+
// Add your deploy script here.
12+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@voting-dapp/anchor",
3+
"version": "0.0.1",
4+
"dependencies": {
5+
"@coral-xyz/anchor": "^0.30.0",
6+
"@solana/web3.js": "1.91.9",
7+
"anchor-bankrun": "^0.4.0"
8+
},
9+
"main": "./index.cjs",
10+
"module": "./index.js",
11+
"private": true
12+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "voting"
3+
version = "0.1.0"
4+
description = "Created with Anchor"
5+
edition = "2021"
6+
7+
[lib]
8+
crate-type = ["cdylib", "lib"]
9+
name = "voting"
10+
11+
[features]
12+
no-entrypoint = []
13+
no-idl = []
14+
no-log-ix-name = []
15+
cpi = ["no-entrypoint"]
16+
default = []
17+
idl-build = ["anchor-lang/idl-build"]
18+
19+
[dependencies]
20+
anchor-lang = "0.30.1"

0 commit comments

Comments
 (0)