@postxl/generators 6.1.0 → 6.3.0
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/dist/backend-actions/generators/dispatcher-service.generator.js +6 -1
- package/dist/backend-actions/generators/dispatcher-service.generator.js.map +1 -1
- package/dist/backend-core/backend.generator.js +1 -1
- package/dist/backend-core/backend.generator.js.map +1 -1
- package/dist/backend-core/template/libs/xlport/README.md +5 -5
- package/dist/backend-database-prisma/generators/database-config.generator.js +4 -0
- package/dist/backend-database-prisma/generators/database-config.generator.js.map +1 -1
- package/dist/backend-database-prisma/generators/database-service.generator.js +24 -3
- package/dist/backend-database-prisma/generators/database-service.generator.js.map +1 -1
- package/dist/backend-database-prisma/prisma.generator.js +24 -3
- package/dist/backend-database-prisma/prisma.generator.js.map +1 -1
- package/dist/backend-excel-io/template/README.md +3 -3
- package/dist/backend-repositories/generators/model-repository.generator.js +135 -39
- package/dist/backend-repositories/generators/model-repository.generator.js.map +1 -1
- package/dist/backend-repositories/model.types.d.ts +7 -0
- package/dist/backend-repositories/model.types.js +19 -4
- package/dist/backend-repositories/model.types.js.map +1 -1
- package/dist/backend-repositories/repositories.generator.js +1 -1
- package/dist/backend-repositories/repositories.generator.js.map +1 -1
- package/dist/base/base.generator.js +6 -16
- package/dist/base/base.generator.js.map +1 -1
- package/dist/base/generators/claudemd.generator.js +21 -1
- package/dist/base/generators/claudemd.generator.js.map +1 -1
- package/dist/base/template/.claude/commands/README.md +10 -1
- package/dist/base/template/.claude/commands/browser-observe.md +72 -72
- package/dist/base/template/.claude/commands/fix-ci.md +12 -7
- package/dist/base/template/.oxfmtrc.json +17 -0
- package/dist/base/template/.oxlintrc.json +1130 -0
- package/dist/base/template/.vscode/extensions.json +2 -4
- package/dist/base/template/.vscode/settings.json +7 -5
- package/dist/e2e/e2e.generator.js +2 -0
- package/dist/e2e/e2e.generator.js.map +1 -1
- package/dist/e2e/template/.claude/commands/run-e2e-tests.md +7 -1
- package/dist/e2e/template/e2e/package.json +1 -1
- package/dist/e2e/template/e2e/specs/example.spec.ts +2 -2
- package/dist/frontend-actions/actions.generator.d.ts +14 -1
- package/dist/frontend-actions/actions.generator.js.map +1 -1
- package/dist/frontend-actions/generators/base-global-actions.generator.js +4 -1
- package/dist/frontend-actions/generators/base-global-actions.generator.js.map +1 -1
- package/dist/frontend-actions/generators/command-palette-store.generator.js +29 -0
- package/dist/frontend-actions/generators/command-palette-store.generator.js.map +1 -1
- package/dist/frontend-actions/generators/command-palette.generator.js +141 -8
- package/dist/frontend-actions/generators/command-palette.generator.js.map +1 -1
- package/dist/frontend-actions/index.d.ts +1 -0
- package/dist/frontend-actions/index.js.map +1 -1
- package/dist/frontend-admin/admin.generator.d.ts +14 -0
- package/dist/frontend-admin/admin.generator.js +131 -122
- package/dist/frontend-admin/admin.generator.js.map +1 -1
- package/dist/frontend-admin/generators/admin-global-actions.generator.js +3 -0
- package/dist/frontend-admin/generators/admin-global-actions.generator.js.map +1 -1
- package/dist/frontend-admin/generators/model-admin-page.generator.js +14 -7
- package/dist/frontend-admin/generators/model-admin-page.generator.js.map +1 -1
- package/dist/frontend-admin/index.d.ts +2 -0
- package/dist/frontend-admin/index.js +2 -1
- package/dist/frontend-admin/index.js.map +1 -1
- package/dist/frontend-admin/utils.js +16 -13
- package/dist/frontend-admin/utils.js.map +1 -1
- package/dist/frontend-core/frontend.generator.js +5 -11
- package/dist/frontend-core/frontend.generator.js.map +1 -1
- package/dist/frontend-core/template/README.md +45 -10
- package/dist/frontend-core/template/src/components/ui/application-header/application-header.tsx +1 -1
- package/dist/frontend-core/template/src/stories/Configure.mdx +34 -26
- package/dist/frontend-core/template/vite.config.ts +2 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/base/template/.prettierignore +0 -6
- package/dist/base/template/eslint.config.mjs +0 -207
- package/dist/base/template/prettier.config.js +0 -10
- package/dist/frontend-core/template/.prettierignore +0 -4
- package/dist/frontend-core/template/vitest.shims.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postxl/generators",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "Code generators for PXL - generates backend, frontend, Prisma schemas, and more",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@faker-js/faker": "9.9.0",
|
|
45
45
|
"@prisma/prisma-schema-wasm": "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a",
|
|
46
46
|
"exceljs": "^4.4.0",
|
|
47
|
-
"@postxl/generator": "^2.
|
|
48
|
-
"@postxl/schema": "^2.
|
|
47
|
+
"@postxl/generator": "^2.2.0",
|
|
48
|
+
"@postxl/schema": "^2.6.0",
|
|
49
49
|
"@postxl/ui-components": "^1.11.0",
|
|
50
50
|
"@postxl/utils": "^1.4.3"
|
|
51
51
|
},
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"build": "tsc -b tsconfig.build.json && pnpm run copy:templates",
|
|
63
63
|
"copy:templates": "find dist -type d -name 'template' -exec rm -rf {} + 2>/dev/null || true && find src -type d -name 'template' -exec sh -c 'mkdir -p \"dist/$(dirname \"$1\" | sed \"s|^src/||\")\" && cp -r \"$1\" \"dist/$(dirname \"$1\" | sed \"s|^src/||\")\"' _ {} \\;",
|
|
64
64
|
"generate": "tsx src/frontend-core/scripts/generate-types.ts",
|
|
65
|
-
"lint": "
|
|
66
|
-
"
|
|
65
|
+
"lint": "oxlint --disable-nested-config",
|
|
66
|
+
"format:check": "oxfmt --check \"**/*.{ts,tsx}\"",
|
|
67
67
|
"test:jest": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest",
|
|
68
68
|
"test:coverage": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage",
|
|
69
69
|
"test:watch": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --watch",
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
import eslint from '@eslint/js'
|
|
4
|
-
import reactConfigs from 'eslint-plugin-react'
|
|
5
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
6
|
-
import globals from 'globals'
|
|
7
|
-
|
|
8
|
-
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
|
9
|
-
import tseslint from 'typescript-eslint'
|
|
10
|
-
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
const reactConfig = reactConfigs.configs.flat.recommended
|
|
13
|
-
|
|
14
|
-
// tseslint.config() is a helper function that simply provides type safety for the ESLint flat config object.
|
|
15
|
-
// Instead of an array of config objects, pass each object as an argument to tseslint.config()
|
|
16
|
-
export default tseslint.config(
|
|
17
|
-
{
|
|
18
|
-
// Global ignore patterns
|
|
19
|
-
ignores: [
|
|
20
|
-
'**/dist/**/*',
|
|
21
|
-
'**/dist-types/**/*',
|
|
22
|
-
'**/node_modules/**/*',
|
|
23
|
-
'**/tests/**/*',
|
|
24
|
-
'generators/**/template/**/*',
|
|
25
|
-
'**/coverage/**/*',
|
|
26
|
-
'**/dist/**/*',
|
|
27
|
-
'**/jest.config.ts',
|
|
28
|
-
'**/prettier.config.js',
|
|
29
|
-
'eslint.config.mjs',
|
|
30
|
-
'**/next.config.js',
|
|
31
|
-
'**/.next/**/*',
|
|
32
|
-
'**/test-results/*',
|
|
33
|
-
'**/playwright-report/*',
|
|
34
|
-
'**/playwright-report*',
|
|
35
|
-
'**/*.js',
|
|
36
|
-
// Ignore stories for now
|
|
37
|
-
'**/*.stories.tsx',
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
// Default ESLint rules
|
|
42
|
-
eslint.configs.recommended,
|
|
43
|
-
|
|
44
|
-
// Recommended TypeScript rules
|
|
45
|
-
// TODO: Change to .strictTypeChecked
|
|
46
|
-
...tseslint.configs.strict,
|
|
47
|
-
...tseslint.configs.stylistic,
|
|
48
|
-
|
|
49
|
-
// Additional global settings
|
|
50
|
-
{
|
|
51
|
-
ignores: ['**/*.js'],
|
|
52
|
-
|
|
53
|
-
languageOptions: {
|
|
54
|
-
parserOptions: {
|
|
55
|
-
projectService: true,
|
|
56
|
-
tsconfigRootDir: import.meta.dirname,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
plugins: {
|
|
60
|
-
'simple-import-sort': simpleImportSort,
|
|
61
|
-
},
|
|
62
|
-
// Custom Rule Overrides and Settings
|
|
63
|
-
rules: {
|
|
64
|
-
// If we use "any", we typically do this on purpose
|
|
65
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
66
|
-
|
|
67
|
-
// NestJS often defined empty classes but with decorators
|
|
68
|
-
'@typescript-eslint/no-extraneous-class': 'off',
|
|
69
|
-
|
|
70
|
-
// Ensure that promises are awaited
|
|
71
|
-
'@typescript-eslint/no-floating-promises': 'error',
|
|
72
|
-
'@typescript-eslint/require-await': 'error',
|
|
73
|
-
|
|
74
|
-
// We prefer `type` over `interface` for type definitions
|
|
75
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
76
|
-
|
|
77
|
-
// This rule is too strict and we use `!` to indicate that a value cannot be null
|
|
78
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
79
|
-
|
|
80
|
-
// We want unused vars to be an error. However, vars named `_` are often used to indicate that a value is unused and are allowed.
|
|
81
|
-
'no-unused-vars': 'off',
|
|
82
|
-
'@typescript-eslint/no-unused-vars': [
|
|
83
|
-
'error',
|
|
84
|
-
{
|
|
85
|
-
args: 'all',
|
|
86
|
-
argsIgnorePattern: '^_',
|
|
87
|
-
caughtErrors: 'all',
|
|
88
|
-
caughtErrorsIgnorePattern: '^_',
|
|
89
|
-
destructuredArrayIgnorePattern: '^_',
|
|
90
|
-
varsIgnorePattern: '^_',
|
|
91
|
-
ignoreRestSiblings: true,
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
|
|
95
|
-
// This enforces that all template expressions are either number of string, other types must be stringified
|
|
96
|
-
'@typescript-eslint/restrict-template-expressions': [
|
|
97
|
-
'error',
|
|
98
|
-
{
|
|
99
|
-
allowNumber: true,
|
|
100
|
-
allowBoolean: true,
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
|
|
104
|
-
// The "curly" rule ensures that all if, else if, else, for, while, or do blocks are followed by a block in braces, even if it is only a single line.
|
|
105
|
-
// This will flag `if(condition) return x` and expect it to be written as `if (condition) { return x }`
|
|
106
|
-
curly: ['error', 'all'],
|
|
107
|
-
'no-inner-declarations': 'off',
|
|
108
|
-
|
|
109
|
-
'padded-blocks': [
|
|
110
|
-
'error',
|
|
111
|
-
'never',
|
|
112
|
-
{
|
|
113
|
-
allowSingleLineBlocks: false,
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
|
|
117
|
-
'simple-import-sort/imports': [
|
|
118
|
-
'error',
|
|
119
|
-
{
|
|
120
|
-
groups: [
|
|
121
|
-
// Node.js builtins. You could also generate this regex if you use a `.js` config
|
|
122
|
-
// (e.g. `^(${require("module").builtinModules.join("|")})(/|$)`)
|
|
123
|
-
[
|
|
124
|
-
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)',
|
|
125
|
-
],
|
|
126
|
-
|
|
127
|
-
// Side effect imports.
|
|
128
|
-
['^\\u0000'],
|
|
129
|
-
|
|
130
|
-
// Any packages that starts with an @ but not libraries we defined in tsconfig.json:
|
|
131
|
-
['^@(?!(postxl|assets|backend|hooks|components|i18n|lib|layout|theme|ui|public))'],
|
|
132
|
-
|
|
133
|
-
// Any other package.
|
|
134
|
-
['^'],
|
|
135
|
-
|
|
136
|
-
// Internal PXL packages.
|
|
137
|
-
['^(@postxl|@assets|@backend|@hooks|@components|@i18n|@lib|@layout|@theme|@ui|@public)(/.*|$)'],
|
|
138
|
-
|
|
139
|
-
// Parent imports. Put `..` last.
|
|
140
|
-
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
141
|
-
|
|
142
|
-
// Other relative imports. Put same-folder imports and `.` last.
|
|
143
|
-
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
144
|
-
],
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
// React-specific rules
|
|
151
|
-
// Source: https://www.npmjs.com/package/eslint-plugin-react
|
|
152
|
-
//
|
|
153
|
-
// Currently, eslint-config-next only support eslint v8.x.
|
|
154
|
-
// Until it is upgraded (and we upgraded to NextJS v15), we use the default
|
|
155
|
-
// react and react-hooks eslint plugins.
|
|
156
|
-
//
|
|
157
|
-
// @ts-ignore
|
|
158
|
-
{
|
|
159
|
-
settings: {
|
|
160
|
-
react: {
|
|
161
|
-
version: '18.3',
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
files: ['**/web/**/*.{ts,tsx,mtsx}', '**/frontend/**/*.{ts,tsx,mtsx}'],
|
|
165
|
-
...reactConfig,
|
|
166
|
-
languageOptions: {
|
|
167
|
-
...reactConfig.languageOptions,
|
|
168
|
-
globals: {
|
|
169
|
-
...globals.serviceworker,
|
|
170
|
-
...globals.browser,
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
rules: {
|
|
174
|
-
...reactConfig.rules,
|
|
175
|
-
'react/prop-types': 'off',
|
|
176
|
-
'react/react-in-jsx-scope': 'off',
|
|
177
|
-
// We have a dedicated `Button` component (`@postxl/ui-components`) that carries the
|
|
178
|
-
// app's focus, hover and disabled styling - a raw `<button>` skips all of it. Where a
|
|
179
|
-
// raw element is genuinely required (e.g. the clickable target is a whole row of
|
|
180
|
-
// freeform content that no `Button` size/variant can host), silence this line with
|
|
181
|
-
// `// eslint-disable-next-line react/forbid-elements -- <reason>` rather than turning
|
|
182
|
-
// the rule off.
|
|
183
|
-
'react/forbid-elements': [
|
|
184
|
-
'error',
|
|
185
|
-
{
|
|
186
|
-
forbid: [{ element: 'button', message: 'use `Button` from `@postxl/ui-components` instead' }],
|
|
187
|
-
},
|
|
188
|
-
],
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
plugins: {
|
|
193
|
-
'react-hooks': reactHooks,
|
|
194
|
-
},
|
|
195
|
-
files: ['**/web/**/*.{ts,tsx,mtsx}', '**/frontend/**/*.{ts,tsx,mtsx}'],
|
|
196
|
-
rules: {
|
|
197
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
198
|
-
'react-hooks/exhaustive-deps': 'error',
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
// Do not type check VFS files
|
|
203
|
-
{
|
|
204
|
-
files: ['**/vfs/**/*.ts', '**/vfs/**/*.tsx'],
|
|
205
|
-
extends: [tseslint.configs.disableTypeChecked],
|
|
206
|
-
},
|
|
207
|
-
)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// IMPORTANT: To ensure consistency between generated code and repo code,
|
|
2
|
-
// make sure that this file is kept in sync with
|
|
3
|
-
// `./packages/generator/src/utils/prettier-config.ts`!
|
|
4
|
-
module.exports = {
|
|
5
|
-
semi: false,
|
|
6
|
-
trailingComma: 'all',
|
|
7
|
-
singleQuote: true,
|
|
8
|
-
tabWidth: 2,
|
|
9
|
-
printWidth: 120,
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@vitest/browser/providers/playwright" />
|