Skip to content

Commit

Permalink
Rollup instead of tsc, focus listener (#67)
Browse files Browse the repository at this point in the history
* Rollup instead of tsc, focus listener
  • Loading branch information
tofsjonas authored Nov 16, 2023
1 parent f3631c8 commit c2a6fbf
Show file tree
Hide file tree
Showing 18 changed files with 1,182 additions and 795 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
rules: {
'prettier/prettier': 'error',
'no-inner-declarations': 'off',
// For some reason setting the target target ES5 messes up the code, and es2020 does not
// For some reason setting the target ES5 messes up the code, and es2020 does not
// 'no-var': 'off',
},
}
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:
- name: Run tests
run: npm run test

- name: Build, just in case
run: npm run build
- name: Run tests with minified code
run: npm run test:min
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run pre-push
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
._*
7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": ["glenn2223.live-sass"],
"recommendations": [
"glenn2223.live-sass",
"dbaeumer.vscode-eslint",
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.0] - 2023-11-16

### Changed

- Using `rollup` instead of `tsc` to generate javascript files.
- `src/` folder now included in npm package, so that `enhanceSortableAccessibility` can be used in TypeScript projects.

### Added

- Test minified files also.
- Added `focus` eventListener to `enhanceSortableAccessibility`, so that the `aria-label` is kept up to date.

## [3.0.0] - 2023-10-17

### Changed

- `aria-sort="ascending|descending"` used instead of `class="dir-d|dir-up"` to keep track of direction.
- `aria-sort="ascending|descending"` used instead of `class="dir-d|dir-up"` to keep track of direction.

### Breaking Changes

Expand Down Expand Up @@ -106,6 +118,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

This CHANGELOG.md was generated with the assistance of [ChatGPT by OpenAI](https://www.openai.com/research/chatgpt).

[3.1.0]: https://github.com/tofsjonas/sortable/releases/tag/3.1.0
[3.0.0]: https://github.com/tofsjonas/sortable/releases/tag/3.0.0
[2.4.0]: https://github.com/tofsjonas/sortable/releases/tag/2.4.0
[2.3.2]: https://github.com/tofsjonas/sortable/releases/tag/2.3.2
Expand Down
63 changes: 36 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
{
"name": "sortable-tablesort",
"version": "3.0.0",
"version": "3.1.0",
"description": "A tiny, Vanilla/Plain JavaScript table sorter",
"scripts": {
"dev": "tsc -w",
"test:watch": "jest --watchAll",
"test": "jest",
"lint": "eslint src/sortable.ts",
"build": "npm run compile && npm run sass",
"compile": "npm run compile:sortable && npm run compile:a11y",
"compile:sortable": "google-closure-compiler --js=./sortable.js --js_output_file=./sortable.min.js",
"compile:a11y": "google-closure-compiler --js=./sortable.a11y.js --js_output_file=./sortable.a11y.min.js",
"sass": "npm run sass:dist && npm run sass:dist:minify",
"sass:dist": "sass src/sortable.scss:sortable.css src/example.scss:example.css src/sortable-base.scss:sortable-base.css",
"sass:dist:minify": "sass src/sortable.scss:sortable.min.css src/example.scss:example.min.css src/sortable-base.scss:sortable-base.min.css --style compressed"
},
"author": "Jonas Earendel",
"license": "Unlicense",
"homepage": "https://github.com/tofsjonas/sortable",
"files": [
"./sortable*.*",
"./CHANGELOG.md"
],
"repository": {
"type": "git",
"url": "git+https://github.com/tofsjonas/sortable.git"
Expand All @@ -32,24 +17,48 @@
"vanilla",
"javascript"
],
"author": "Jonas Earendel",
"license": "Unlicense",
"scripts": {
"build": "npm run compile && npm run sass",
"compile": "npm run compile:sortable && npm run compile:a11y",
"compile:a11y": "google-closure-compiler --js=./sortable.a11y.js --js_output_file=./sortable.a11y.min.js",
"compile:sortable": "google-closure-compiler --js=./sortable.js --js_output_file=./sortable.min.js",
"dev": "rollup --config --watch --environment NODE_ENV:development --bundleConfigAsCjs",
"lint": "eslint src/sortable.ts",
"prepare": "node ./scripts/prepare.js",
"pre-push": "npm run build && npm run lint && npm run test && npm run test:min",
"sass": "npm run sass:dist && npm run sass:dist:minify",
"sass:dist": "sass src/sortable.scss:sortable.css src/example.scss:example.css src/sortable-base.scss:sortable-base.css",
"sass:dist:minify": "sass src/sortable.scss:sortable.min.css src/example.scss:example.min.css src/sortable-base.scss:sortable-base.min.css --style compressed",
"test": "jest",
"test:min": "cross-env USE_MINIFIED=true jest",
"test:watch": "jest --watchAll"
},
"files": [
"./src",
"./sortable*.*",
"./CHANGELOG.md"
],
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.4",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"babel-jest": "^29.7.0",
"eslint": "^8.51.0",
"cross-env": "^7.0.3",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"google-closure-compiler": "^20230802.0.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jsdom": "^22.1.0",
"prettier": "^3.0.3",
"sass": "^1.69.3",
"prettier": "^3.1.0",
"rollup": "^4.4.1",
"sass": "^1.69.5",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit c2a6fbf

Please sign in to comment.