-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ferenc Agócs
committed
Mar 1, 2022
1 parent
484a6be
commit 9367b45
Showing
10 changed files
with
140 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
insert_final_newline = true | ||
indent_style = tab | ||
indent_size = 4 | ||
tab_width = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
npm node_modules | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"env": { "node": true }, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"no-prototype-builtins": "off", | ||
"@typescript-eslint/no-empty-function": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tag-version-prefix="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import esbuild from "esbuild"; | ||
import process from "process"; | ||
import builtins from 'builtin-modules' | ||
|
||
const banner = | ||
`/* | ||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD | ||
if you want to view the source, please visit the github repository of this plugin | ||
*/ | ||
`; | ||
|
||
const prod = (process.argv[2] === 'production'); | ||
|
||
esbuild.build({ | ||
banner: { | ||
js: banner, | ||
}, | ||
entryPoints: ['main.ts'], | ||
bundle: true, | ||
external: [ | ||
'obsidian', | ||
'electron', | ||
'@codemirror/autocomplete', | ||
'@codemirror/closebrackets', | ||
'@codemirror/collab', | ||
'@codemirror/commands', | ||
'@codemirror/comment', | ||
'@codemirror/fold', | ||
'@codemirror/gutter', | ||
'@codemirror/highlight', | ||
'@codemirror/history', | ||
'@codemirror/language', | ||
'@codemirror/lint', | ||
'@codemirror/matchbrackets', | ||
'@codemirror/panel', | ||
'@codemirror/rangeset', | ||
'@codemirror/rectangular-selection', | ||
'@codemirror/search', | ||
'@codemirror/state', | ||
'@codemirror/stream-parser', | ||
'@codemirror/text', | ||
'@codemirror/tooltip', | ||
'@codemirror/view', | ||
...builtins], | ||
format: 'cjs', | ||
watch: !prod, | ||
target: 'es2016', | ||
logLevel: "info", | ||
sourcemap: prod ? false : 'inline', | ||
treeShaking: true, | ||
outfile: 'main.js', | ||
}).catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
{ | ||
"name": "obsidian-hide-sidebars-when-narrow", | ||
"version": "1.0.1", | ||
"description": "This Obsidian plugin hides the sidebars when the window is narrow.", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "rollup --config rollup.config.js -w", | ||
"build": "rollup --config rollup.config.js --environment BUILD:production" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"@rollup/plugin-typescript": "^8.2.1", | ||
"@types/node": "^14.14.37", | ||
"obsidian": "^0.12.0", | ||
"rollup": "^2.32.1", | ||
"tslib": "^2.2.0", | ||
"typescript": "^4.2.4" | ||
} | ||
"name": "obsidian-sample-plugin", | ||
"version": "1.0.1", | ||
"description": "This Obsidian plugin hides the sidebars when the window is narrow.", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "node esbuild.config.mjs", | ||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", | ||
"version": "node version-bump.mjs && git add manifest.json versions.json" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^16.11.6", | ||
"@typescript-eslint/eslint-plugin": "^5.2.0", | ||
"@typescript-eslint/parser": "^5.2.0", | ||
"builtin-modules": "^3.2.0", | ||
"esbuild": "0.13.12", | ||
"obsidian": "^0.12.0", | ||
"tslib": "2.3.1", | ||
"typescript": "4.4.4" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { readFileSync, writeFileSync } from "fs"; | ||
|
||
const targetVersion = process.env.npm_package_version; | ||
|
||
// read minAppVersion from manifest.json and bump version to target version | ||
let manifest = JSON.parse(readFileSync("manifest.json", "utf8")); | ||
const { minAppVersion } = manifest; | ||
manifest.version = targetVersion; | ||
writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t")); | ||
|
||
// update versions.json with target version and minAppVersion from manifest.json | ||
let versions = JSON.parse(readFileSync("versions.json", "utf8")); | ||
versions[targetVersion] = minAppVersion; | ||
writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); |