-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add solid application template
- Loading branch information
Showing
49 changed files
with
1,380 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
> 5% | ||
last 1 versions | ||
Firefox ESR | ||
not dead | ||
not ie >= 11 | ||
not ie_mob >= 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*.css | ||
*.ejs | ||
*.json | ||
*.md | ||
*.svg | ||
*.tgz | ||
*.tsbuildinfo | ||
*.yaml | ||
build/ | ||
cache/ | ||
coverage/ | ||
dist/ | ||
playwright/artifacts/ | ||
playwright/report/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
extends: | ||
- "@package/eslint-config" | ||
overrides: | ||
- files: | ||
- "src/index.{[cm]js,[jt]s?(x)}" | ||
rules: | ||
filenames/no-index: off # whitelist entry point | ||
import/no-unused-modules: off # whitelist entry point | ||
- files: | ||
- "playwright/**/*" | ||
settings: | ||
disable/plugins: | ||
- jest # plugin mistakes playwright tests for jest tests | ||
- testing-library # plugin mistakes playwright test for jest tests | ||
- files: | ||
- "src/**/*" | ||
rules: | ||
node/file-extension-in-import: off # src code does not run on node runtime | ||
node/no-unsupported-features/es-syntax: off # src code does not run on node runtime | ||
- files: | ||
- "!playwright/**/*" | ||
rules: # plugin mistakes jest tests for playwright tests | ||
playwright/no-duplicate-hooks: off | ||
playwright/no-standalone-expect: off | ||
playwright/require-top-level-describe: off | ||
- files: | ||
- "test/resolver.js" | ||
settings: | ||
disable/plugins: | ||
- "@typescript-eslint" # resolver cannot be typescript | ||
parserOptions: | ||
project: "./tsconfig.eslint.json" | ||
rules: | ||
unicorn/prevent-abbreviations: | ||
- error | ||
- allowList: | ||
Props: true # common abbreviation | ||
i18n: true # common numeronym | ||
props: true # common abbreviation | ||
settings: | ||
import/internal-regex: ^@(application|component|library|service) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# cache | ||
cache/ | ||
|
||
# eslint | ||
.eslintcache | ||
|
||
# jest | ||
coverage/ | ||
|
||
# playwright | ||
playwright/artifacts/ | ||
playwright/report/ | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
build/ | ||
|
||
# webpack | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"moduleNameMapper": { | ||
"\\.css$": "<rootDir>/test/style-mock.ts" | ||
}, | ||
"preset": "@package/jest-config/presets/development", | ||
"roots": ["<rootDir>/src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"moduleNameMapper": { | ||
"^.+\\.css$": "<rootDir>/test/style-mock.ts" | ||
}, | ||
"preset": "@package/jest-config", | ||
"resolver": "./test/resolver.js", | ||
"roots": ["<rootDir>/src"], | ||
"setupFilesAfterEnv": [ | ||
"@testing-library/jest-dom", | ||
"jest-extended/all", | ||
"<rootDir>/test/setup.ts" | ||
], | ||
"testEnvironment": "./test/jsdom.ts", | ||
"transform": { | ||
"^.+\\.m?[jt]sx?$": [ | ||
"ts-jest", | ||
{ | ||
"babelConfig": { | ||
"presets": ["@babel/preset-env", "solid"] | ||
}, | ||
"tsconfig": "./tsconfig.test.json" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"*": [ | ||
"eslint --cache --cache-strategy=content --fix", | ||
"prettier --cache --write" | ||
], | ||
"*.{[cm]js,[jt]s?(x)}": ["yarn test --bail --findRelatedTests"], | ||
"*.md": ["markdownlint --fix"], | ||
"webpack/**/*": ["yarn build:development:test", "yarn build:production:test"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@package/markdownlint-config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build/ | ||
cache/ | ||
coverage/ | ||
dist/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.tgz | ||
.*ignore | ||
.browserslistrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
...require("@package/prettier-config"), | ||
overrides: [ | ||
{ | ||
files: "*.ejs", | ||
options: { parser: "html" }, | ||
}, | ||
{ | ||
files: "*.svg", | ||
options: { parser: "html" }, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# `@application/solid-application` | ||
|
||
A solid application. | ||
|
||
## Stack | ||
|
||
- [Jest](https://facebook.github.io/jest/) - JavaScript testing framework. | ||
- [SolidJS](https://www.solidjs.com/) - JavaScript library for building user interfaces. | ||
- [Testing Library](https://testing-library.com/) - Testing utilities. | ||
- [TypeScript](https://www.typescriptlang.org/) - A typed superset of JavaScript that compiles to plain JavaScript. | ||
|
||
## To Do | ||
|
||
- [ ] update `package.json` manifest description | ||
- [ ] update `README.md` title | ||
- [ ] update `README.md` description | ||
- [ ] add package to root `README.md` structure | ||
- [ ] update port number | ||
- [ ] remove this checklist | ||
|
||
```typescript | ||
import("node:crypto").then(({ createHash }) => { | ||
const input = "<package.name>"; | ||
|
||
const hashRaw = createHash("whirlpool").update(input); | ||
const hashHex = hashRaw.digest("hex"); | ||
const hashInt = parseInt(hashHex, 16) % Math.pow(10, 4); | ||
|
||
console.log(hashInt); | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"files": [ | ||
{ | ||
"path": "./dist/**/main.?(m)js", | ||
"maxSize": "100 kB", | ||
"compression": "brotli" | ||
}, | ||
{ | ||
"path": "./dist/**/*.?(m)js", | ||
"maxSize": "750 kB", | ||
"compression": "brotli" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
"name": "@application/solid-application", | ||
"version": "0.1.0", | ||
"private": true, | ||
"description": "> TODO: description", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jdanil/skunkworks.git", | ||
"directory": "templates/solid-application" | ||
}, | ||
"main": "dist/index.js", | ||
"directories": { | ||
"dist": "dist" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"engines": { | ||
"node": "^20 || >=22" | ||
}, | ||
"scripts": { | ||
"build": "TS_NODE_PROJECT=\"webpack/config/tsconfig.json\" webpack --config webpack/config/production.ts", | ||
"build:development:test": "TS_NODE_PROJECT=\"webpack/config/tsconfig.json\" webpack configtest webpack/config/development.ts", | ||
"build:production:test": "TS_NODE_PROJECT=\"webpack/config/tsconfig.json\" webpack configtest webpack/config/production.ts", | ||
"bundlesize": "bundlesize", | ||
"clean": "run-p 'clean:*'", | ||
"clean:test": "yarn test --clearCache", | ||
"clean:tsc": "yarn compile --clean", | ||
"clean:webpack": "rimraf dist", | ||
"compile": "tsc --build", | ||
"format": "prettier --cache", | ||
"format:all": "yarn format .", | ||
"format:all:check": "yarn format:all --check", | ||
"format:all:write": "yarn format:all --write", | ||
"format:diff": "pretty-quick", | ||
"format:diff:check": "yarn format:diff --check", | ||
"format:diff:write": "yarn format:diff", | ||
"lint": "run-s lint:es lint:md", | ||
"lint:all": "run-s 'lint:*:all'", | ||
"lint:diff": "run-s 'lint:*:diff'", | ||
"lint:es": "eslint --cache --cache-strategy=content", | ||
"lint:es:all": "yarn lint:es \"**/*\"", | ||
"lint:es:diff": "FILES=$(git diff --diff-filter=ACMRTUB --name-only --relative master); [ -z ${FILES} ] || yarn lint:es --no-error-on-unmatched-pattern ${FILES}", | ||
"lint:md": "markdownlint", | ||
"lint:md:all": "yarn lint:md \"**/*.md\"", | ||
"lint:md:diff": "FILES=$(git diff --diff-filter=ACMRTUB --name-only --relative master); [ -z ${FILES} ] || yarn lint:md:all", | ||
"playwright": "playwright test", | ||
"precommit": "lint-staged", | ||
"prepack": "yarn build", | ||
"start": "yarn start:development", | ||
"start:development": "TS_NODE_PROJECT=\"webpack/config/tsconfig.json\" webpack serve --config webpack/config/development.ts", | ||
"start:production": "TS_NODE_PROJECT=\"webpack/config/tsconfig.json\" webpack serve --config webpack/config/production.ts", | ||
"test": "yarn compile && jest --config .jestrc.json", | ||
"test:ci": "yarn test --ci", | ||
"test:ci:branch": "yarn test:ci --changedSince master" | ||
}, | ||
"dependencies": { | ||
"solid-js": "1.8.19" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.24.9", | ||
"@babel/preset-env": "7.25.0", | ||
"@jest/globals": "29.7.0", | ||
"@package/eslint-config": "workspace:*", | ||
"@package/jest-config": "workspace:*", | ||
"@package/markdownlint-config": "workspace:*", | ||
"@package/prettier-config": "workspace:*", | ||
"@package/tsconfig": "workspace:*", | ||
"@playwright/test": "1.45.3", | ||
"@solidjs/testing-library": "0.8.9", | ||
"@testing-library/dom": "10.4.0", | ||
"@testing-library/jest-dom": "6.4.8", | ||
"@testing-library/user-event": "14.5.2", | ||
"@types/jest": "29.5.12", | ||
"@types/node": "20.14.12", | ||
"babel-loader": "9.1.3", | ||
"babel-preset-solid": "1.8.19", | ||
"bundlesize": "0.18.2", | ||
"css-loader": "7.1.2", | ||
"eslint": "8.57.0", | ||
"fork-ts-checker-webpack-plugin": "9.0.2", | ||
"html-webpack-plugin": "5.6.0", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "29.7.0", | ||
"jest-extended": "4.0.2", | ||
"jest-when": "3.6.0", | ||
"lint-staged": "12.1.7", | ||
"markdownlint-cli": "0.41.0", | ||
"mini-css-extract-plugin": "2.9.0", | ||
"msw": "2.3.4", | ||
"npm-run-all": "4.1.5", | ||
"postcss": "8.4.40", | ||
"postcss-loader": "8.1.1", | ||
"prettier": "3.3.3", | ||
"pretty-quick": "4.0.0", | ||
"rimraf": "6.0.1", | ||
"style-loader": "4.0.0", | ||
"ts-jest": "29.2.3", | ||
"ts-loader": "9.5.1", | ||
"ts-node": "10.9.2", | ||
"tslib": "2.6.3", | ||
"typescript": "5.5.4", | ||
"webpack": "5.93.0", | ||
"webpack-cli": "5.1.4", | ||
"webpack-dev-server": "5.0.4", | ||
"webpack-merge": "6.0.1" | ||
}, | ||
"msw": { | ||
"workerDirectory": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Package | ||
|
||
Annotations for `package.json` manifest file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { defineConfig } from "@playwright/test"; | ||
|
||
// eslint-disable-next-line node/no-process-env -- check `process.env` to detect ci environment | ||
const CI = !!process.env.CI; | ||
const ROOT_DIR = "playwright"; | ||
const URL = "http://localhost:7824"; | ||
|
||
// eslint-disable-next-line no-restricted-exports, import/no-default-export -- playwright requires default export | ||
export default defineConfig({ | ||
forbidOnly: CI, | ||
fullyParallel: true, | ||
outputDir: `${ROOT_DIR}/artifacts`, | ||
reporter: [ | ||
["html", { outputFolder: `${ROOT_DIR}/report` }], | ||
[CI ? "dot" : "list"], | ||
], | ||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- retries | ||
retries: CI ? 3 : 0, | ||
testDir: `${ROOT_DIR}/tests`, | ||
use: { | ||
baseURL: URL, | ||
screenshot: "only-on-failure", | ||
trace: "on-first-retry", | ||
video: "on-first-retry", | ||
}, | ||
webServer: { | ||
command: "yarn start:production", | ||
reuseExistingServer: !CI, | ||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- timeout | ||
timeout: 90 * 1000, | ||
url: URL, | ||
}, | ||
}); |
Oops, something went wrong.