Skip to content

Commit 522e59f

Browse files
Initial commit
1 parent 8c81a20 commit 522e59f

22 files changed

+3209
-2
lines changed

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
3+
main.js

.eslintrc

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
}

.github/workflows/pull-request.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build Pull Request
2+
3+
on: pull_request
4+
5+
env:
6+
PLUGIN_NAME: obsidian-soundscapes
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: "20.x"
16+
- name: Build
17+
id: build
18+
run: |
19+
npm ci
20+
npm run build

.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Obsidian Plugin
2+
3+
on: workflow_dispatch
4+
5+
env:
6+
PLUGIN_NAME: obsidian-soundscapes
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: "20.x"
16+
- name: Get Package Version
17+
id: get_package_version
18+
run: echo "PACKAGE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
19+
- name: Build
20+
id: build
21+
run: |
22+
echo Building for version PACKAGE_VERSION
23+
npm ci
24+
npm run build
25+
zip -jr ${{ env.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}.zip dist/*
26+
ls
27+
- name: Release
28+
uses: softprops/action-gh-release@v1
29+
with:
30+
tag_name: ${{ env.PACKAGE_VERSION }}
31+
files: |
32+
${{ env.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}.zip
33+
dist/main.js
34+
dist/manifest.json
35+
dist/styles.css

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
24+
# Remove local builds
25+
dist/

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tag-version-prefix=""

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 andrewmcgivery
3+
Copyright (c) 2023 andrewmcgivery
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+43-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,43 @@
1-
# obsidian-soundscapes
1+
# Obsidian Soundscapes
2+
3+
A plugin for Obsidian.MD that adds a music/ambiance player to the status bar to play Lofi beats, nature sounds, ambiance, relaxing music, and more.
4+
5+
![Screenshot of Obsidian Soundscapes player](screenshot1.png)
6+
7+
![Screenshot of Obsidian Soundscapes player](screenshot2.png)
8+
9+
## How to Install
10+
11+
Plugin will be added to official repository shortly.
12+
13+
## How to Use
14+
15+
In the settings screen you can select which Soundscape you would like to play and whether or not it should play on launch of Obsidian. As pictured above, the player and it's controls are displayed in the status bar. Volume can be set and is remembered between launches of Obsidian.
16+
17+
![Settings screen](settings.png)
18+
19+
## Requesting New Soundscapes
20+
21+
Have an idea for a new Soundscape? [Open an issue](https://github.com/andrewmcgivery/obsidian-soundscapes/issues/new) and link a Youtube video and why we should add it!
22+
23+
## External Resources
24+
25+
This plugin makes use of the Youtube IFrame API and includes that script as a result. Youtube videos are loaded in the background.
26+
27+
## Credits
28+
29+
- [Lofi beats](https://www.youtube.com/watch?v=jfKfPfyJRdk)
30+
- [Spa atmosphere](https://www.youtube.com/watch?v=luxiL4SQVVE)
31+
- [The Sims complete soundtrack](https://www.youtube.com/watch?v=wKnkQdsITUE)
32+
- [Thunderstorm](https://www.youtube.com/watch?v=nDq6TstdEi8)
33+
- [Cozy fireplace](https://www.youtube.com/watch?v=rCYzRXLWcIg)
34+
- [Birds chirping](https://www.youtube.com/watch?v=mFjU4JuJgnM)
35+
- [Ocean waves](https://www.youtube.com/watch?v=bn9F19Hi1Lk)
36+
- [Relaxing jazz](https://www.youtube.com/watch?v=tNvh2w8lTes)
37+
- [Coffee shop ambience](https://www.youtube.com/watch?v=uiMXGIG_DQo)
38+
- [Animal Crossing New Horizons](https://www.youtube.com/watch?v=zru-TLye9jo)
39+
- [Calm Nintendo music](https://www.youtube.com/watch?v=sA0qrPOMy2Y)
40+
41+
## Reporting Issues
42+
43+
If you run into any issues with this plugin, please [open an issue](https://github.com/andrewmcgivery/obsidian-soundscapes/issues/new) and include as much detail as possible, including screenshots.

esbuild.config.mjs

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import esbuild from "esbuild";
2+
import process from "process";
3+
import builtins from "builtin-modules";
4+
import { sassPlugin } from "esbuild-sass-plugin";
5+
import copyStaticFiles from "esbuild-copy-static-files";
6+
import path from "path";
7+
8+
const banner = `/*
9+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
10+
if you want to view the source, please visit the github repository of this plugin
11+
*/
12+
`;
13+
14+
const prod = process.argv[2] === "production";
15+
const outdir = prod
16+
? "./dist/"
17+
: // Assumed local path. Update this to the path of your local development vault
18+
"E:/Documents/PersonalObsidianVault/.obsidian/plugins/obsidian-soundscapes/";
19+
20+
const context = await esbuild.context({
21+
banner: {
22+
js: banner,
23+
},
24+
entryPoints: ["main.ts", "styles.scss"],
25+
bundle: true,
26+
external: [
27+
"obsidian",
28+
"electron",
29+
"@codemirror/autocomplete",
30+
"@codemirror/collab",
31+
"@codemirror/commands",
32+
"@codemirror/language",
33+
"@codemirror/lint",
34+
"@codemirror/search",
35+
"@codemirror/state",
36+
"@codemirror/view",
37+
"@lezer/common",
38+
"@lezer/highlight",
39+
"@lezer/lr",
40+
...builtins,
41+
],
42+
format: "cjs",
43+
target: "es2018",
44+
logLevel: "info",
45+
sourcemap: prod ? false : "inline",
46+
treeShaking: true,
47+
minifySyntax: true,
48+
plugins: [
49+
sassPlugin(),
50+
copyStaticFiles({
51+
src: "./manifest.json",
52+
dest: path.join(outdir, "manifest.json"),
53+
}),
54+
],
55+
outdir: outdir,
56+
define: {
57+
"process.env.NODE_ENV": prod ? '"production"' : '"development"',
58+
},
59+
});
60+
61+
if (prod) {
62+
await context.rebuild();
63+
process.exit(0);
64+
} else {
65+
await context.watch();
66+
await context.serve(); // This enables the "live reload"
67+
}

0 commit comments

Comments
 (0)