@wneng/create-keel 0.3.2 → 0.3.4

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.
@@ -4,6 +4,19 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "start": "node src/index.js"
7
+ "start": "node src/index.js",
8
+ "typecheck": "tsc --noEmit",
9
+ "lint": "eslint src --ext .ts",
10
+ "format": "prettier --write \"src/**/*.ts\"",
11
+ "format:check": "prettier --check \"src/**/*.ts\"",
12
+ "test": "echo \"add tests with vitest or jest\" && exit 0"
13
+ },
14
+ "devDependencies": {
15
+ "@types/node": "^20.14.10",
16
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
17
+ "@typescript-eslint/parser": "^7.18.0",
18
+ "eslint": "^8.57.0",
19
+ "prettier": "^3.3.3",
20
+ "typescript": "^5.5.4"
8
21
  }
9
22
  }
@@ -1,5 +1,5 @@
1
1
  name: server-node
2
- version: 1.0.0
2
+ version: 1.1.0
3
3
  appliesWhen:
4
4
  backend: node
5
5
  priority: 30
@@ -13,6 +13,12 @@ files:
13
13
  - from: files/src-index.ts
14
14
  to: server/src/index.ts
15
15
  render: false
16
+ - from: files/_eslintrc.cjs
17
+ to: server/.eslintrc.cjs
18
+ render: false
19
+ - from: files/_prettierrc
20
+ to: server/.prettierrc
21
+ render: false
16
22
  - from: files/generated-gitkeep
17
23
  to: server/generated/.gitkeep
18
24
  render: false
@@ -3,3 +3,47 @@ name = "<%= it.options.projectName %>-server"
3
3
  version = "0.1.0"
4
4
  requires-python = ">=3.11"
5
5
  dependencies = []
6
+
7
+ [project.optional-dependencies]
8
+ dev = [
9
+ "ruff>=0.6.8",
10
+ "mypy>=1.11.0",
11
+ "pytest>=8.3.0",
12
+ "pip-audit>=2.7.0",
13
+ ]
14
+
15
+ # ruff: linter + formatter (single-tool replacement for black + isort + flake8).
16
+ # Source of truth referenced by docs/03-工程规范与研发基础设施/coding-style-python.md.
17
+ [tool.ruff]
18
+ line-length = 100
19
+ target-version = "py311"
20
+ extend-exclude = ["generated", ".venv"]
21
+
22
+ [tool.ruff.lint]
23
+ select = [
24
+ "E", # pycodestyle errors
25
+ "F", # pyflakes
26
+ "W", # pycodestyle warnings
27
+ "I", # isort
28
+ "B", # flake8-bugbear
29
+ "UP", # pyupgrade
30
+ "N", # pep8-naming
31
+ ]
32
+ ignore = []
33
+
34
+ [tool.ruff.format]
35
+ quote-style = "double"
36
+ indent-style = "space"
37
+ line-ending = "lf"
38
+
39
+ # mypy: strict-ish type checking. Adjust per module if a 3rd-party
40
+ # library has poor stubs.
41
+ [tool.mypy]
42
+ python_version = "3.11"
43
+ strict_optional = true
44
+ disallow_untyped_defs = true
45
+ warn_unused_ignores = true
46
+ exclude = ["generated", ".venv"]
47
+
48
+ [tool.pytest.ini_options]
49
+ testpaths = ["tests"]
@@ -0,0 +1,34 @@
1
+ /**
2
+ * ESLint configuration for the React + TypeScript web app.
3
+ *
4
+ * Source of truth referenced by:
5
+ * docs/03-工程规范与研发基础设施/coding-style-typescript.md
6
+ *
7
+ * Adjust rules with care; CI runs `eslint .` and aborts on errors.
8
+ */
9
+ module.exports = {
10
+ root: true,
11
+ env: { browser: true, es2022: true },
12
+ parser: '@typescript-eslint/parser',
13
+ parserOptions: {
14
+ ecmaVersion: 2022,
15
+ sourceType: 'module',
16
+ ecmaFeatures: { jsx: true },
17
+ },
18
+ plugins: ['@typescript-eslint', 'react', 'react-hooks'],
19
+ extends: [
20
+ 'eslint:recommended',
21
+ 'plugin:@typescript-eslint/recommended',
22
+ 'plugin:react/recommended',
23
+ 'plugin:react-hooks/recommended',
24
+ ],
25
+ settings: { react: { version: 'detect' } },
26
+ rules: {
27
+ 'react/react-in-jsx-scope': 'off',
28
+ 'react/prop-types': 'off',
29
+ '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
30
+ '@typescript-eslint/no-explicit-any': 'warn',
31
+ '@typescript-eslint/consistent-type-imports': 'warn',
32
+ },
33
+ ignorePatterns: ['dist', 'node_modules', 'generated'],
34
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "printWidth": 100,
4
+ "tabWidth": 2,
5
+ "useTabs": false,
6
+ "semi": true,
7
+ "singleQuote": true,
8
+ "trailingComma": "all",
9
+ "bracketSpacing": true,
10
+ "arrowParens": "always",
11
+ "endOfLine": "lf"
12
+ }
@@ -6,7 +6,11 @@
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "build": "tsc -b && vite build",
9
- "preview": "vite preview"
9
+ "preview": "vite preview",
10
+ "typecheck": "tsc --noEmit",
11
+ "lint": "eslint . --ext .ts,.tsx",
12
+ "format": "prettier --write \"src/**/*.{ts,tsx,css,json}\"",
13
+ "format:check": "prettier --check \"src/**/*.{ts,tsx,css,json}\""
10
14
  },
