Skip to content

Commit

Permalink
Fix/theme template (#5459)
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio authored Oct 20, 2023
2 parents b953fee + 469e02f commit a59ea05
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 108 deletions.
2 changes: 2 additions & 0 deletions packages/create-kolibri/defaults/.npmrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# - npm
legacy-peer-deps=true
save-exact=true

# - pnpm
auto-install-peers=true
prefer-offline=true
shamefully-hoist=true
strict-peer-dependencies=false
25 changes: 25 additions & 0 deletions packages/create-kolibri/templates/kolibri-theme/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
root: true,
env: {
es6: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jsdoc/recommended',
'plugin:json/recommended',
'prettier',
],
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
plugins: [
'html',
// 'jsdoc',
// 'json',
'no-loops',
],
};
9 changes: 9 additions & 0 deletions packages/create-kolibri/templates/kolibri-theme/.knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entry": ["src/index.ts"],
"ignoreBinaries": [],
"ignoreDependencies": [],
"project": ["src/**/*.ts"],
"rules": {
"classMembers": "warn"
}
}
22 changes: 12 additions & 10 deletions packages/create-kolibri/templates/kolibri-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "unbuild",
"depcheck": "depcheck",
"format": "prettier --check src",
"lint": "eslint src && tsc --noemit",
"lint": "eslint src",
"prepack": "unbuild",
"test": "THEME_MODULE=src/index THEME_EXPORT={{capital name}} kolibri-visual-test",
"test-update": "THEME_MODULE=src/index THEME_EXPORT={{capital name}} kolibri-visual-test --update-snapshots",
Expand All @@ -23,16 +23,18 @@
"@public-ui/components": "1.7.2",
"@public-ui/schema": "1.7.2",
"@public-ui/visual-tests": "1.7.2",
"@types/node": "ts5.2",
"@typescript-eslint/eslint-plugin": "6.7.0",
"@typescript-eslint/parser": "6.7.0",
"depcheck": "1.4.6",
"eslint": "8.49.0",
"@typescript-eslint/eslint-plugin": "6.8.0",
"@typescript-eslint/parser": "6.8.0",
"depcheck": "1.4.7",
"eslint": "8.51.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-html": "7.1.0",
"eslint-plugin-jsdoc": "46.8.2",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-no-loops": "0.3.0",
"knip": "2.24.1",
"npm-check-updates":"16.14.4",
"prettier":"3.0.3",
"typescript": "5.2.2",
"knip": "2.35.0",
"npm-check-updates": "16.14.6",
"prettier": "3.0.3",
"unbuild": "1.2.1"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import CONFIG from '@leanup/stack/prettier.config';

export default {
...CONFIG,
printWidth: 160,
singleQuote: true,
useTabs: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { KoliBri } from '@public-ui/components';
import { KoliBri } from '@public-ui/schema';

export const {{capital name}} = KoliBri.createTheme('{{kebab name}}', {});
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { KoliBri } from '@public-ui/components';
import { KoliBri } from '@public-ui/schema';

export const DE = KoliBri.createTranslation('de', {});
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { KoliBri } from '@public-ui/components';
import { KoliBri } from '@public-ui/schema';

export const EN = KoliBri.createTranslation('en', {});
23 changes: 2 additions & 21 deletions packages/create-kolibri/templates/kolibri-theme/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
{
"compilerOptions": {
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"lib": ["dom", "es2015"],
"module": "ESNext",
"preserveSymlinks": true,
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist",
"removeComments": true,
"sourceMap": true,
"jsx": "react",
"target": "es2015",
"forceConsistentCasingInFileNames": false,
"importHelpers": false,
"strict": true
},
"compileOnSave": false,
"buildOnSave": false
"include": ["src/index.ts"],
"exclude": ["node_modules", "dist"]
}
2 changes: 1 addition & 1 deletion packages/tools/visual-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
"dependencies": {
"@playwright/test": "1.38.1",
"@public-ui/sample-react": "1.7.2",
"axe-playwright": "1.2.3",
"portfinder": "1.0.32",
"serve": "14.2.1"
},
"devDependencies": {
"@babel/eslint-parser": "7.22.15",
"@babel/plugin-syntax-import-attributes": "7.22.5",
"@babel/preset-env": "7.22.20",
"axe-playwright": "1.2.3",
"depcheck": "1.4.6",
"eslint": "8.50.0",
"eslint-plugin-no-loops": "0.3.0",
Expand Down
Loading

0 comments on commit a59ea05

Please sign in to comment.