diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml new file mode 100644 index 0000000..f41e8f6 --- /dev/null +++ b/.github/workflows/basic.yml @@ -0,0 +1,84 @@ +name: Basic CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + types: [opened, synchronize, reopened] + +env: + HUSKY: 0 + +jobs: + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: 'pnpm' + + - name: Type Checking + run: | + pnpm install --frozen-lockfile + pnpm run ci:typecheck + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: 'pnpm' + + - name: Linting + run: | + pnpm install --frozen-lockfile + pnpm run ci:lint + + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: 'pnpm' + + - name: Unit Testing + run: | + pnpm install --frozen-lockfile + pnpm run ci:test + + e2e-tests: + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install dependencies + run: npm install -g pnpm && pnpm install + - name: Install Playwright Browsers + run: pnpm exec playwright install --with-deps + - name: Run Playwright tests + run: pnpm run ci:test:e2e + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 7 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1d2ab4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +_dev +coverage +node_modules +dist +build +.eslintcache +.windsurfrules + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..531eecc --- /dev/null +++ b/.prettierignore @@ -0,0 +1,16 @@ +_dev +dist +build +coverage +playwright +cypress +node_modules +.changeset +.astro +.vscode +tests/e2e/report +tests/e2e/test-results + +.eslintcache +package-lock.json +pnpm-lock.yaml diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..4a5f201 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,24 @@ +{ + "tabWidth": 4, + "useTabs": true, + "semi": true, + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 100, + "plugins": ["prettier-plugin-organize-attributes"], + "overrides": [ + { + "files": ["*.{json,md,yml,yaml}"], + "options": { + "useTabs": false, + "tabWidth": 2 + } + }, + { + "files": ["*.{css,scss,less}"], + "options": { + "singleQuote": false + } + } + ] +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..42b28fc --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,20 @@ +import pluginJs from '@eslint/js'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +export default [ + { + ignores: ['coverage', 'dist', 'build', 'tests/e2e/report/*', 'tests/e2e/test-results/*'], + }, + { files: ['src/**/*.{js,mjs,cjs,ts,jsx,tsx}', 'tests/**/*.spec.{js,mjs,cjs,ts,jsx,tsx'] }, + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + }, + }, + }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, +]; diff --git a/index.html b/index.html new file mode 100644 index 0000000..7c255e5 --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + +
+ + + +m({offset:r==="vertical"?v.clientY:v.clientX,size:p}),onMouseUp:()=>m(null),onMouseMove:v=>{if(!v.buttons)m(null);else if(g){const E=(r==="vertical"?v.clientY:v.clientX)-g.offset,C=n?g.size+E:g.size-E,b=v.target.parentElement.getBoundingClientRect(),S=Math.min(Math.max(i,C),(r==="vertical"?b.height:b.width)-i);r==="vertical"?d(S*window.devicePixelRatio):c(S*window.devicePixelRatio)}}})]})};function Fs(e,t="'"){const n=JSON.stringify(e),r=n.substring(1,n.length-1).replace(/\\"/g,'"');if(t==="'")return t+r.replace(/[']/g,"\\'")+t;if(t==='"')return t+r.replace(/["]/g,'\\"')+t;if(t==="`")return t+r.replace(/[`]/g,"`")+t;throw new Error("Invalid escape char")}function ys(e){return e.charAt(0).toUpperCase()+e.substring(1)}function oh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function Ve(e){let t="";for(let n=0;n