├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .npmrc ├── LICENSE ├── README.md ├── esbuild.config.mjs ├── main.ts ├── manifest.json ├── package-lock.json ├── package.json ├── styles.css ├── tsconfig.json ├── version-bump.mjs └── versions.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | insert_final_newline = true 8 | indent_style = tab 9 | indent_size = 4 10 | tab_width = 4 11 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | main.js 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "env": { "node": true }, 5 | "plugins": [ 6 | "@typescript-eslint" 7 | ], 8 | "extends": [ 9 | "eslint:recommended", 10 | "plugin:@typescript-eslint/eslint-recommended", 11 | "plugin:@typescript-eslint/recommended" 12 | ], 13 | "parserOptions": { 14 | "sourceType": "module" 15 | }, 16 | "rules": { 17 | "no-unused-vars": "off", 18 | "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], 19 | "@typescript-eslint/ban-ts-comment": "off", 20 | "no-prototype-builtins": "off", 21 | "@typescript-eslint/no-empty-function": "off" 22 | } 23 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # vscode 2 | .vscode 3 | 4 | # Intellij 5 | *.iml 6 | .idea 7 | 8 | # npm 9 | node_modules 10 | 11 | # Don't include the compiled main.js file in the repo. 12 | # They should be uploaded to GitHub releases instead. 13 | main.js 14 | 15 | # Exclude sourcemaps 16 | *.map 17 | 18 | # obsidian 19 | data.json 20 | 21 | # Exclude macOS Finder (System Explorer) View States 22 | .DS_Store 23 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | tag-version-prefix="" -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 al3xw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Force Read Mode 2 | 3 | **Force Read Mode** is a simple Obsidian plugin that ensures all markdown files within specified folders are always opened in read (preview) mode. It’s useful when you want to prevent accidental edits or enforce a read-only experience in certain folders. 4 | 5 | ## Features 6 | 7 | - Automatically switches markdown files to read mode (preview) when opened from specified folders. 8 | - Supports multiple folder paths. 9 | - Simple settings interface to configure folder paths. 10 | - Quickly disable the plugin using the Command Palette: 11 | - Use "Force Read Mode: Disable" to deactivate. 12 | - Use "Force Read Mode: Enable" to activate. 13 | 14 | ## How to Use 15 | 16 | 1. Go to **Settings → Community Plugins → Browse** and install the **Force Read Mode** plugin. 17 | 2. Enable the plugin from **Settings → Community Plugins**. 18 | 3. Open **Settings → Force Read Mode** to configure: 19 | - Add folder paths where you want markdown files to open in read mode (one path per line). 20 | 4. Use the Command Palette (Ctrl+P or Cmd+P) to toggle the plugin on or off with "Force Read Mode: Enable" or "Force Read Mode: Disable". 21 | 22 | ## Development 23 | 24 | To contribute or modify this plugin: 25 | 26 | 1. Clone the repository. 27 | 2. Install dependencies using `npm install`. 28 | 3. Build the plugin with `npm run build`. 29 | 4. Load the plugin into Obsidian for testing. 30 | 5. To contribute, open a PR with your changes 31 | -------------------------------------------------------------------------------- /esbuild.config.mjs: -------------------------------------------------------------------------------- 1 | import esbuild from "esbuild"; 2 | import process from "process"; 3 | import builtins from "builtin-modules"; 4 | 5 | const banner = 6 | `/* 7 | THIS IS A GENERATED/BUNDLED FILE BY ESBUILD 8 | if you want to view the source, please visit the github repository of this plugin 9 | */ 10 | `; 11 | 12 | const prod = (process.argv[2] === "production"); 13 | 14 | const context = await esbuild.context({ 15 | banner: { 16 | js: banner, 17 | }, 18 | entryPoints: ["main.ts"], 19 | bundle: true, 20 | external: [ 21 | "obsidian", 22 | "electron", 23 | "@codemirror/autocomplete", 24 | "@codemirror/collab", 25 | "@codemirror/commands", 26 | "@codemirror/language", 27 | "@codemirror/lint", 28 | "@codemirror/search", 29 | "@codemirror/state", 30 | "@codemirror/view", 31 | "@lezer/common", 32 | "@lezer/highlight", 33 | "@lezer/lr", 34 | ...builtins], 35 | format: "cjs", 36 | target: "es2018", 37 | logLevel: "info", 38 | sourcemap: prod ? false : "inline", 39 | treeShaking: true, 40 | outfile: "main.js", 41 | minify: prod, 42 | }); 43 | 44 | if (prod) { 45 | await context.rebuild(); 46 | process.exit(0); 47 | } else { 48 | await context.watch(); 49 | } 50 | -------------------------------------------------------------------------------- /main.ts: -------------------------------------------------------------------------------- 1 | import { Plugin, MarkdownView, Notice, PluginSettingTab, Setting } from 'obsidian'; 2 | 3 | 4 | interface ForceReadModePluginSettings { 5 | targetFolderPaths: string[]; // Array of folder paths 6 | } 7 | 8 | const DEFAULT_SETTINGS: ForceReadModePluginSettings = { 9 | targetFolderPaths: [ ] // Array of folder paths is empty by default 10 | }; 11 | 12 | 13 | export default class ForceReadModePlugin extends Plugin { 14 | settings: ForceReadModePluginSettings; 15 | isEnabled: boolean = true; 16 | 17 | // Plugin initialization 18 | async onload() { 19 | // Load settings 20 | await this.loadSettings(); 21 | 22 | // Register the settings tab 23 | this.addSettingTab(new ForceReadModeSettingTab(this.app, this)); 24 | 25 | // Register an event for when the layout changes 26 | this.registerEvent( 27 | this.app.workspace.on('layout-change', this.onLayoutChange.bind(this)) 28 | ); 29 | 30 | // Add command to toggle the plugin 31 | this.toggleCommand(); 32 | } 33 | 34 | // set command according to boolean isEnabled 35 | toggleCommand(){ 36 | this.addCommand({ 37 | id: 'toggle-force-read-mode', 38 | name: this.isEnabled ? 'Disable' : 'Enable', 39 | callback: () => { 40 | this.isEnabled = !this.isEnabled; 41 | new Notice(`Force Read Mode ${this.isEnabled ? 'Enabled' : 'Disabled'}`); 42 | this.toggleCommand(); 43 | } 44 | }); 45 | } 46 | 47 | // Handle layout changes 48 | private async onLayoutChange() { 49 | // Get all open leaves in the workspace 50 | const leaves = this.app.workspace.getLeavesOfType('markdown'); 51 | 52 | // Check if plugin is temporarly disabled 53 | if (!this.isEnabled) { 54 | return; 55 | } 56 | 57 | // Iterate over each leaf 58 | leaves.forEach((leaf) => { 59 | // Ensure the leaf has a MarkdownView 60 | if (!(leaf.view instanceof MarkdownView)) { 61 | return; 62 | } 63 | 64 | // Get the file currently opened in the leaf 65 | const file = leaf.view.file; 66 | 67 | // If no file is present, skip 68 | if (!file) { 69 | return; 70 | } 71 | 72 | // Check if the file is within any of the target folders or their subfolders 73 | const isInTargetFolder = this.settings.targetFolderPaths.some(path => file.path.startsWith(path)); 74 | 75 | if (!isInTargetFolder) { 76 | return; 77 | } 78 | 79 | // Force the view into preview (read mode) 80 | leaf.setViewState({ 81 | ...leaf.getViewState(), 82 | state: { mode: 'preview' } // Force preview (read mode) 83 | }); 84 | }); 85 | } 86 | 87 | // Load settings 88 | async loadSettings() { 89 | this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); 90 | } 91 | 92 | // Save settings 93 | async saveSettings() { 94 | await this.saveData(this.settings); 95 | } 96 | } 97 | 98 | class ForceReadModeSettingTab extends PluginSettingTab { 99 | plugin: ForceReadModePlugin; 100 | 101 | constructor(app: any, plugin: ForceReadModePlugin) { 102 | super(app, plugin); 103 | this.plugin = plugin; 104 | } 105 | 106 | display(): void { 107 | const { containerEl } = this; 108 | 109 | containerEl.empty(); 110 | 111 | // Add a setting for folder paths 112 | new Setting(containerEl) 113 | .setName('Target folder paths') 114 | .setDesc('Specify the folder paths where markdown files should always open in read mode.') 115 | .addTextArea(text => text 116 | .setPlaceholder('Enter folder paths, one per line') 117 | .setValue(this.plugin.settings.targetFolderPaths.join('\n')) 118 | .onChange(async (value) => { 119 | // Update the settings with the new folder paths 120 | this.plugin.settings.targetFolderPaths = value.split('\n').map(path => path.trim()).filter(path => path.length > 0); 121 | await this.plugin.saveSettings(); 122 | })); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "force-read-mode", 3 | "name": "Force Read Mode", 4 | "version": "1.0.3", 5 | "minAppVersion": "0.15.0", 6 | "description": "Forces Markdown files in specified folders to open in read-only mode.", 7 | "author": "al3xw", 8 | "authorUrl": "https://github.com/al3xw", 9 | "isDesktopOnly": false 10 | } 11 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "force-read-mode", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "force-read-mode", 9 | "version": "1.0.0", 10 | "license": "MIT", 11 | "devDependencies": { 12 | "@types/node": "^16.11.6", 13 | "@typescript-eslint/eslint-plugin": "5.29.0", 14 | "@typescript-eslint/parser": "5.29.0", 15 | "builtin-modules": "3.3.0", 16 | "esbuild": "0.17.3", 17 | "obsidian": "latest", 18 | "tslib": "2.4.0", 19 | "typescript": "4.7.4" 20 | } 21 | }, 22 | "node_modules/@codemirror/state": { 23 | "version": "6.4.1", 24 | "dev": true, 25 | "license": "MIT", 26 | "peer": true 27 | }, 28 | "node_modules/@codemirror/view": { 29 | "version": "6.34.1", 30 | "dev": true, 31 | "license": "MIT", 32 | "peer": true, 33 | "dependencies": { 34 | "@codemirror/state": "^6.4.0", 35 | "style-mod": "^4.1.0", 36 | "w3c-keyname": "^2.2.4" 37 | } 38 | }, 39 | "node_modules/@esbuild/linux-x64": { 40 | "version": "0.17.3", 41 | "cpu": [ 42 | "x64" 43 | ], 44 | "dev": true, 45 | "license": "MIT", 46 | "optional": true, 47 | "os": [ 48 | "linux" 49 | ], 50 | "engines": { 51 | "node": ">=12" 52 | } 53 | }, 54 | "node_modules/@eslint-community/eslint-utils": { 55 | "version": "4.4.0", 56 | "dev": true, 57 | "license": "MIT", 58 | "peer": true, 59 | "dependencies": { 60 | "eslint-visitor-keys": "^3.3.0" 61 | }, 62 | "engines": { 63 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 64 | }, 65 | "peerDependencies": { 66 | "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" 67 | } 68 | }, 69 | "node_modules/@eslint-community/regexpp": { 70 | "version": "4.11.1", 71 | "dev": true, 72 | "license": "MIT", 73 | "peer": true, 74 | "engines": { 75 | "node": "^12.0.0 || ^14.0.0 || >=16.0.0" 76 | } 77 | }, 78 | "node_modules/@eslint/eslintrc": { 79 | "version": "2.1.4", 80 | "dev": true, 81 | "license": "MIT", 82 | "peer": true, 83 | "dependencies": { 84 | "ajv": "^6.12.4", 85 | "debug": "^4.3.2", 86 | "espree": "^9.6.0", 87 | "globals": "^13.19.0", 88 | "ignore": "^5.2.0", 89 | "import-fresh": "^3.2.1", 90 | "js-yaml": "^4.1.0", 91 | "minimatch": "^3.1.2", 92 | "strip-json-comments": "^3.1.1" 93 | }, 94 | "engines": { 95 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 96 | }, 97 | "funding": { 98 | "url": "https://opencollective.com/eslint" 99 | } 100 | }, 101 | "node_modules/@eslint/js": { 102 | "version": "8.57.1", 103 | "dev": true, 104 | "license": "MIT", 105 | "peer": true, 106 | "engines": { 107 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 108 | } 109 | }, 110 | "node_modules/@humanwhocodes/config-array": { 111 | "version": "0.13.0", 112 | "dev": true, 113 | "license": "Apache-2.0", 114 | "peer": true, 115 | "dependencies": { 116 | "@humanwhocodes/object-schema": "^2.0.3", 117 | "debug": "^4.3.1", 118 | "minimatch": "^3.0.5" 119 | }, 120 | "engines": { 121 | "node": ">=10.10.0" 122 | } 123 | }, 124 | "node_modules/@humanwhocodes/module-importer": { 125 | "version": "1.0.1", 126 | "dev": true, 127 | "license": "Apache-2.0", 128 | "peer": true, 129 | "engines": { 130 | "node": ">=12.22" 131 | }, 132 | "funding": { 133 | "type": "github", 134 | "url": "https://github.com/sponsors/nzakas" 135 | } 136 | }, 137 | "node_modules/@humanwhocodes/object-schema": { 138 | "version": "2.0.3", 139 | "dev": true, 140 | "license": "BSD-3-Clause", 141 | "peer": true 142 | }, 143 | "node_modules/@nodelib/fs.scandir": { 144 | "version": "2.1.5", 145 | "dev": true, 146 | "license": "MIT", 147 | "dependencies": { 148 | "@nodelib/fs.stat": "2.0.5", 149 | "run-parallel": "^1.1.9" 150 | }, 151 | "engines": { 152 | "node": ">= 8" 153 | } 154 | }, 155 | "node_modules/@nodelib/fs.stat": { 156 | "version": "2.0.5", 157 | "dev": true, 158 | "license": "MIT", 159 | "engines": { 160 | "node": ">= 8" 161 | } 162 | }, 163 | "node_modules/@nodelib/fs.walk": { 164 | "version": "1.2.8", 165 | "dev": true, 166 | "license": "MIT", 167 | "dependencies": { 168 | "@nodelib/fs.scandir": "2.1.5", 169 | "fastq": "^1.6.0" 170 | }, 171 | "engines": { 172 | "node": ">= 8" 173 | } 174 | }, 175 | "node_modules/@types/codemirror": { 176 | "version": "5.60.8", 177 | "dev": true, 178 | "license": "MIT", 179 | "dependencies": { 180 | "@types/tern": "*" 181 | } 182 | }, 183 | "node_modules/@types/estree": { 184 | "version": "1.0.6", 185 | "dev": true, 186 | "license": "MIT" 187 | }, 188 | "node_modules/@types/json-schema": { 189 | "version": "7.0.15", 190 | "dev": true, 191 | "license": "MIT" 192 | }, 193 | "node_modules/@types/node": { 194 | "version": "16.18.113", 195 | "dev": true, 196 | "license": "MIT" 197 | }, 198 | "node_modules/@types/tern": { 199 | "version": "0.23.9", 200 | "dev": true, 201 | "license": "MIT", 202 | "dependencies": { 203 | "@types/estree": "*" 204 | } 205 | }, 206 | "node_modules/@typescript-eslint/eslint-plugin": { 207 | "version": "5.29.0", 208 | "dev": true, 209 | "license": "MIT", 210 | "dependencies": { 211 | "@typescript-eslint/scope-manager": "5.29.0", 212 | "@typescript-eslint/type-utils": "5.29.0", 213 | "@typescript-eslint/utils": "5.29.0", 214 | "debug": "^4.3.4", 215 | "functional-red-black-tree": "^1.0.1", 216 | "ignore": "^5.2.0", 217 | "regexpp": "^3.2.0", 218 | "semver": "^7.3.7", 219 | "tsutils": "^3.21.0" 220 | }, 221 | "engines": { 222 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 223 | }, 224 | "funding": { 225 | "type": "opencollective", 226 | "url": "https://opencollective.com/typescript-eslint" 227 | }, 228 | "peerDependencies": { 229 | "@typescript-eslint/parser": "^5.0.0", 230 | "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" 231 | }, 232 | "peerDependenciesMeta": { 233 | "typescript": { 234 | "optional": true 235 | } 236 | } 237 | }, 238 | "node_modules/@typescript-eslint/parser": { 239 | "version": "5.29.0", 240 | "dev": true, 241 | "license": "BSD-2-Clause", 242 | "dependencies": { 243 | "@typescript-eslint/scope-manager": "5.29.0", 244 | "@typescript-eslint/types": "5.29.0", 245 | "@typescript-eslint/typescript-estree": "5.29.0", 246 | "debug": "^4.3.4" 247 | }, 248 | "engines": { 249 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 250 | }, 251 | "funding": { 252 | "type": "opencollective", 253 | "url": "https://opencollective.com/typescript-eslint" 254 | }, 255 | "peerDependencies": { 256 | "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" 257 | }, 258 | "peerDependenciesMeta": { 259 | "typescript": { 260 | "optional": true 261 | } 262 | } 263 | }, 264 | "node_modules/@typescript-eslint/scope-manager": { 265 | "version": "5.29.0", 266 | "dev": true, 267 | "license": "MIT", 268 | "dependencies": { 269 | "@typescript-eslint/types": "5.29.0", 270 | "@typescript-eslint/visitor-keys": "5.29.0" 271 | }, 272 | "engines": { 273 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 274 | }, 275 | "funding": { 276 | "type": "opencollective", 277 | "url": "https://opencollective.com/typescript-eslint" 278 | } 279 | }, 280 | "node_modules/@typescript-eslint/type-utils": { 281 | "version": "5.29.0", 282 | "dev": true, 283 | "license": "MIT", 284 | "dependencies": { 285 | "@typescript-eslint/utils": "5.29.0", 286 | "debug": "^4.3.4", 287 | "tsutils": "^3.21.0" 288 | }, 289 | "engines": { 290 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 291 | }, 292 | "funding": { 293 | "type": "opencollective", 294 | "url": "https://opencollective.com/typescript-eslint" 295 | }, 296 | "peerDependencies": { 297 | "eslint": "*" 298 | }, 299 | "peerDependenciesMeta": { 300 | "typescript": { 301 | "optional": true 302 | } 303 | } 304 | }, 305 | "node_modules/@typescript-eslint/types": { 306 | "version": "5.29.0", 307 | "dev": true, 308 | "license": "MIT", 309 | "engines": { 310 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 311 | }, 312 | "funding": { 313 | "type": "opencollective", 314 | "url": "https://opencollective.com/typescript-eslint" 315 | } 316 | }, 317 | "node_modules/@typescript-eslint/typescript-estree": { 318 | "version": "5.29.0", 319 | "dev": true, 320 | "license": "BSD-2-Clause", 321 | "dependencies": { 322 | "@typescript-eslint/types": "5.29.0", 323 | "@typescript-eslint/visitor-keys": "5.29.0", 324 | "debug": "^4.3.4", 325 | "globby": "^11.1.0", 326 | "is-glob": "^4.0.3", 327 | "semver": "^7.3.7", 328 | "tsutils": "^3.21.0" 329 | }, 330 | "engines": { 331 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 332 | }, 333 | "funding": { 334 | "type": "opencollective", 335 | "url": "https://opencollective.com/typescript-eslint" 336 | }, 337 | "peerDependenciesMeta": { 338 | "typescript": { 339 | "optional": true 340 | } 341 | } 342 | }, 343 | "node_modules/@typescript-eslint/utils": { 344 | "version": "5.29.0", 345 | "dev": true, 346 | "license": "MIT", 347 | "dependencies": { 348 | "@types/json-schema": "^7.0.9", 349 | "@typescript-eslint/scope-manager": "5.29.0", 350 | "@typescript-eslint/types": "5.29.0", 351 | "@typescript-eslint/typescript-estree": "5.29.0", 352 | "eslint-scope": "^5.1.1", 353 | "eslint-utils": "^3.0.0" 354 | }, 355 | "engines": { 356 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 357 | }, 358 | "funding": { 359 | "type": "opencollective", 360 | "url": "https://opencollective.com/typescript-eslint" 361 | }, 362 | "peerDependencies": { 363 | "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" 364 | } 365 | }, 366 | "node_modules/@typescript-eslint/visitor-keys": { 367 | "version": "5.29.0", 368 | "dev": true, 369 | "license": "MIT", 370 | "dependencies": { 371 | "@typescript-eslint/types": "5.29.0", 372 | "eslint-visitor-keys": "^3.3.0" 373 | }, 374 | "engines": { 375 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 376 | }, 377 | "funding": { 378 | "type": "opencollective", 379 | "url": "https://opencollective.com/typescript-eslint" 380 | } 381 | }, 382 | "node_modules/@ungap/structured-clone": { 383 | "version": "1.2.0", 384 | "dev": true, 385 | "license": "ISC", 386 | "peer": true 387 | }, 388 | "node_modules/acorn": { 389 | "version": "8.12.1", 390 | "dev": true, 391 | "license": "MIT", 392 | "peer": true, 393 | "bin": { 394 | "acorn": "bin/acorn" 395 | }, 396 | "engines": { 397 | "node": ">=0.4.0" 398 | } 399 | }, 400 | "node_modules/acorn-jsx": { 401 | "version": "5.3.2", 402 | "dev": true, 403 | "license": "MIT", 404 | "peer": true, 405 | "peerDependencies": { 406 | "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 407 | } 408 | }, 409 | "node_modules/ajv": { 410 | "version": "6.12.6", 411 | "dev": true, 412 | "license": "MIT", 413 | "peer": true, 414 | "dependencies": { 415 | "fast-deep-equal": "^3.1.1", 416 | "fast-json-stable-stringify": "^2.0.0", 417 | "json-schema-traverse": "^0.4.1", 418 | "uri-js": "^4.2.2" 419 | }, 420 | "funding": { 421 | "type": "github", 422 | "url": "https://github.com/sponsors/epoberezkin" 423 | } 424 | }, 425 | "node_modules/ansi-regex": { 426 | "version": "5.0.1", 427 | "dev": true, 428 | "license": "MIT", 429 | "peer": true, 430 | "engines": { 431 | "node": ">=8" 432 | } 433 | }, 434 | "node_modules/ansi-styles": { 435 | "version": "4.3.0", 436 | "dev": true, 437 | "license": "MIT", 438 | "peer": true, 439 | "dependencies": { 440 | "color-convert": "^2.0.1" 441 | }, 442 | "engines": { 443 | "node": ">=8" 444 | }, 445 | "funding": { 446 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 447 | } 448 | }, 449 | "node_modules/argparse": { 450 | "version": "2.0.1", 451 | "dev": true, 452 | "license": "Python-2.0", 453 | "peer": true 454 | }, 455 | "node_modules/array-union": { 456 | "version": "2.1.0", 457 | "dev": true, 458 | "license": "MIT", 459 | "engines": { 460 | "node": ">=8" 461 | } 462 | }, 463 | "node_modules/balanced-match": { 464 | "version": "1.0.2", 465 | "dev": true, 466 | "license": "MIT", 467 | "peer": true 468 | }, 469 | "node_modules/brace-expansion": { 470 | "version": "1.1.11", 471 | "dev": true, 472 | "license": "MIT", 473 | "peer": true, 474 | "dependencies": { 475 | "balanced-match": "^1.0.0", 476 | "concat-map": "0.0.1" 477 | } 478 | }, 479 | "node_modules/braces": { 480 | "version": "3.0.3", 481 | "dev": true, 482 | "license": "MIT", 483 | "dependencies": { 484 | "fill-range": "^7.1.1" 485 | }, 486 | "engines": { 487 | "node": ">=8" 488 | } 489 | }, 490 | "node_modules/builtin-modules": { 491 | "version": "3.3.0", 492 | "dev": true, 493 | "license": "MIT", 494 | "engines": { 495 | "node": ">=6" 496 | }, 497 | "funding": { 498 | "url": "https://github.com/sponsors/sindresorhus" 499 | } 500 | }, 501 | "node_modules/callsites": { 502 | "version": "3.1.0", 503 | "dev": true, 504 | "license": "MIT", 505 | "peer": true, 506 | "engines": { 507 | "node": ">=6" 508 | } 509 | }, 510 | "node_modules/chalk": { 511 | "version": "4.1.2", 512 | "dev": true, 513 | "license": "MIT", 514 | "peer": true, 515 | "dependencies": { 516 | "ansi-styles": "^4.1.0", 517 | "supports-color": "^7.1.0" 518 | }, 519 | "engines": { 520 | "node": ">=10" 521 | }, 522 | "funding": { 523 | "url": "https://github.com/chalk/chalk?sponsor=1" 524 | } 525 | }, 526 | "node_modules/color-convert": { 527 | "version": "2.0.1", 528 | "dev": true, 529 | "license": "MIT", 530 | "peer": true, 531 | "dependencies": { 532 | "color-name": "~1.1.4" 533 | }, 534 | "engines": { 535 | "node": ">=7.0.0" 536 | } 537 | }, 538 | "node_modules/color-name": { 539 | "version": "1.1.4", 540 | "dev": true, 541 | "license": "MIT", 542 | "peer": true 543 | }, 544 | "node_modules/concat-map": { 545 | "version": "0.0.1", 546 | "dev": true, 547 | "license": "MIT", 548 | "peer": true 549 | }, 550 | "node_modules/cross-spawn": { 551 | "version": "7.0.3", 552 | "dev": true, 553 | "license": "MIT", 554 | "peer": true, 555 | "dependencies": { 556 | "path-key": "^3.1.0", 557 | "shebang-command": "^2.0.0", 558 | "which": "^2.0.1" 559 | }, 560 | "engines": { 561 | "node": ">= 8" 562 | } 563 | }, 564 | "node_modules/debug": { 565 | "version": "4.3.7", 566 | "dev": true, 567 | "license": "MIT", 568 | "dependencies": { 569 | "ms": "^2.1.3" 570 | }, 571 | "engines": { 572 | "node": ">=6.0" 573 | }, 574 | "peerDependenciesMeta": { 575 | "supports-color": { 576 | "optional": true 577 | } 578 | } 579 | }, 580 | "node_modules/deep-is": { 581 | "version": "0.1.4", 582 | "dev": true, 583 | "license": "MIT", 584 | "peer": true 585 | }, 586 | "node_modules/dir-glob": { 587 | "version": "3.0.1", 588 | "dev": true, 589 | "license": "MIT", 590 | "dependencies": { 591 | "path-type": "^4.0.0" 592 | }, 593 | "engines": { 594 | "node": ">=8" 595 | } 596 | }, 597 | "node_modules/doctrine": { 598 | "version": "3.0.0", 599 | "dev": true, 600 | "license": "Apache-2.0", 601 | "peer": true, 602 | "dependencies": { 603 | "esutils": "^2.0.2" 604 | }, 605 | "engines": { 606 | "node": ">=6.0.0" 607 | } 608 | }, 609 | "node_modules/esbuild": { 610 | "version": "0.17.3", 611 | "dev": true, 612 | "hasInstallScript": true, 613 | "license": "MIT", 614 | "bin": { 615 | "esbuild": "bin/esbuild" 616 | }, 617 | "engines": { 618 | "node": ">=12" 619 | }, 620 | "optionalDependencies": { 621 | "@esbuild/android-arm": "0.17.3", 622 | "@esbuild/android-arm64": "0.17.3", 623 | "@esbuild/android-x64": "0.17.3", 624 | "@esbuild/darwin-arm64": "0.17.3", 625 | "@esbuild/darwin-x64": "0.17.3", 626 | "@esbuild/freebsd-arm64": "0.17.3", 627 | "@esbuild/freebsd-x64": "0.17.3", 628 | "@esbuild/linux-arm": "0.17.3", 629 | "@esbuild/linux-arm64": "0.17.3", 630 | "@esbuild/linux-ia32": "0.17.3", 631 | "@esbuild/linux-loong64": "0.17.3", 632 | "@esbuild/linux-mips64el": "0.17.3", 633 | "@esbuild/linux-ppc64": "0.17.3", 634 | "@esbuild/linux-riscv64": "0.17.3", 635 | "@esbuild/linux-s390x": "0.17.3", 636 | "@esbuild/linux-x64": "0.17.3", 637 | "@esbuild/netbsd-x64": "0.17.3", 638 | "@esbuild/openbsd-x64": "0.17.3", 639 | "@esbuild/sunos-x64": "0.17.3", 640 | "@esbuild/win32-arm64": "0.17.3", 641 | "@esbuild/win32-ia32": "0.17.3", 642 | "@esbuild/win32-x64": "0.17.3" 643 | } 644 | }, 645 | "node_modules/escape-string-regexp": { 646 | "version": "4.0.0", 647 | "dev": true, 648 | "license": "MIT", 649 | "peer": true, 650 | "engines": { 651 | "node": ">=10" 652 | }, 653 | "funding": { 654 | "url": "https://github.com/sponsors/sindresorhus" 655 | } 656 | }, 657 | "node_modules/eslint": { 658 | "version": "8.57.1", 659 | "dev": true, 660 | "license": "MIT", 661 | "peer": true, 662 | "dependencies": { 663 | "@eslint-community/eslint-utils": "^4.2.0", 664 | "@eslint-community/regexpp": "^4.6.1", 665 | "@eslint/eslintrc": "^2.1.4", 666 | "@eslint/js": "8.57.1", 667 | "@humanwhocodes/config-array": "^0.13.0", 668 | "@humanwhocodes/module-importer": "^1.0.1", 669 | "@nodelib/fs.walk": "^1.2.8", 670 | "@ungap/structured-clone": "^1.2.0", 671 | "ajv": "^6.12.4", 672 | "chalk": "^4.0.0", 673 | "cross-spawn": "^7.0.2", 674 | "debug": "^4.3.2", 675 | "doctrine": "^3.0.0", 676 | "escape-string-regexp": "^4.0.0", 677 | "eslint-scope": "^7.2.2", 678 | "eslint-visitor-keys": "^3.4.3", 679 | "espree": "^9.6.1", 680 | "esquery": "^1.4.2", 681 | "esutils": "^2.0.2", 682 | "fast-deep-equal": "^3.1.3", 683 | "file-entry-cache": "^6.0.1", 684 | "find-up": "^5.0.0", 685 | "glob-parent": "^6.0.2", 686 | "globals": "^13.19.0", 687 | "graphemer": "^1.4.0", 688 | "ignore": "^5.2.0", 689 | "imurmurhash": "^0.1.4", 690 | "is-glob": "^4.0.0", 691 | "is-path-inside": "^3.0.3", 692 | "js-yaml": "^4.1.0", 693 | "json-stable-stringify-without-jsonify": "^1.0.1", 694 | "levn": "^0.4.1", 695 | "lodash.merge": "^4.6.2", 696 | "minimatch": "^3.1.2", 697 | "natural-compare": "^1.4.0", 698 | "optionator": "^0.9.3", 699 | "strip-ansi": "^6.0.1", 700 | "text-table": "^0.2.0" 701 | }, 702 | "bin": { 703 | "eslint": "bin/eslint.js" 704 | }, 705 | "engines": { 706 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 707 | }, 708 | "funding": { 709 | "url": "https://opencollective.com/eslint" 710 | } 711 | }, 712 | "node_modules/eslint-scope": { 713 | "version": "5.1.1", 714 | "dev": true, 715 | "license": "BSD-2-Clause", 716 | "dependencies": { 717 | "esrecurse": "^4.3.0", 718 | "estraverse": "^4.1.1" 719 | }, 720 | "engines": { 721 | "node": ">=8.0.0" 722 | } 723 | }, 724 | "node_modules/eslint-utils": { 725 | "version": "3.0.0", 726 | "dev": true, 727 | "license": "MIT", 728 | "dependencies": { 729 | "eslint-visitor-keys": "^2.0.0" 730 | }, 731 | "engines": { 732 | "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" 733 | }, 734 | "funding": { 735 | "url": "https://github.com/sponsors/mysticatea" 736 | }, 737 | "peerDependencies": { 738 | "eslint": ">=5" 739 | } 740 | }, 741 | "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { 742 | "version": "2.1.0", 743 | "dev": true, 744 | "license": "Apache-2.0", 745 | "engines": { 746 | "node": ">=10" 747 | } 748 | }, 749 | "node_modules/eslint-visitor-keys": { 750 | "version": "3.4.3", 751 | "dev": true, 752 | "license": "Apache-2.0", 753 | "engines": { 754 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 755 | }, 756 | "funding": { 757 | "url": "https://opencollective.com/eslint" 758 | } 759 | }, 760 | "node_modules/eslint/node_modules/eslint-scope": { 761 | "version": "7.2.2", 762 | "dev": true, 763 | "license": "BSD-2-Clause", 764 | "peer": true, 765 | "dependencies": { 766 | "esrecurse": "^4.3.0", 767 | "estraverse": "^5.2.0" 768 | }, 769 | "engines": { 770 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 771 | }, 772 | "funding": { 773 | "url": "https://opencollective.com/eslint" 774 | } 775 | }, 776 | "node_modules/eslint/node_modules/estraverse": { 777 | "version": "5.3.0", 778 | "dev": true, 779 | "license": "BSD-2-Clause", 780 | "peer": true, 781 | "engines": { 782 | "node": ">=4.0" 783 | } 784 | }, 785 | "node_modules/espree": { 786 | "version": "9.6.1", 787 | "dev": true, 788 | "license": "BSD-2-Clause", 789 | "peer": true, 790 | "dependencies": { 791 | "acorn": "^8.9.0", 792 | "acorn-jsx": "^5.3.2", 793 | "eslint-visitor-keys": "^3.4.1" 794 | }, 795 | "engines": { 796 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 797 | }, 798 | "funding": { 799 | "url": "https://opencollective.com/eslint" 800 | } 801 | }, 802 | "node_modules/esquery": { 803 | "version": "1.6.0", 804 | "dev": true, 805 | "license": "BSD-3-Clause", 806 | "peer": true, 807 | "dependencies": { 808 | "estraverse": "^5.1.0" 809 | }, 810 | "engines": { 811 | "node": ">=0.10" 812 | } 813 | }, 814 | "node_modules/esquery/node_modules/estraverse": { 815 | "version": "5.3.0", 816 | "dev": true, 817 | "license": "BSD-2-Clause", 818 | "peer": true, 819 | "engines": { 820 | "node": ">=4.0" 821 | } 822 | }, 823 | "node_modules/esrecurse": { 824 | "version": "4.3.0", 825 | "dev": true, 826 | "license": "BSD-2-Clause", 827 | "dependencies": { 828 | "estraverse": "^5.2.0" 829 | }, 830 | "engines": { 831 | "node": ">=4.0" 832 | } 833 | }, 834 | "node_modules/esrecurse/node_modules/estraverse": { 835 | "version": "5.3.0", 836 | "dev": true, 837 | "license": "BSD-2-Clause", 838 | "engines": { 839 | "node": ">=4.0" 840 | } 841 | }, 842 | "node_modules/estraverse": { 843 | "version": "4.3.0", 844 | "dev": true, 845 | "license": "BSD-2-Clause", 846 | "engines": { 847 | "node": ">=4.0" 848 | } 849 | }, 850 | "node_modules/esutils": { 851 | "version": "2.0.3", 852 | "dev": true, 853 | "license": "BSD-2-Clause", 854 | "peer": true, 855 | "engines": { 856 | "node": ">=0.10.0" 857 | } 858 | }, 859 | "node_modules/fast-deep-equal": { 860 | "version": "3.1.3", 861 | "dev": true, 862 | "license": "MIT", 863 | "peer": true 864 | }, 865 | "node_modules/fast-glob": { 866 | "version": "3.3.2", 867 | "dev": true, 868 | "license": "MIT", 869 | "dependencies": { 870 | "@nodelib/fs.stat": "^2.0.2", 871 | "@nodelib/fs.walk": "^1.2.3", 872 | "glob-parent": "^5.1.2", 873 | "merge2": "^1.3.0", 874 | "micromatch": "^4.0.4" 875 | }, 876 | "engines": { 877 | "node": ">=8.6.0" 878 | } 879 | }, 880 | "node_modules/fast-glob/node_modules/glob-parent": { 881 | "version": "5.1.2", 882 | "dev": true, 883 | "license": "ISC", 884 | "dependencies": { 885 | "is-glob": "^4.0.1" 886 | }, 887 | "engines": { 888 | "node": ">= 6" 889 | } 890 | }, 891 | "node_modules/fast-json-stable-stringify": { 892 | "version": "2.1.0", 893 | "dev": true, 894 | "license": "MIT", 895 | "peer": true 896 | }, 897 | "node_modules/fast-levenshtein": { 898 | "version": "2.0.6", 899 | "dev": true, 900 | "license": "MIT", 901 | "peer": true 902 | }, 903 | "node_modules/fastq": { 904 | "version": "1.17.1", 905 | "dev": true, 906 | "license": "ISC", 907 | "dependencies": { 908 | "reusify": "^1.0.4" 909 | } 910 | }, 911 | "node_modules/file-entry-cache": { 912 | "version": "6.0.1", 913 | "dev": true, 914 | "license": "MIT", 915 | "peer": true, 916 | "dependencies": { 917 | "flat-cache": "^3.0.4" 918 | }, 919 | "engines": { 920 | "node": "^10.12.0 || >=12.0.0" 921 | } 922 | }, 923 | "node_modules/fill-range": { 924 | "version": "7.1.1", 925 | "dev": true, 926 | "license": "MIT", 927 | "dependencies": { 928 | "to-regex-range": "^5.0.1" 929 | }, 930 | "engines": { 931 | "node": ">=8" 932 | } 933 | }, 934 | "node_modules/find-up": { 935 | "version": "5.0.0", 936 | "dev": true, 937 | "license": "MIT", 938 | "peer": true, 939 | "dependencies": { 940 | "locate-path": "^6.0.0", 941 | "path-exists": "^4.0.0" 942 | }, 943 | "engines": { 944 | "node": ">=10" 945 | }, 946 | "funding": { 947 | "url": "https://github.com/sponsors/sindresorhus" 948 | } 949 | }, 950 | "node_modules/flat-cache": { 951 | "version": "3.2.0", 952 | "dev": true, 953 | "license": "MIT", 954 | "peer": true, 955 | "dependencies": { 956 | "flatted": "^3.2.9", 957 | "keyv": "^4.5.3", 958 | "rimraf": "^3.0.2" 959 | }, 960 | "engines": { 961 | "node": "^10.12.0 || >=12.0.0" 962 | } 963 | }, 964 | "node_modules/flatted": { 965 | "version": "3.3.1", 966 | "dev": true, 967 | "license": "ISC", 968 | "peer": true 969 | }, 970 | "node_modules/fs.realpath": { 971 | "version": "1.0.0", 972 | "dev": true, 973 | "license": "ISC", 974 | "peer": true 975 | }, 976 | "node_modules/functional-red-black-tree": { 977 | "version": "1.0.1", 978 | "dev": true, 979 | "license": "MIT" 980 | }, 981 | "node_modules/glob": { 982 | "version": "7.2.3", 983 | "dev": true, 984 | "license": "ISC", 985 | "peer": true, 986 | "dependencies": { 987 | "fs.realpath": "^1.0.0", 988 | "inflight": "^1.0.4", 989 | "inherits": "2", 990 | "minimatch": "^3.1.1", 991 | "once": "^1.3.0", 992 | "path-is-absolute": "^1.0.0" 993 | }, 994 | "engines": { 995 | "node": "*" 996 | }, 997 | "funding": { 998 | "url": "https://github.com/sponsors/isaacs" 999 | } 1000 | }, 1001 | "node_modules/glob-parent": { 1002 | "version": "6.0.2", 1003 | "dev": true, 1004 | "license": "ISC", 1005 | "peer": true, 1006 | "dependencies": { 1007 | "is-glob": "^4.0.3" 1008 | }, 1009 | "engines": { 1010 | "node": ">=10.13.0" 1011 | } 1012 | }, 1013 | "node_modules/globals": { 1014 | "version": "13.24.0", 1015 | "dev": true, 1016 | "license": "MIT", 1017 | "peer": true, 1018 | "dependencies": { 1019 | "type-fest": "^0.20.2" 1020 | }, 1021 | "engines": { 1022 | "node": ">=8" 1023 | }, 1024 | "funding": { 1025 | "url": "https://github.com/sponsors/sindresorhus" 1026 | } 1027 | }, 1028 | "node_modules/globby": { 1029 | "version": "11.1.0", 1030 | "dev": true, 1031 | "license": "MIT", 1032 | "dependencies": { 1033 | "array-union": "^2.1.0", 1034 | "dir-glob": "^3.0.1", 1035 | "fast-glob": "^3.2.9", 1036 | "ignore": "^5.2.0", 1037 | "merge2": "^1.4.1", 1038 | "slash": "^3.0.0" 1039 | }, 1040 | "engines": { 1041 | "node": ">=10" 1042 | }, 1043 | "funding": { 1044 | "url": "https://github.com/sponsors/sindresorhus" 1045 | } 1046 | }, 1047 | "node_modules/graphemer": { 1048 | "version": "1.4.0", 1049 | "dev": true, 1050 | "license": "MIT", 1051 | "peer": true 1052 | }, 1053 | "node_modules/has-flag": { 1054 | "version": "4.0.0", 1055 | "dev": true, 1056 | "license": "MIT", 1057 | "peer": true, 1058 | "engines": { 1059 | "node": ">=8" 1060 | } 1061 | }, 1062 | "node_modules/ignore": { 1063 | "version": "5.3.2", 1064 | "dev": true, 1065 | "license": "MIT", 1066 | "engines": { 1067 | "node": ">= 4" 1068 | } 1069 | }, 1070 | "node_modules/import-fresh": { 1071 | "version": "3.3.0", 1072 | "dev": true, 1073 | "license": "MIT", 1074 | "peer": true, 1075 | "dependencies": { 1076 | "parent-module": "^1.0.0", 1077 | "resolve-from": "^4.0.0" 1078 | }, 1079 | "engines": { 1080 | "node": ">=6" 1081 | }, 1082 | "funding": { 1083 | "url": "https://github.com/sponsors/sindresorhus" 1084 | } 1085 | }, 1086 | "node_modules/imurmurhash": { 1087 | "version": "0.1.4", 1088 | "dev": true, 1089 | "license": "MIT", 1090 | "peer": true, 1091 | "engines": { 1092 | "node": ">=0.8.19" 1093 | } 1094 | }, 1095 | "node_modules/inflight": { 1096 | "version": "1.0.6", 1097 | "dev": true, 1098 | "license": "ISC", 1099 | "peer": true, 1100 | "dependencies": { 1101 | "once": "^1.3.0", 1102 | "wrappy": "1" 1103 | } 1104 | }, 1105 | "node_modules/inherits": { 1106 | "version": "2.0.4", 1107 | "dev": true, 1108 | "license": "ISC", 1109 | "peer": true 1110 | }, 1111 | "node_modules/is-extglob": { 1112 | "version": "2.1.1", 1113 | "dev": true, 1114 | "license": "MIT", 1115 | "engines": { 1116 | "node": ">=0.10.0" 1117 | } 1118 | }, 1119 | "node_modules/is-glob": { 1120 | "version": "4.0.3", 1121 | "dev": true, 1122 | "license": "MIT", 1123 | "dependencies": { 1124 | "is-extglob": "^2.1.1" 1125 | }, 1126 | "engines": { 1127 | "node": ">=0.10.0" 1128 | } 1129 | }, 1130 | "node_modules/is-number": { 1131 | "version": "7.0.0", 1132 | "dev": true, 1133 | "license": "MIT", 1134 | "engines": { 1135 | "node": ">=0.12.0" 1136 | } 1137 | }, 1138 | "node_modules/is-path-inside": { 1139 | "version": "3.0.3", 1140 | "dev": true, 1141 | "license": "MIT", 1142 | "peer": true, 1143 | "engines": { 1144 | "node": ">=8" 1145 | } 1146 | }, 1147 | "node_modules/isexe": { 1148 | "version": "2.0.0", 1149 | "dev": true, 1150 | "license": "ISC", 1151 | "peer": true 1152 | }, 1153 | "node_modules/js-yaml": { 1154 | "version": "4.1.0", 1155 | "dev": true, 1156 | "license": "MIT", 1157 | "peer": true, 1158 | "dependencies": { 1159 | "argparse": "^2.0.1" 1160 | }, 1161 | "bin": { 1162 | "js-yaml": "bin/js-yaml.js" 1163 | } 1164 | }, 1165 | "node_modules/json-buffer": { 1166 | "version": "3.0.1", 1167 | "dev": true, 1168 | "license": "MIT", 1169 | "peer": true 1170 | }, 1171 | "node_modules/json-schema-traverse": { 1172 | "version": "0.4.1", 1173 | "dev": true, 1174 | "license": "MIT", 1175 | "peer": true 1176 | }, 1177 | "node_modules/json-stable-stringify-without-jsonify": { 1178 | "version": "1.0.1", 1179 | "dev": true, 1180 | "license": "MIT", 1181 | "peer": true 1182 | }, 1183 | "node_modules/keyv": { 1184 | "version": "4.5.4", 1185 | "dev": true, 1186 | "license": "MIT", 1187 | "peer": true, 1188 | "dependencies": { 1189 | "json-buffer": "3.0.1" 1190 | } 1191 | }, 1192 | "node_modules/levn": { 1193 | "version": "0.4.1", 1194 | "dev": true, 1195 | "license": "MIT", 1196 | "peer": true, 1197 | "dependencies": { 1198 | "prelude-ls": "^1.2.1", 1199 | "type-check": "~0.4.0" 1200 | }, 1201 | "engines": { 1202 | "node": ">= 0.8.0" 1203 | } 1204 | }, 1205 | "node_modules/locate-path": { 1206 | "version": "6.0.0", 1207 | "dev": true, 1208 | "license": "MIT", 1209 | "peer": true, 1210 | "dependencies": { 1211 | "p-locate": "^5.0.0" 1212 | }, 1213 | "engines": { 1214 | "node": ">=10" 1215 | }, 1216 | "funding": { 1217 | "url": "https://github.com/sponsors/sindresorhus" 1218 | } 1219 | }, 1220 | "node_modules/lodash.merge": { 1221 | "version": "4.6.2", 1222 | "dev": true, 1223 | "license": "MIT", 1224 | "peer": true 1225 | }, 1226 | "node_modules/merge2": { 1227 | "version": "1.4.1", 1228 | "dev": true, 1229 | "license": "MIT", 1230 | "engines": { 1231 | "node": ">= 8" 1232 | } 1233 | }, 1234 | "node_modules/micromatch": { 1235 | "version": "4.0.8", 1236 | "dev": true, 1237 | "license": "MIT", 1238 | "dependencies": { 1239 | "braces": "^3.0.3", 1240 | "picomatch": "^2.3.1" 1241 | }, 1242 | "engines": { 1243 | "node": ">=8.6" 1244 | } 1245 | }, 1246 | "node_modules/minimatch": { 1247 | "version": "3.1.2", 1248 | "dev": true, 1249 | "license": "ISC", 1250 | "peer": true, 1251 | "dependencies": { 1252 | "brace-expansion": "^1.1.7" 1253 | }, 1254 | "engines": { 1255 | "node": "*" 1256 | } 1257 | }, 1258 | "node_modules/moment": { 1259 | "version": "2.29.4", 1260 | "dev": true, 1261 | "license": "MIT", 1262 | "engines": { 1263 | "node": "*" 1264 | } 1265 | }, 1266 | "node_modules/ms": { 1267 | "version": "2.1.3", 1268 | "dev": true, 1269 | "license": "MIT" 1270 | }, 1271 | "node_modules/natural-compare": { 1272 | "version": "1.4.0", 1273 | "dev": true, 1274 | "license": "MIT", 1275 | "peer": true 1276 | }, 1277 | "node_modules/obsidian": { 1278 | "version": "1.7.2", 1279 | "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.7.2.tgz", 1280 | "integrity": "sha512-k9hN9brdknJC+afKr5FQzDRuEFGDKbDjfCazJwpgibwCAoZNYHYV8p/s3mM8I6AsnKrPKNXf8xGuMZ4enWelZQ==", 1281 | "dev": true, 1282 | "license": "MIT", 1283 | "dependencies": { 1284 | "@types/codemirror": "5.60.8", 1285 | "moment": "2.29.4" 1286 | }, 1287 | "peerDependencies": { 1288 | "@codemirror/state": "^6.0.0", 1289 | "@codemirror/view": "^6.0.0" 1290 | } 1291 | }, 1292 | "node_modules/once": { 1293 | "version": "1.4.0", 1294 | "dev": true, 1295 | "license": "ISC", 1296 | "peer": true, 1297 | "dependencies": { 1298 | "wrappy": "1" 1299 | } 1300 | }, 1301 | "node_modules/optionator": { 1302 | "version": "0.9.4", 1303 | "dev": true, 1304 | "license": "MIT", 1305 | "peer": true, 1306 | "dependencies": { 1307 | "deep-is": "^0.1.3", 1308 | "fast-levenshtein": "^2.0.6", 1309 | "levn": "^0.4.1", 1310 | "prelude-ls": "^1.2.1", 1311 | "type-check": "^0.4.0", 1312 | "word-wrap": "^1.2.5" 1313 | }, 1314 | "engines": { 1315 | "node": ">= 0.8.0" 1316 | } 1317 | }, 1318 | "node_modules/p-limit": { 1319 | "version": "3.1.0", 1320 | "dev": true, 1321 | "license": "MIT", 1322 | "peer": true, 1323 | "dependencies": { 1324 | "yocto-queue": "^0.1.0" 1325 | }, 1326 | "engines": { 1327 | "node": ">=10" 1328 | }, 1329 | "funding": { 1330 | "url": "https://github.com/sponsors/sindresorhus" 1331 | } 1332 | }, 1333 | "node_modules/p-locate": { 1334 | "version": "5.0.0", 1335 | "dev": true, 1336 | "license": "MIT", 1337 | "peer": true, 1338 | "dependencies": { 1339 | "p-limit": "^3.0.2" 1340 | }, 1341 | "engines": { 1342 | "node": ">=10" 1343 | }, 1344 | "funding": { 1345 | "url": "https://github.com/sponsors/sindresorhus" 1346 | } 1347 | }, 1348 | "node_modules/parent-module": { 1349 | "version": "1.0.1", 1350 | "dev": true, 1351 | "license": "MIT", 1352 | "peer": true, 1353 | "dependencies": { 1354 | "callsites": "^3.0.0" 1355 | }, 1356 | "engines": { 1357 | "node": ">=6" 1358 | } 1359 | }, 1360 | "node_modules/path-exists": { 1361 | "version": "4.0.0", 1362 | "dev": true, 1363 | "license": "MIT", 1364 | "peer": true, 1365 | "engines": { 1366 | "node": ">=8" 1367 | } 1368 | }, 1369 | "node_modules/path-is-absolute": { 1370 | "version": "1.0.1", 1371 | "dev": true, 1372 | "license": "MIT", 1373 | "peer": true, 1374 | "engines": { 1375 | "node": ">=0.10.0" 1376 | } 1377 | }, 1378 | "node_modules/path-key": { 1379 | "version": "3.1.1", 1380 | "dev": true, 1381 | "license": "MIT", 1382 | "peer": true, 1383 | "engines": { 1384 | "node": ">=8" 1385 | } 1386 | }, 1387 | "node_modules/path-type": { 1388 | "version": "4.0.0", 1389 | "dev": true, 1390 | "license": "MIT", 1391 | "engines": { 1392 | "node": ">=8" 1393 | } 1394 | }, 1395 | "node_modules/picomatch": { 1396 | "version": "2.3.1", 1397 | "dev": true, 1398 | "license": "MIT", 1399 | "engines": { 1400 | "node": ">=8.6" 1401 | }, 1402 | "funding": { 1403 | "url": "https://github.com/sponsors/jonschlinkert" 1404 | } 1405 | }, 1406 | "node_modules/prelude-ls": { 1407 | "version": "1.2.1", 1408 | "dev": true, 1409 | "license": "MIT", 1410 | "peer": true, 1411 | "engines": { 1412 | "node": ">= 0.8.0" 1413 | } 1414 | }, 1415 | "node_modules/punycode": { 1416 | "version": "2.3.1", 1417 | "dev": true, 1418 | "license": "MIT", 1419 | "peer": true, 1420 | "engines": { 1421 | "node": ">=6" 1422 | } 1423 | }, 1424 | "node_modules/queue-microtask": { 1425 | "version": "1.2.3", 1426 | "dev": true, 1427 | "funding": [ 1428 | { 1429 | "type": "github", 1430 | "url": "https://github.com/sponsors/feross" 1431 | }, 1432 | { 1433 | "type": "patreon", 1434 | "url": "https://www.patreon.com/feross" 1435 | }, 1436 | { 1437 | "type": "consulting", 1438 | "url": "https://feross.org/support" 1439 | } 1440 | ], 1441 | "license": "MIT" 1442 | }, 1443 | "node_modules/regexpp": { 1444 | "version": "3.2.0", 1445 | "dev": true, 1446 | "license": "MIT", 1447 | "engines": { 1448 | "node": ">=8" 1449 | }, 1450 | "funding": { 1451 | "url": "https://github.com/sponsors/mysticatea" 1452 | } 1453 | }, 1454 | "node_modules/resolve-from": { 1455 | "version": "4.0.0", 1456 | "dev": true, 1457 | "license": "MIT", 1458 | "peer": true, 1459 | "engines": { 1460 | "node": ">=4" 1461 | } 1462 | }, 1463 | "node_modules/reusify": { 1464 | "version": "1.0.4", 1465 | "dev": true, 1466 | "license": "MIT", 1467 | "engines": { 1468 | "iojs": ">=1.0.0", 1469 | "node": ">=0.10.0" 1470 | } 1471 | }, 1472 | "node_modules/rimraf": { 1473 | "version": "3.0.2", 1474 | "dev": true, 1475 | "license": "ISC", 1476 | "peer": true, 1477 | "dependencies": { 1478 | "glob": "^7.1.3" 1479 | }, 1480 | "bin": { 1481 | "rimraf": "bin.js" 1482 | }, 1483 | "funding": { 1484 | "url": "https://github.com/sponsors/isaacs" 1485 | } 1486 | }, 1487 | "node_modules/run-parallel": { 1488 | "version": "1.2.0", 1489 | "dev": true, 1490 | "funding": [ 1491 | { 1492 | "type": "github", 1493 | "url": "https://github.com/sponsors/feross" 1494 | }, 1495 | { 1496 | "type": "patreon", 1497 | "url": "https://www.patreon.com/feross" 1498 | }, 1499 | { 1500 | "type": "consulting", 1501 | "url": "https://feross.org/support" 1502 | } 1503 | ], 1504 | "license": "MIT", 1505 | "dependencies": { 1506 | "queue-microtask": "^1.2.2" 1507 | } 1508 | }, 1509 | "node_modules/semver": { 1510 | "version": "7.6.3", 1511 | "dev": true, 1512 | "license": "ISC", 1513 | "bin": { 1514 | "semver": "bin/semver.js" 1515 | }, 1516 | "engines": { 1517 | "node": ">=10" 1518 | } 1519 | }, 1520 | "node_modules/shebang-command": { 1521 | "version": "2.0.0", 1522 | "dev": true, 1523 | "license": "MIT", 1524 | "peer": true, 1525 | "dependencies": { 1526 | "shebang-regex": "^3.0.0" 1527 | }, 1528 | "engines": { 1529 | "node": ">=8" 1530 | } 1531 | }, 1532 | "node_modules/shebang-regex": { 1533 | "version": "3.0.0", 1534 | "dev": true, 1535 | "license": "MIT", 1536 | "peer": true, 1537 | "engines": { 1538 | "node": ">=8" 1539 | } 1540 | }, 1541 | "node_modules/slash": { 1542 | "version": "3.0.0", 1543 | "dev": true, 1544 | "license": "MIT", 1545 | "engines": { 1546 | "node": ">=8" 1547 | } 1548 | }, 1549 | "node_modules/strip-ansi": { 1550 | "version": "6.0.1", 1551 | "dev": true, 1552 | "license": "MIT", 1553 | "peer": true, 1554 | "dependencies": { 1555 | "ansi-regex": "^5.0.1" 1556 | }, 1557 | "engines": { 1558 | "node": ">=8" 1559 | } 1560 | }, 1561 | "node_modules/strip-json-comments": { 1562 | "version": "3.1.1", 1563 | "dev": true, 1564 | "license": "MIT", 1565 | "peer": true, 1566 | "engines": { 1567 | "node": ">=8" 1568 | }, 1569 | "funding": { 1570 | "url": "https://github.com/sponsors/sindresorhus" 1571 | } 1572 | }, 1573 | "node_modules/style-mod": { 1574 | "version": "4.1.2", 1575 | "dev": true, 1576 | "license": "MIT", 1577 | "peer": true 1578 | }, 1579 | "node_modules/supports-color": { 1580 | "version": "7.2.0", 1581 | "dev": true, 1582 | "license": "MIT", 1583 | "peer": true, 1584 | "dependencies": { 1585 | "has-flag": "^4.0.0" 1586 | }, 1587 | "engines": { 1588 | "node": ">=8" 1589 | } 1590 | }, 1591 | "node_modules/text-table": { 1592 | "version": "0.2.0", 1593 | "dev": true, 1594 | "license": "MIT", 1595 | "peer": true 1596 | }, 1597 | "node_modules/to-regex-range": { 1598 | "version": "5.0.1", 1599 | "dev": true, 1600 | "license": "MIT", 1601 | "dependencies": { 1602 | "is-number": "^7.0.0" 1603 | }, 1604 | "engines": { 1605 | "node": ">=8.0" 1606 | } 1607 | }, 1608 | "node_modules/tslib": { 1609 | "version": "2.4.0", 1610 | "dev": true, 1611 | "license": "0BSD" 1612 | }, 1613 | "node_modules/tsutils": { 1614 | "version": "3.21.0", 1615 | "dev": true, 1616 | "license": "MIT", 1617 | "dependencies": { 1618 | "tslib": "^1.8.1" 1619 | }, 1620 | "engines": { 1621 | "node": ">= 6" 1622 | }, 1623 | "peerDependencies": { 1624 | "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" 1625 | } 1626 | }, 1627 | "node_modules/tsutils/node_modules/tslib": { 1628 | "version": "1.14.1", 1629 | "dev": true, 1630 | "license": "0BSD" 1631 | }, 1632 | "node_modules/type-check": { 1633 | "version": "0.4.0", 1634 | "dev": true, 1635 | "license": "MIT", 1636 | "peer": true, 1637 | "dependencies": { 1638 | "prelude-ls": "^1.2.1" 1639 | }, 1640 | "engines": { 1641 | "node": ">= 0.8.0" 1642 | } 1643 | }, 1644 | "node_modules/type-fest": { 1645 | "version": "0.20.2", 1646 | "dev": true, 1647 | "license": "(MIT OR CC0-1.0)", 1648 | "peer": true, 1649 | "engines": { 1650 | "node": ">=10" 1651 | }, 1652 | "funding": { 1653 | "url": "https://github.com/sponsors/sindresorhus" 1654 | } 1655 | }, 1656 | "node_modules/typescript": { 1657 | "version": "4.7.4", 1658 | "dev": true, 1659 | "license": "Apache-2.0", 1660 | "bin": { 1661 | "tsc": "bin/tsc", 1662 | "tsserver": "bin/tsserver" 1663 | }, 1664 | "engines": { 1665 | "node": ">=4.2.0" 1666 | } 1667 | }, 1668 | "node_modules/uri-js": { 1669 | "version": "4.4.1", 1670 | "dev": true, 1671 | "license": "BSD-2-Clause", 1672 | "peer": true, 1673 | "dependencies": { 1674 | "punycode": "^2.1.0" 1675 | } 1676 | }, 1677 | "node_modules/w3c-keyname": { 1678 | "version": "2.2.8", 1679 | "dev": true, 1680 | "license": "MIT", 1681 | "peer": true 1682 | }, 1683 | "node_modules/which": { 1684 | "version": "2.0.2", 1685 | "dev": true, 1686 | "license": "ISC", 1687 | "peer": true, 1688 | "dependencies": { 1689 | "isexe": "^2.0.0" 1690 | }, 1691 | "bin": { 1692 | "node-which": "bin/node-which" 1693 | }, 1694 | "engines": { 1695 | "node": ">= 8" 1696 | } 1697 | }, 1698 | "node_modules/word-wrap": { 1699 | "version": "1.2.5", 1700 | "dev": true, 1701 | "license": "MIT", 1702 | "peer": true, 1703 | "engines": { 1704 | "node": ">=0.10.0" 1705 | } 1706 | }, 1707 | "node_modules/wrappy": { 1708 | "version": "1.0.2", 1709 | "dev": true, 1710 | "license": "ISC", 1711 | "peer": true 1712 | }, 1713 | "node_modules/yocto-queue": { 1714 | "version": "0.1.0", 1715 | "dev": true, 1716 | "license": "MIT", 1717 | "peer": true, 1718 | "engines": { 1719 | "node": ">=10" 1720 | }, 1721 | "funding": { 1722 | "url": "https://github.com/sponsors/sindresorhus" 1723 | } 1724 | } 1725 | } 1726 | } 1727 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "force-read-mode", 3 | "version": "1.0.0", 4 | "description": "Forces markdown files in specified folders to open in read-only mode.", 5 | "main": "main.js", 6 | "scripts": { 7 | "dev": "node esbuild.config.mjs", 8 | "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", 9 | "version": "node version-bump.mjs && git add manifest.json versions.json" 10 | }, 11 | "keywords": [], 12 | "author": "al3xw", 13 | "license": "MIT", 14 | "devDependencies": { 15 | "@types/node": "^16.11.6", 16 | "@typescript-eslint/eslint-plugin": "5.29.0", 17 | "@typescript-eslint/parser": "5.29.0", 18 | "builtin-modules": "3.3.0", 19 | "esbuild": "0.17.3", 20 | "obsidian": "latest", 21 | "tslib": "2.4.0", 22 | "typescript": "4.7.4" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This CSS file will be included with your plugin, and 4 | available in the app when your plugin is enabled. 5 | 6 | If your plugin does not need CSS, delete this file. 7 | 8 | */ 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "inlineSourceMap": true, 5 | "inlineSources": true, 6 | "module": "ESNext", 7 | "target": "ES6", 8 | "allowJs": true, 9 | "noImplicitAny": true, 10 | "moduleResolution": "node", 11 | "importHelpers": true, 12 | "isolatedModules": true, 13 | "strictNullChecks": true, 14 | "lib": [ 15 | "DOM", 16 | "ES5", 17 | "ES6", 18 | "ES7" 19 | ] 20 | }, 21 | "include": [ 22 | "**/*.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /version-bump.mjs: -------------------------------------------------------------------------------- 1 | import { readFileSync, writeFileSync } from "fs"; 2 | 3 | const targetVersion = process.env.npm_package_version; 4 | 5 | // read minAppVersion from manifest.json and bump version to target version 6 | let manifest = JSON.parse(readFileSync("manifest.json", "utf8")); 7 | const { minAppVersion } = manifest; 8 | manifest.version = targetVersion; 9 | writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t")); 10 | 11 | // update versions.json with target version and minAppVersion from manifest.json 12 | let versions = JSON.parse(readFileSync("versions.json", "utf8")); 13 | versions[targetVersion] = minAppVersion; 14 | writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); 15 | -------------------------------------------------------------------------------- /versions.json: -------------------------------------------------------------------------------- 1 | { 2 | "1.0.0": "0.15.0" 3 | } 4 | --------------------------------------------------------------------------------