Skip to content

Commit

Permalink
chore: update templates formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
realdreamer committed Nov 10, 2023
1 parent eebd987 commit a0923e2
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 79 deletions.
27 changes: 6 additions & 21 deletions templates/angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,10 @@
"outputPath": "dist/angular",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -77,18 +70,10 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
}
}
Expand Down
5 changes: 3 additions & 2 deletions templates/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular",
"private": true,
"version": "0.0.0",
"private": true,
"description": "Angular starter project with @kadena/client integration",
"repository": {
"type": "git",
Expand All @@ -11,7 +11,7 @@
"license": "ISC",
"scripts": {
"build": "ng build",
"format": "prettier --write src/",
"format": "prettier --write .",
"ng": "ng",
"pactjs:generate:contracts": "pactjs contract-generate --file ./pact/message-store.pact; pactjs contract-generate --file ./pact/root/coin-v5.pact",
"start": "ng serve",
Expand Down Expand Up @@ -55,3 +55,4 @@
"typescript": "~5.2.2"
}
}

8 changes: 2 additions & 6 deletions templates/angular/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"outDir": "./out-tsc/app",
"types": ["node"]
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"]
}
9 changes: 2 additions & 7 deletions templates/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": [
"ES2022",
"dom"
],
"lib": ["ES2022", "dom"],
"types": [".kadena/pactjs-generated"]
},
"angularCompilerOptions": {
Expand All @@ -33,7 +30,5 @@
"strictInputAccessModifiers": true,
"strictTemplates": true
},
"include": [
"src/**/*.ts"
],
"include": ["src/**/*.ts"]
}
5 changes: 1 addition & 4 deletions templates/angular/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@
"outDir": "./out-tsc/spec",
"types": ["jasmine", "node", ".kadena/pactjs-generated"]
},
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
}
4 changes: 1 addition & 3 deletions templates/common/utils/readMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ interface ReadMessageParams {
account: string;
}

export default async function readMessage({
account,
}: ReadMessageParams): Promise<string> {
export default async function readMessage({ account }: ReadMessageParams): Promise<string> {
try {
const transactionBuilder = Pact.builder
.execution(
Expand Down
17 changes: 3 additions & 14 deletions templates/common/utils/writeMessage.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import {
Pact,
createClient,
isSignedTransaction,
signWithChainweaver,
} from '@kadena/client';
import type { ICommandResult } from '@kadena/client';
import { Pact, createClient, isSignedTransaction, signWithChainweaver } from '@kadena/client';

import { API_HOST, CHAIN_ID, NETWORK_ID } from './consts';
import getAccountKey from './getAccountKey';
Expand All @@ -14,18 +9,12 @@ interface IWriteMessage {
messageToWrite: string;
}

export default async function writeMessage({
account,
messageToWrite,
}: IWriteMessage): Promise<ICommandResult> {
export default async function writeMessage({ account, messageToWrite }: IWriteMessage): Promise<ICommandResult> {
try {
const transactionBuilder = Pact.builder
.execution(
// @ts-ignore
Pact.modules['free.cka-message-store']['write-message'](
account,
messageToWrite,
),
Pact.modules['free.cka-message-store']['write-message'](account, messageToWrite),
)
.addSigner(getAccountKey(account), (withCapability) => [
withCapability('coin.GAS'),
Expand Down
3 changes: 2 additions & 1 deletion templates/vuejs/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"proseWrap": "always"
"proseWrap": "always",
"plugins": ["prettier-plugin-packagejson"]
}
2 changes: 1 addition & 1 deletion templates/vuejs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
40 changes: 21 additions & 19 deletions templates/vuejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,47 @@
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"test:ci": "vitest run",
"build-only": "vite build",
"pactjs:generate:contracts": "pactjs contract-generate --file ./pact/message-store.pact; pactjs contract-generate --file ./pact/root/coin-v5.pact",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"dev": "vite",
"format": "prettier --write .",
"lint": "eslint .",
"format": "prettier --write src/"
"pactjs:generate:contracts": "pactjs contract-generate --file ./pact/message-store.pact; pactjs contract-generate --file ./pact/root/coin-v5.pact",
"preview": "vite preview",
"test:ci": "vitest run",
"test:unit": "vitest",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false"
},
"dependencies": {
"@kadena/client": "^1.5.0",
"@kadena/client": "^1.6.2",
"@testing-library/jest-dom": "^6.1.4",
"epic-spinners": "^2.0.0",
"vue": "^3.3.4",
"vue": "^3.3.8",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@kadena/pactjs-cli": "^1.5.0",
"@rushstack/eslint-patch": "^1.3.3",
"@kadena/pactjs-cli": "^1.6.1",
"@rushstack/eslint-patch": "^1.5.1",
"@testing-library/vue": "^8.0.0",
"@tsconfig/node18": "^18.2.2",
"@types/jsdom": "^21.1.3",
"@types/node": "^18.18.5",
"@vitejs/plugin-vue": "^4.4.0",
"@types/jsdom": "^21.1.5",
"@types/node": "^20.9.0",
"@vitejs/plugin-vue": "^4.4.1",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.49.0",
"eslint-plugin-vue": "^9.17.0",
"eslint": "^8.53.0",
"eslint-plugin-vue": "^9.18.1",
"jsdom": "^22.1.0",
"npm-run-all2": "^6.1.1",
"prettier": "^3.0.3",
"typescript": "~5.2.0",
"vite": "^4.4.11",
"prettier-plugin-packagejson": "^2.4.6",
"typescript": "~5.2.2",
"vite": "^4.5.0",
"vitest": "^0.34.6",
"vue-tsc": "^1.8.19"
"vue-tsc": "^1.8.22"
}
}

2 changes: 1 addition & 1 deletion templates/vuejs/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "custom.d.ts", "src/**/*", "src/**/*.vue", "vitest.setup.ts",],
"include": ["env.d.ts", "custom.d.ts", "src/**/*", "src/**/*.vue", "vitest.setup.ts"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
Expand Down

0 comments on commit a0923e2

Please sign in to comment.