commit 5b367486ced944472e7e8dd3f54479934953ddc7 Author: Yanzhen Yu Date: Wed Apr 1 12:00:00 2026 +0800 init the repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..6ccc9d84 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.vscode +node_modules +package-lock.json +build diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..1502887d --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "es5" +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..98c66522 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# rrweb-snapshot + +Not ready yet diff --git a/package.json b/package.json new file mode 100644 index 00000000..c8c0d7d1 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "rrweb-snapshot", + "version": "0.1.0", + "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", + "main": "index.js", + "scripts": { + "test": "mocha -r ts-node/register src/**/*.test.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/rrweb-io/rrweb-snapshot.git" + }, + "keywords": [ + "rrweb", + "snapshot", + "DOM" + ], + "author": "yanzhen@smartx.com", + "license": "MIT", + "bugs": { + "url": "https://github.com/rrweb-io/rrweb-snapshot/issues" + }, + "homepage": "https://github.com/rrweb-io/rrweb-snapshot#readme", + "devDependencies": { + "@types/chai": "^4.1.4", + "@types/mocha": "^5.2.5", + "chai": "^4.1.2", + "mocha": "^5.2.0", + "ts-node": "^7.0.1", + "tslint": "^4.5.1", + "typescript": "^3.0.3" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..1aec14ff --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "rootDir": "src", + "outDir": "build" + }, + "compileOnSave": true +} \ No newline at end of file diff --git a/tslint.json b/tslint.json new file mode 100644 index 00000000..c82ebf60 --- /dev/null +++ b/tslint.json @@ -0,0 +1,14 @@ +{ + "defaultSeverity": "error", + "extends": ["tslint:recommended"], + "jsRules": {}, + "rules": { + "no-any": true, + "quotemark": [true, "single"], + "ordered-imports": false, + "object-literal-sort-keys": false, + "no-unused-variable": true, + "object-literal-key-quotes": false + }, + "rulesDirectory": [] +} \ No newline at end of file