11
15
  "dependencies": {
12
16
  "antd": "^5.21.0",
@@ -18,7 +22,13 @@
18
22
  "devDependencies": {
19
23
  "@types/react": "^18.3.10",
20
24
  "@types/react-dom": "^18.3.0",
25
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
26
+ "@typescript-eslint/parser": "^7.18.0",
21
27
  "@vitejs/plugin-react": "^4.3.1",
28
+ "eslint": "^8.57.0",
29
+ "eslint-plugin-react": "^7.36.1",
30
+ "eslint-plugin-react-hooks": "^4.6.2",
31
+ "prettier": "^3.3.3",
22
32
  "typescript": "^5.6.2",
23
33
  "vite": "^5.4.8"
24
34
  }
@@ -1,5 +1,5 @@
1
1
  name: web-react
2
- version: 1.1.0
2
+ version: 1.2.0
3
3
  appliesWhen:
4
4
  frontend: react
5
5
  priority: 30
@@ -25,6 +25,12 @@ files:
25
25
  - from: files/src-App.tsx
26
26
  to: web/src/App.tsx
27
27
  render: true
28
+ - from: files/_eslintrc.cjs
29
+ to: web/.eslintrc.cjs
30
+ render: false
31
+ - from: files/_prettierrc
32
+ to: web/.prettierrc
33
+ render: false
28
34
  - from: files/generated-gitkeep
29
35
  to: web/generated/.gitkeep
30
36
  render: false
@@ -0,0 +1,28 @@
1
+ /**
2
+ * ESLint configuration for the Vue + TypeScript web app.
3
+ *
4
+ * Source of truth referenced by:
5
+ * docs/03-工程规范与研发基础设施/coding-style-typescript.md
6
+ */
7
+ module.exports = {
8
+ root: true,
9
+ env: { browser: true, es2022: true, node: true },
10
+ parser: 'vue-eslint-parser',
11
+ parserOptions: {
12
+ parser: '@typescript-eslint/parser',
13
+ ecmaVersion: 2022,
14
+ sourceType: 'module',
15
+ },
16
+ plugins: ['@typescript-eslint'],
17
+ extends: [
18
+ 'eslint:recommended',
19
+ 'plugin:vue/vue3-recommended',
20
+ 'plugin:@typescript-eslint/recommended',
21
+ ],
22
+ rules: {
23
+ '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
24
+ '@typescript-eslint/no-explicit-any': 'warn',
25
+ 'vue/multi-word-component-names': 'off',
26
+ },
27
+ ignorePatterns: ['dist', 'node_modules', 'generated'],
28
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "printWidth": 100,
4
+ "tabWidth": 2,
5
+ "useTabs": false,
6
+ "semi": true,
7
+ "singleQuote": true,
8
+ "trailingComma": "all",
9
+ "bracketSpacing": true,
10
+ "arrowParens": "always",
11
+ "endOfLine": "lf"
12
+ }
@@ -1,5 +1,5 @@
1
1
  name: web-vue
2
- version: 1.0.0
2
+ version: 1.1.0
3
3
  appliesWhen:
4
4
  frontend: vue
5
5
  priority: 30
@@ -16,6 +16,12 @@ files:
16
16
  - from: files/src-main.ts
17
17
  to: web/src/main.ts
18
18
  render: false
19
+ - from: files/_eslintrc.cjs
20
+ to: web/.eslintrc.cjs
21
+ render: false
22
+ - from: files/_prettierrc
23
+ to: web/.prettierrc
24
+ render: false
19
25
  - from: files/generated-gitkeep
20
26
  to: web/generated/.gitkeep
21
27
  render: false