@robgietema/generator-nick 0.0.11 → 0.0.13
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/generators/app/index.js
CHANGED
|
@@ -106,20 +106,9 @@ Run "npm install -g @robgietema/generator-nick" to update.`,
|
|
|
106
106
|
this.fs.delete(this.destinationPath(base, '.gitignorefile'));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
async install() {
|
|
110
|
-
if (!this.opts['skip-install']) {
|
|
111
|
-
const base =
|
|
112
|
-
currentDir === this.globals.projectName
|
|
113
|
-
? '.'
|
|
114
|
-
: this.globals.projectName;
|
|
115
|
-
await exec(`pnpm install --cwd ${base}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
109
|
end() {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
`
|
|
110
|
+
this.log(
|
|
111
|
+
`
|
|
123
112
|
Done.
|
|
124
113
|
|
|
125
114
|
Now install and run Postgres and setup the database by entering the following in your Postgres console:
|
|
@@ -127,29 +116,14 @@ Now install and run Postgres and setup the database by entering the following in
|
|
|
127
116
|
$ CREATE DATABASE "${this.globals.projectName}";
|
|
128
117
|
$ CREATE USER "${this.globals.projectName}" WITH ENCRYPTED PASSWORD '${this.globals.projectName}';
|
|
129
118
|
$ GRANT ALL PRIVILEGES ON DATABASE "${this.globals.projectName}" TO "${this.globals.projectName}";
|
|
119
|
+
$ ALTER DATABASE "${this.globals.projectName}" OWNER TO "${this.globals.projectName}";
|
|
120
|
+
$ GRANT ALL ON SCHEMA public TO "${this.globals.projectName}";
|
|
130
121
|
|
|
131
122
|
Now go to the ${this.globals.projectName} folder and run:
|
|
132
123
|
|
|
133
124
|
pnpm bootstrap
|
|
134
125
|
pnpm start
|
|
135
126
|
`,
|
|
136
|
-
|
|
137
|
-
} else {
|
|
138
|
-
this.log(`
|
|
139
|
-
Done.
|
|
140
|
-
|
|
141
|
-
Now install and run Postgres and setup the database by entering the following in your Postgres console:
|
|
142
|
-
|
|
143
|
-
$ CREATE DATABASE "${this.globals.projectName}";
|
|
144
|
-
$ CREATE USER "${this.globals.projectName}" WITH ENCRYPTED PASSWORD '${this.globals.projectName}';
|
|
145
|
-
$ GRANT ALL PRIVILEGES ON DATABASE "${this.globals.projectName}" TO "${this.globals.projectName}";
|
|
146
|
-
|
|
147
|
-
Now go to the ${this.globals.projectName} folder and run:
|
|
148
|
-
|
|
149
|
-
pnpm install
|
|
150
|
-
pnpm bootstrap
|
|
151
|
-
pnpm start
|
|
152
|
-
`);
|
|
153
|
-
}
|
|
127
|
+
);
|
|
154
128
|
}
|
|
155
129
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { fileURLToPath } from 'url';
|
|
2
|
+
import path from 'path';
|
|
1
3
|
import events from './src/events';
|
|
2
4
|
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
3
7
|
export const config = {
|
|
4
8
|
connection: {
|
|
5
9
|
port: 5432,
|
|
@@ -9,7 +13,7 @@ export const config = {
|
|
|
9
13
|
password: '<%= projectName %>',
|
|
10
14
|
},
|
|
11
15
|
blobsDir: `${__dirname}/var/blobstorage`,
|
|
12
|
-
localesDir: `${__dirname}/locales`,
|
|
16
|
+
localesDir: `${__dirname}/src/develop/nick/locales`,
|
|
13
17
|
port: 8080,
|
|
14
18
|
secret: 'secret',
|
|
15
19
|
systemUsers: ['admin', 'anonymous'],
|
|
@@ -48,6 +52,8 @@ export const config = {
|
|
|
48
52
|
trustProxy: 1,
|
|
49
53
|
},
|
|
50
54
|
events,
|
|
55
|
+
routes: false,
|
|
56
|
+
tasks: false,
|
|
51
57
|
ai: {
|
|
52
58
|
models: {
|
|
53
59
|
embed: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { config } from './config.js';
|
|
4
|
+
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
3
6
|
|
|
4
7
|
const knexSettings = {
|
|
5
8
|
client: 'pg',
|
|
@@ -20,7 +23,7 @@ const knexSettings = {
|
|
|
20
23
|
},
|
|
21
24
|
};
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
export default {
|
|
24
27
|
development: knexSettings,
|
|
25
28
|
production: knexSettings,
|
|
26
29
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= projectName %>",
|
|
3
3
|
"description": "",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"version": "0.0.1",
|
|
6
7
|
"private": true,
|
|
@@ -14,17 +15,17 @@
|
|
|
14
15
|
"develop": "missdev --config=jsconfig.json --fetch-https",
|
|
15
16
|
"develop:npx": "npx -p mrs-developer missdev --config=jsconfig.json --fetch-https",
|
|
16
17
|
"bootstrap": "pnpm preinstall && pnpm install && pnpm migrate && pnpm seed",
|
|
17
|
-
"convert": "
|
|
18
|
-
"i18n": "
|
|
18
|
+
"convert": "tsx scripts/convert.js",
|
|
19
|
+
"i18n": "tsx src/develop/nick/scripts/i18n.js",
|
|
19
20
|
"i18n:ci": "pnpm i18n && git diff -G'^[^\"POT]' --exit-code",
|
|
20
|
-
"knex": "
|
|
21
|
+
"knex": "tsx ./node_modules/knex/bin/cli.js",
|
|
21
22
|
"lint": "./node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx,json}'",
|
|
22
23
|
"migrate": "pnpm knex migrate:latest",
|
|
23
24
|
"prettier": "./node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,ts,tsx,json}'",
|
|
24
|
-
"seed": "
|
|
25
|
-
"seed:status": "
|
|
26
|
-
"seed:upgrade": "
|
|
27
|
-
"start": "nodemon --exec '
|
|
25
|
+
"seed": "tsx src/develop/nick/scripts/seed.js run",
|
|
26
|
+
"seed:status": "tsx src/develop/nick/scripts/seed.js status",
|
|
27
|
+
"seed:upgrade": "tsx src/develop/nick/scripts/seed.js upgrade",
|
|
28
|
+
"start": "nodemon --exec 'tsx src/develop/nick/src/server.ts'",
|
|
28
29
|
"rollback": "pnpm knex migrate:rollback --all",
|
|
29
30
|
"reset": "pnpm rollback && pnpm migrate && pnpm seed",
|
|
30
31
|
"test": "AUTH_RATE_LIMIT=1000 jest --passWithNoTests",
|
|
@@ -65,6 +66,6 @@
|
|
|
65
66
|
"@robgietema/nick": "workspace:^",
|
|
66
67
|
"knex": "3.1.0",
|
|
67
68
|
"nodemon": "3.1.11",
|
|
68
|
-
"
|
|
69
|
+
"tsx": "4.21.0"
|
|
69
70
|
}
|
|
70
71
|
}
|
|
@@ -1,113 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// "libReplacement": true, /* Enable lib replacement. */
|
|
18
|
-
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
19
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
20
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
21
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
22
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
23
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
24
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
25
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
26
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
27
|
-
|
|
28
|
-
/* Modules */
|
|
29
|
-
"module": "commonjs" /* Specify what module code is generated. */,
|
|
30
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
31
|
-
"moduleResolution": "node10" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
32
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
33
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
34
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
35
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
36
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
37
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
38
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
39
|
-
"allowImportingTsExtensions": true /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */,
|
|
40
|
-
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
|
41
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
42
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
43
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
44
|
-
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
|
45
|
-
"resolveJsonModule": true /* Enable importing .json files. */,
|
|
46
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
47
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
48
|
-
|
|
49
|
-
/* JavaScript Support */
|
|
50
|
-
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
|
|
51
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
52
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
53
|
-
|
|
54
|
-
/* Emit */
|
|
55
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
56
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
57
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
58
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
59
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
60
|
-
"noEmit": true /* Disable emitting files from a compilation. */,
|
|
61
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
62
|
-
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
63
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
64
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
65
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
66
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
67
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
68
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
69
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
70
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
71
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
72
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
73
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
74
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
75
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
76
|
-
|
|
77
|
-
/* Interop Constraints */
|
|
78
|
-
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
|
|
79
|
-
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
80
|
-
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
|
81
|
-
// "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
|
|
82
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
83
|
-
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
84
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
85
|
-
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
86
|
-
|
|
87
|
-
/* Type Checking */
|
|
88
|
-
"strict": true /* Enable all strict type-checking options. */,
|
|
89
|
-
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
|
|
90
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
91
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
92
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
93
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
94
|
-
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
|
95
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
96
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
97
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
98
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
99
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
100
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
101
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
102
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
103
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
104
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
105
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
106
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
107
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
108
|
-
|
|
109
|
-
/* Completeness */
|
|
110
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
111
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"allowImportingTsExtensions": true,
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noImplicitAny": true,
|
|
16
|
+
"skipLibCheck": true
|
|
112
17
|
}
|
|
113
18
|
}
|