build: add lint, formatting, and npm scripts

main
Carsten Kragelund 2023-07-29 15:51:56 +02:00
parent a8000cd0f3
commit 748346fa6e
Signed by: nyx
GPG Key ID: CADDADEEC9F753C0
12 changed files with 5264 additions and 4590 deletions

@ -0,0 +1,24 @@
root = true
[*]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 80
[*.rs]
indent_size = 4
max_line_length = 100
[justfile]
indent_size = 4
[pages/api/bindings.ts]
charset = unset
insert_final_newline = unset
end_of_line = unset
indent_style = unset
indent_size = unset
max_line_length = unset

@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "prettier"]
}

@ -0,0 +1,40 @@
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
# rust
target
Cargo.lock
# rapid build output
pages/api/bindings.ts

@ -0,0 +1,8 @@
{
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}

@ -4,7 +4,6 @@ version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures-util = "0.3.28"
include_dir = "0.7.3"

@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
};
module.exports = nextConfig
module.exports = nextConfig;

9623
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,29 +1,45 @@
{
"name": "rapid-nextjs-testing",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@rapid-web/react": "^0.2.4",
"@types/node": "20.4.2",
"@types/react": "18.2.15",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.14",
"eslint": "8.45.0",
"eslint-config-next": "13.4.10",
"next": "13.4.10",
"postcss": "8.4.26",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
},
"devDependencies": {
"@rapid-web/ui": "^0.2.2"
}
"name": "rapid-nextjs-testing",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "concurrently npm:dev@rapid npm:dev@next",
"dev@rapid": "rapid run",
"dev@next": "next dev",
"lint": "npm run lint@js && npm run lint@rust",
"lint@js": "eslint . --ext .js,.ts,.jsx,.tsx",
"lint@rust": "cargo clippy --all-targets --all-features -- -D warnings",
"format": "npm run format@js && npm run format@rust",
"format@js": "prettier --write --ignore-unknown --no-error-on-unmatched-pattern .",
"format@rust": "cargo fmt --all",
"format-check": "npm run format-check@js && npm run format-check@rust",
"format-check@js": "prettier --check --ignore-unknown --no-error-on-unmatched-pattern .",
"format-check@rust": "cargo fmt --all --check",
"clean": "npm run clean@js && npm run clean@rust",
"clean@js": "rimraf node_modules && rimraf .next",
"clean@rust": "cargo clean"
},
"dependencies": {
"@rapid-web/react": "^0.2.4",
"@types/node": "20.4.2",
"@types/react": "18.2.15",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.14",
"eslint": "8.45.0",
"eslint-config-next": "13.4.10",
"next": "13.4.10",
"postcss": "8.4.26",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
},
"devDependencies": {
"@rapid-web/ui": "^0.2.2",
"concurrently": "^8.2.0",
"eslint-config-prettier": "^8.9.0",
"prettier": "^2.8.8",
"prettier-plugin-toml": "^0.3.1",
"rimraf": "^5.0.1"
}
}

@ -1,6 +1,6 @@
use rapid_web::server::RapidServer;
use rapid_web::actix::HttpServer;
use rapid_web::rapid_web_codegen::{main, routes, rapid_configure_nextjs};
use rapid_web::rapid_web_codegen::{main, rapid_configure_nextjs, routes};
use rapid_web::server::RapidServer;
rapid_configure_nextjs!();
@ -8,9 +8,8 @@ rapid_configure_nextjs!();
async fn main() -> std::io::Result<()> {
let app = RapidServer::create(None, None);
app.listen(HttpServer::new(move || {
RapidServer::fs_router(None, None, routes!("pages/api/routes"))
})).await
}))
.await
}

@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

@ -1,27 +1,27 @@
import type { Config } from 'tailwindcss';
import type { Config } from "tailwindcss";
import {
rapidStylesPath,
rapidTailwindTheme,
rapidPlugin,
} from '@rapid-web/ui';
rapidStylesPath,
rapidTailwindTheme,
rapidPlugin,
} from "@rapid-web/ui";
// Use this as your template paths directory if using nextjs app dir: "./app/**/*.{js,ts,jsx,tsx,mdx}",
export default {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
rapidStylesPath,
],
theme: {
extend: rapidTailwindTheme({
// Extend the default rapid tailwind theme here (documentation coming soon)
}),
},
plugins: [
rapidPlugin({
// Configure global styles variants here (documentation coming soon)
global: {},
}),
],
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
rapidStylesPath,
],
theme: {
extend: rapidTailwindTheme({
// Extend the default rapid tailwind theme here (documentation coming soon)
}),
},
plugins: [
rapidPlugin({
// Configure global styles variants here (documentation coming soon)
global: {},
}),
],
} satisfies Config;

@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@ -19,9 +15,7 @@
"jsx": "preserve",
"incremental": true,
"paths": {
"@/*": [
"./*"
]
"@/*": ["./*"]
},
"plugins": [
{
@ -29,13 +23,6 @@
}
]
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}