Skip to content

Improved proxy recording mode + typescript conversion with wabac.js 2.20 #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 110 additions & 31 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,34 +1,113 @@
/* eslint-env node */
/** @type {import('eslint').Linter.Config} */
module.exports = {
"env": {
"browser": true,
"es6": true,
"webextensions": true
parser: "@typescript-eslint/parser",
env: {
browser: true,
commonjs: true,
es2017: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"prettier"
],
plugins: ["@typescript-eslint"],
parserOptions: {
project: ["./tsconfig.eslint.json"],
tsconfigRootDir: __dirname,
},
root: true,
rules: {
/* start stylistic rules */
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-imports": [
"error",
{
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/class-literal-property-style": ["warn", "getters"],
"@typescript-eslint/consistent-generic-constructors": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/prefer-for-of": "warn",
// "@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/no-meaningless-void-operator": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "warn",
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
"@typescript-eslint/promise-function-async": "warn",
/* end stylistic rules */

/* start recommended rules */
"no-restricted-globals": [2, "event", "error"],
"@typescript-eslint/no-base-to-string": "warn",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-duplicate-type-constituents": "warn",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-for-in-array": "warn",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"no-implied-eval": "off",
"@typescript-eslint/no-implied-eval": "error",
"no-loss-of-precision": "off",
"@typescript-eslint/no-loss-of-precision": "warn",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{ checksVoidReturn: false },
],
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
/* TODO eventually turn all these on */
"@typescript-eslint/no-unsafe-argument": "warn",
// "@typescript-eslint/no-unsafe-assignment": "warn",
// "@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
// "@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/prefer-as-const": "warn",
"require-await": "off",
// "@typescript-eslint/require-await": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/method-signature-style": "error",
"@typescript-eslint/await-thenable": "error",
},
reportUnusedDisableDirectives: true,
ignorePatterns: ["__generated__", "__mocks__", "dist", "static"],
overrides: [
{
extends: ["plugin:@typescript-eslint/disable-type-checked"],
files: ["webpack.*.js", ".*.cjs"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"no-restricted-globals": [
2,
"event", "error"
],
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
],
};
37 changes: 25 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,55 @@
{
"name": "@webrecorder/awp-sw",
"browser": "dist/sw.js",
"version": "0.4.4",
"main": "index.js",
"browser": "dist/index.js",
"version": "0.5.0",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/webrecorder/awp-sw.git"
},
"license": "AGPL-3.0-or-later",
"exports": {
".": "./src/index.js"
".": {
"types": "./dist/types/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"src/*"
"src/*",
"dist/*"
],
"dependencies": {
"@ipld/car": "^5.3.1",
"@ipld/car": "^5.3.2",
"@ipld/unixfs": "^3.0.0",
"@webrecorder/wabac": "^2.18.1",
"@webrecorder/wabac": "^2.20.0",
"auto-js-ipfs": "^2.3.0",
"client-zip": "^2.3.0",
"hash-wasm": "^4.9.0",
"idb": "^7.1.1",
"p-queue": "^7.3.4",
"p-queue": "^8.0.1",
"uuid": "^9.0.0",
"warcio": "^2.2.1"
"warcio": "^2.3.1"
},
"scripts": {
"build": "webpack --mode production",
"build-dev": "webpack --mode development",
"start-dev": "webpack serve --mode development --port 10001 --output-path ./dist --static ${PWD}",
"lint": "eslint ./src webpack.config.cjs"
"lint": "eslint ./src",
"format:check": "prettier --check ./src/",
"format": "prettier --write ./src/"
},
"devDependencies": {
"eslint": "^8.28.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"eslint": "^8.56.1",
"eslint-config-prettier": "^9.1.0",
"prettier": "^3.3.3",
"raw-loader": "^4.0.2",
"webpack": "^5.91.0",
"ts-loader": "^9.5.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.5.4",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4"
},
"description": "This library has been factored out of [ArchiveWeb.page](https://webrecorder/archiveweb.page) and represents the core service worker implementation necessarily for high-fidelity web archiving.",
Expand Down
Loading
Loading