create-vitnode-app 0.0.7-canary.7 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/index.cjs +40 -22
- package/package.json +18 -7
- package/templates/basic/.gitignore_template +55 -0
- package/templates/basic/.npmrc_template +1 -0
- package/templates/basic/apps/backend/nest-cli.json +15 -0
- package/templates/basic/apps/backend/src/app.module.ts +23 -0
- package/templates/basic/apps/backend/src/database.ts +19 -0
- package/templates/basic/apps/backend/src/main.ts +27 -0
- package/templates/basic/apps/backend/src/plugins/plugins.module.ts +14 -0
- package/templates/basic/apps/backend/src/plugins/welcome/admin/admin.module.ts +4 -0
- package/templates/basic/apps/backend/src/plugins/welcome/admin/database/drizzle.config.ts +11 -0
- package/templates/basic/apps/backend/src/plugins/welcome/admin/database/functions.ts +6 -0
- package/templates/basic/apps/backend/src/plugins/welcome/admin/database/index.ts +1 -0
- package/templates/basic/apps/backend/src/plugins/welcome/config.json +10 -0
- package/templates/basic/apps/backend/src/plugins/welcome/versions.json +3 -0
- package/templates/basic/apps/backend/src/plugins/welcome/welcome.module.ts +8 -0
- package/templates/basic/apps/backend/tsconfig.build.json +4 -0
- package/templates/basic/apps/backend/tsconfig.json +14 -0
- package/templates/basic/apps/backend/uploads/index.html +0 -0
- package/templates/basic/apps/backend/uploads/private/index.html +0 -0
- package/templates/basic/apps/backend/uploads/public/index.html +0 -0
- package/templates/basic/apps/backend/uploads/temp/index.html +0 -0
- package/templates/basic/apps/frontend/app/[locale]/layout.tsx +13 -0
- package/templates/basic/apps/frontend/app/global.css +82 -0
- package/templates/basic/apps/frontend/app/layout.tsx +9 -0
- package/templates/basic/apps/frontend/i18n.ts +13 -0
- package/templates/basic/apps/frontend/middleware.ts +7 -0
- package/templates/basic/apps/frontend/next.config.mjs +6 -0
- package/templates/basic/apps/frontend/plugins/welcome/langs/en.json +5 -0
- package/templates/basic/apps/frontend/plugins/welcome/langs/pl.json +5 -0
- package/templates/basic/apps/frontend/plugins/welcome/templates/default-page.tsx +3 -0
- package/templates/basic/apps/frontend/postcss.config.mjs +9 -0
- package/templates/basic/apps/frontend/tailwind.config.ts +15 -0
- package/templates/basic/apps/frontend/tsconfig.json +19 -0
- package/templates/basic/tsconfig.json +4 -0
- package/templates/basic/turbo.json +27 -0
- package/templates/docker/docker-compose-dev.yml +35 -0
- package/templates/eslint/.prettierrc.mjs +11 -0
- package/templates/eslint/apps/backend/.eslintrc.json +5 -0
- package/templates/eslint/apps/frontend/.eslintrc.json +4 -0
- package/templates/install-dependencies.ts +53 -0
- package/templates/pnpm/pnpm-workspace.yaml +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vitnode-app",
|
|
3
|
-
"version": "0.0.7
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Create a new VitNode app in seconds.",
|
|
5
5
|
"author": "VitNode Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,13 +10,21 @@
|
|
|
10
10
|
"url": "git+https://github.com/aXenDeveloper/VitNode.git",
|
|
11
11
|
"directory": "packages/create-vitnode-app"
|
|
12
12
|
},
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
13
|
"type": "module",
|
|
17
14
|
"bin": {
|
|
18
15
|
"create-vitnode-app": "dist/index.cjs"
|
|
19
16
|
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"vitnode",
|
|
19
|
+
"react",
|
|
20
|
+
"next",
|
|
21
|
+
"nest",
|
|
22
|
+
"nextjs",
|
|
23
|
+
"nestjs",
|
|
24
|
+
"typescript",
|
|
25
|
+
"next.js",
|
|
26
|
+
"nest.js"
|
|
27
|
+
],
|
|
20
28
|
"dependencies": {
|
|
21
29
|
"figlet": "^1.7.0",
|
|
22
30
|
"picocolors": "^1.0.1",
|
|
@@ -24,14 +32,17 @@
|
|
|
24
32
|
"validate-npm-package-name": "^5.0.1"
|
|
25
33
|
},
|
|
26
34
|
"devDependencies": {
|
|
35
|
+
"@types/cross-spawn": "^6.0.6",
|
|
27
36
|
"@types/figlet": "^1.5.8",
|
|
28
|
-
"@types/node": "^20",
|
|
37
|
+
"@types/node": "^20.14.11",
|
|
29
38
|
"@types/prompts": "^2.4.9",
|
|
30
39
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
31
40
|
"commander": "^12.1.0",
|
|
41
|
+
"cross-spawn": "^7.0.3",
|
|
42
|
+
"ora": "^8.0.1",
|
|
32
43
|
"tsup": "^8.1.0",
|
|
33
|
-
"typescript": "^5",
|
|
34
|
-
"eslint-config-typescript-vitnode": "0.0.7
|
|
44
|
+
"typescript": "^5.5.3",
|
|
45
|
+
"eslint-config-typescript-vitnode": "0.0.7"
|
|
35
46
|
},
|
|
36
47
|
"scripts": {
|
|
37
48
|
"lint": "eslint .",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
node_modules
|
|
5
|
+
.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Local env files
|
|
9
|
+
.env
|
|
10
|
+
.env.local
|
|
11
|
+
.env.development.local
|
|
12
|
+
.env.test.local
|
|
13
|
+
.env.production.local
|
|
14
|
+
|
|
15
|
+
# Testing
|
|
16
|
+
coverage
|
|
17
|
+
|
|
18
|
+
# Turbo
|
|
19
|
+
.turbo
|
|
20
|
+
|
|
21
|
+
# Vercel
|
|
22
|
+
.vercel
|
|
23
|
+
|
|
24
|
+
# Build Outputs
|
|
25
|
+
.next/
|
|
26
|
+
out/
|
|
27
|
+
build
|
|
28
|
+
dist
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Debug
|
|
32
|
+
npm-debug.log*
|
|
33
|
+
yarn-debug.log*
|
|
34
|
+
yarn-error.log*
|
|
35
|
+
|
|
36
|
+
# Misc
|
|
37
|
+
.DS_Store
|
|
38
|
+
*.pem
|
|
39
|
+
|
|
40
|
+
# Docker
|
|
41
|
+
/docker
|
|
42
|
+
|
|
43
|
+
# Others
|
|
44
|
+
/apps/backend/uploads/public/*
|
|
45
|
+
/apps/backend/uploads/private/*
|
|
46
|
+
/apps/backend/uploads/temp/*
|
|
47
|
+
!/apps/backend/uploads/index.html
|
|
48
|
+
!/apps/backend/uploads/public/index.html
|
|
49
|
+
!/apps/backend/uploads/private/index.html
|
|
50
|
+
!/apps/backend/uploads/temp/index.html
|
|
51
|
+
/apps/backend/schema.gql
|
|
52
|
+
|
|
53
|
+
# Configuration
|
|
54
|
+
/apps/backend/src/plugins/*/admin/database/migrations
|
|
55
|
+
/apps/backend/src/plugins/core/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
package-manager-strict=false
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
+
"collection": "@nestjs/schematics",
|
|
4
|
+
"sourceRoot": "src",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"deleteOutDir": true,
|
|
7
|
+
"builder": {
|
|
8
|
+
"type": "swc",
|
|
9
|
+
"options": {
|
|
10
|
+
"extensions": [".ts", ".tsx"]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"typeCheck": true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
|
|
3
|
+
import { Module } from '@nestjs/common';
|
|
4
|
+
import { VitNodeCoreModule } from 'vitnode-backend';
|
|
5
|
+
|
|
6
|
+
import { PluginsModule } from './plugins/plugins.module';
|
|
7
|
+
import { DATABASE_ENVS, schemaDatabase } from './database';
|
|
8
|
+
|
|
9
|
+
@Module({
|
|
10
|
+
imports: [
|
|
11
|
+
VitNodeCoreModule.register({
|
|
12
|
+
paths: {
|
|
13
|
+
envFile: join(process.cwd(), '..', '..', '.env'),
|
|
14
|
+
},
|
|
15
|
+
database: {
|
|
16
|
+
config: DATABASE_ENVS,
|
|
17
|
+
schemaDatabase,
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
PluginsModule,
|
|
21
|
+
],
|
|
22
|
+
})
|
|
23
|
+
export class AppModule {}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!!
|
|
2
|
+
|
|
3
|
+
import tableCore from '@/plugins/core/admin/database/index';
|
|
4
|
+
import tableWelcome from '@/plugins/welcome/admin/database/index';
|
|
5
|
+
// ! === IMPORT ===
|
|
6
|
+
|
|
7
|
+
export const schemaDatabase = {
|
|
8
|
+
...tableWelcome,
|
|
9
|
+
// ! === MODULE ===
|
|
10
|
+
...tableCore,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const DATABASE_ENVS = {
|
|
14
|
+
host: process.env.DB_HOST || 'localhost',
|
|
15
|
+
port: process.env.DB_PORT ? +process.env.DB_PORT : 5432,
|
|
16
|
+
user: process.env.DB_USER || 'root',
|
|
17
|
+
password: process.env.DB_PASSWORD || 'root',
|
|
18
|
+
database: process.env.DB_DATABASE || 'vitnode',
|
|
19
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { NestFactory } from '@nestjs/core';
|
|
3
|
+
import { INestApplication } from '@nestjs/common';
|
|
4
|
+
import { nestjsMainApp } from 'vitnode-backend';
|
|
5
|
+
|
|
6
|
+
import { AppModule } from './app.module';
|
|
7
|
+
|
|
8
|
+
async function bootstrap() {
|
|
9
|
+
const app: INestApplication = await NestFactory.create(AppModule);
|
|
10
|
+
|
|
11
|
+
nestjsMainApp(app, {
|
|
12
|
+
cors: {
|
|
13
|
+
origin: [
|
|
14
|
+
process.env.NEXT_PUBLIC_FRONTEND_URL
|
|
15
|
+
? process.env.NEXT_PUBLIC_FRONTEND_URL
|
|
16
|
+
: 'http://localhost:3000',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
await app.listen(process.env.PORT ?? '8080', null, () => {
|
|
22
|
+
console.log(
|
|
23
|
+
`Application is running on: http://localhost:${process.env.PORT ?? 8080}/graphql`,
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
bootstrap();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!!
|
|
2
|
+
|
|
3
|
+
import { Module } from '@nestjs/common';
|
|
4
|
+
|
|
5
|
+
import { WelcomeModule } from './welcome/welcome.module';
|
|
6
|
+
// ! === IMPORT ===
|
|
7
|
+
|
|
8
|
+
@Module({
|
|
9
|
+
imports: [
|
|
10
|
+
WelcomeModule,
|
|
11
|
+
// ! === MODULE ===
|
|
12
|
+
],
|
|
13
|
+
})
|
|
14
|
+
export class PluginsModule {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!!
|
|
2
|
+
import { defineConfig } from 'drizzle-kit';
|
|
3
|
+
|
|
4
|
+
import { DATABASE_ENVS } from '@/database';
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
dialect: 'postgresql',
|
|
8
|
+
dbCredentials: DATABASE_ENVS,
|
|
9
|
+
schema: './plugins/welcome/admin/database/schema/*.ts',
|
|
10
|
+
out: './plugins/welcome/admin/database/migrations/',
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Welcome",
|
|
3
|
+
"description": "Basic plugin with default page.",
|
|
4
|
+
"code": "welcome",
|
|
5
|
+
"author": "VitNode",
|
|
6
|
+
"author_url": "https://vitnode.com/",
|
|
7
|
+
"support_url": "https://github.com/aXenDeveloper/vitnode/issues",
|
|
8
|
+
"allow_default": true,
|
|
9
|
+
"nav": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "eslint-config-typescript-vitnode/tsconfig.nest.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"baseUrl": "./",
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@/*": ["./src/*", "./node_modules/vitnode-backend/dist/*"]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"exclude": ["uploads"]
|
|
14
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GeistSans } from 'geist/font/sans';
|
|
3
|
+
import {
|
|
4
|
+
RootLayout,
|
|
5
|
+
RootLayoutProps,
|
|
6
|
+
generateMetadataRootLayout,
|
|
7
|
+
} from 'vitnode-frontend/views/layout/root-layout';
|
|
8
|
+
|
|
9
|
+
export const generateMetadata = generateMetadataRootLayout;
|
|
10
|
+
|
|
11
|
+
export default function Layout(props: RootLayoutProps) {
|
|
12
|
+
return <RootLayout className={GeistSans.className} {...props} />;
|
|
13
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@tailwind components;
|
|
2
|
+
@tailwind utilities;
|
|
3
|
+
@tailwind base;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
* {
|
|
7
|
+
@apply border-border;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
@apply bg-background text-foreground;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
a {
|
|
15
|
+
@apply text-primary;
|
|
16
|
+
@apply cursor-pointer;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:root {
|
|
20
|
+
--background: 220 40% 98%;
|
|
21
|
+
--foreground: 213deg 5% 8%;
|
|
22
|
+
--card: 220 40% 100%;
|
|
23
|
+
--card-foreground: 213deg 26% 7%;
|
|
24
|
+
--popover: var(--card);
|
|
25
|
+
--popover-foreground: var(--card-foreground);
|
|
26
|
+
--primary: 220 74% 50%;
|
|
27
|
+
--primary-foreground: 220 40% 98%;
|
|
28
|
+
--secondary: 0 0% 100%;
|
|
29
|
+
--secondary-foreground: 210 40% 2%;
|
|
30
|
+
--muted: 220 40% 96%;
|
|
31
|
+
--muted-foreground: 220 8% 44%;
|
|
32
|
+
--accent: 220 40% 92%;
|
|
33
|
+
--accent-foreground: 222 47% 11%;
|
|
34
|
+
--destructive: 0 57% 43%;
|
|
35
|
+
--destructive-foreground: 210 40% 98%;
|
|
36
|
+
--border: 220 20% 90%;
|
|
37
|
+
--input: var(--border);
|
|
38
|
+
--ring: var(--primary);
|
|
39
|
+
--radius: 0.5rem;
|
|
40
|
+
--cover: 220 80% 67%;
|
|
41
|
+
--cover-foreground: 210 40% 98%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dark {
|
|
45
|
+
--background: 216 32% 7%;
|
|
46
|
+
--foreground: 0 0% 98%;
|
|
47
|
+
--card: 216 32% 10%;
|
|
48
|
+
--card-foreground: 0 0% 98%;
|
|
49
|
+
/* --popover: var(--card); */
|
|
50
|
+
/* --popover-foreground: var(--card-foreground); */
|
|
51
|
+
--primary: 216 84% 59%;
|
|
52
|
+
--primary-foreground: 216 40% 98%;
|
|
53
|
+
--secondary: 222 25% 18%;
|
|
54
|
+
--secondary-foreground: 0 0% 98%;
|
|
55
|
+
--muted: 216 32% 11%;
|
|
56
|
+
--muted-foreground: 216 18% 64%;
|
|
57
|
+
--accent: 216 32% 14%;
|
|
58
|
+
--accent-foreground: 0 0% 98%;
|
|
59
|
+
--destructive: 359 78% 55%;
|
|
60
|
+
--destructive-foreground: 210 40% 98%;
|
|
61
|
+
--border: 216 25% 16%;
|
|
62
|
+
/* --input: var(--border); */
|
|
63
|
+
/* --ring: var(--primary); */
|
|
64
|
+
--cover: 216 64% 39%;
|
|
65
|
+
--cover-foreground: 210 40% 98%;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@layer utilities {
|
|
70
|
+
.underline-strike-through {
|
|
71
|
+
text-decoration: underline line-through;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.no-scrollbar {
|
|
75
|
+
-ms-overflow-style: none;
|
|
76
|
+
scrollbar-width: none;
|
|
77
|
+
|
|
78
|
+
&::-webkit-scrollbar {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getRequestConfig } from 'next-intl/server';
|
|
2
|
+
import { i18nConfig } from 'vitnode-frontend/i18n';
|
|
3
|
+
|
|
4
|
+
export default getRequestConfig(async args => {
|
|
5
|
+
const config = await i18nConfig({
|
|
6
|
+
...args,
|
|
7
|
+
pathsToMessagesFromPlugins: async ({ plugin, locale }) => {
|
|
8
|
+
return import(`./plugins/${plugin}/langs/${locale}.json`);
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
return config;
|
|
13
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss';
|
|
2
|
+
import vitnodeConfig from 'vitnode-frontend/tailwind.config';
|
|
3
|
+
|
|
4
|
+
const config = {
|
|
5
|
+
presets: [vitnodeConfig],
|
|
6
|
+
content: [
|
|
7
|
+
'../../node_modules/vitnode-frontend/src/components/**/*.tsx',
|
|
8
|
+
'../../node_modules/vitnode-frontend/src/views/**/*.tsx',
|
|
9
|
+
'./components/**/*.{ts,tsx}',
|
|
10
|
+
'./app/**/*.{ts,tsx}',
|
|
11
|
+
'./plugins/templates/**/*.{ts,tsx}',
|
|
12
|
+
],
|
|
13
|
+
} satisfies Config;
|
|
14
|
+
|
|
15
|
+
export default config;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "eslint-config-typescript-vitnode/tsconfig.next.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ES2022",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"baseUrl": "./",
|
|
8
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
9
|
+
"plugins": [
|
|
10
|
+
{
|
|
11
|
+
"name": "next"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"paths": {
|
|
15
|
+
"@/*": ["./*"]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"tasks": {
|
|
4
|
+
"build": {
|
|
5
|
+
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
|
|
6
|
+
"dependsOn": ["^build"]
|
|
7
|
+
},
|
|
8
|
+
"start": {
|
|
9
|
+
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
|
|
10
|
+
"dependsOn": ["^start"],
|
|
11
|
+
"persistent": true
|
|
12
|
+
},
|
|
13
|
+
"config:init": {
|
|
14
|
+
"dependsOn": ["^config:init"]
|
|
15
|
+
},
|
|
16
|
+
"lint": {
|
|
17
|
+
"dependsOn": ["^lint"]
|
|
18
|
+
},
|
|
19
|
+
"lint:fix": {
|
|
20
|
+
"dependsOn": ["^lint:fix"]
|
|
21
|
+
},
|
|
22
|
+
"dev": {
|
|
23
|
+
"cache": false,
|
|
24
|
+
"persistent": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
database:
|
|
5
|
+
container_name: vitnode_postgres_development
|
|
6
|
+
image: postgres:16.3-alpine
|
|
7
|
+
restart: unless-stopped
|
|
8
|
+
environment:
|
|
9
|
+
POSTGRES_USER: ${DB_USER-root}
|
|
10
|
+
POSTGRES_PASSWORD: ${DB_PASSWORD-root}
|
|
11
|
+
POSTGRES_DB: vitnode
|
|
12
|
+
command: ['postgres', '-c', 'log_statement=all'] # log all sql queries
|
|
13
|
+
volumes:
|
|
14
|
+
- ./docker/dev/database:/var/lib/postgresql/data
|
|
15
|
+
ports:
|
|
16
|
+
- '5432:5432'
|
|
17
|
+
networks:
|
|
18
|
+
- vitnode_dev
|
|
19
|
+
|
|
20
|
+
pgadmin:
|
|
21
|
+
container_name: vitnode_pgadmin_development
|
|
22
|
+
image: dpage/pgadmin4:latest
|
|
23
|
+
restart: unless-stopped
|
|
24
|
+
environment:
|
|
25
|
+
PGADMIN_DEFAULT_EMAIL: admin@admin.com
|
|
26
|
+
PGADMIN_DEFAULT_PASSWORD: admin
|
|
27
|
+
ports:
|
|
28
|
+
- '5050:80'
|
|
29
|
+
depends_on:
|
|
30
|
+
- database
|
|
31
|
+
networks:
|
|
32
|
+
- vitnode_dev
|
|
33
|
+
|
|
34
|
+
networks:
|
|
35
|
+
vitnode_dev:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import vitnodePrettier from "eslint-config-typescript-vitnode/prettierrc.mjs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @see https://prettier.io/docs/en/configuration.html
|
|
5
|
+
* @type {import("prettier").Config}
|
|
6
|
+
*/
|
|
7
|
+
const config = {
|
|
8
|
+
...vitnodePrettier,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default config;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import color from 'picocolors';
|
|
2
|
+
import spawn from 'cross-spawn';
|
|
3
|
+
|
|
4
|
+
import { CreateCliReturn } from '../cli';
|
|
5
|
+
import { getOnline } from '../helpers/is-online';
|
|
6
|
+
|
|
7
|
+
export const installDependencies = async ({
|
|
8
|
+
packageManager: pm,
|
|
9
|
+
}: Pick<CreateCliReturn, 'packageManager'>) => {
|
|
10
|
+
const packageManager = pm.split('@')[0];
|
|
11
|
+
const isOnline = await getOnline();
|
|
12
|
+
const args: string[] =
|
|
13
|
+
packageManager === 'npm' ? ['install', '--force'] : ['install'];
|
|
14
|
+
|
|
15
|
+
if (!isOnline) {
|
|
16
|
+
console.log(
|
|
17
|
+
color.yellow(
|
|
18
|
+
'You appear to be offline.\nFalling back to the local cache.',
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
args.push('--offline');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Return a Promise that resolves once the installation is finished.
|
|
26
|
+
*/
|
|
27
|
+
return new Promise<void>((resolve, reject) => {
|
|
28
|
+
/**
|
|
29
|
+
* Spawn the installation process.
|
|
30
|
+
*/
|
|
31
|
+
const child = spawn(packageManager, args, {
|
|
32
|
+
stdio: 'ignore', // Change 'inherit' to 'ignore'
|
|
33
|
+
env: {
|
|
34
|
+
...process.env,
|
|
35
|
+
ADBLOCK: '1',
|
|
36
|
+
// we set NODE_ENV to development as pnpm skips dev
|
|
37
|
+
// dependencies when production
|
|
38
|
+
NODE_ENV: 'development',
|
|
39
|
+
DISABLE_OPENCOLLECTIVE: '1',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
child.on('close', code => {
|
|
43
|
+
if (code !== 0) {
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
45
|
+
reject({ command: `${packageManager} ${args.join(' ')}` });
|
|
46
|
+
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
resolve();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
};
|