Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcgivery committed Jan 16, 2024
1 parent 8c81a20 commit 522e59f
Show file tree
Hide file tree
Showing 22 changed files with 3,209 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
@@ -0,0 +1,10 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
tab_width = 4
3 changes: 3 additions & 0 deletions .eslintignore
@@ -0,0 +1,3 @@
node_modules/

main.js
23 changes: 23 additions & 0 deletions .eslintrc
@@ -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"
}
}
20 changes: 20 additions & 0 deletions .github/workflows/pull-request.yml
@@ -0,0 +1,20 @@
name: Build Pull Request

on: pull_request

env:
PLUGIN_NAME: obsidian-soundscapes
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
- name: Build
id: build
run: |
npm ci
npm run build
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,35 @@
name: Build Obsidian Plugin

on: workflow_dispatch

env:
PLUGIN_NAME: obsidian-soundscapes
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
- name: Get Package Version
id: get_package_version
run: echo "PACKAGE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Build
id: build
run: |
echo Building for version PACKAGE_VERSION
npm ci
npm run build
zip -jr ${{ env.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}.zip dist/*
ls
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.PACKAGE_VERSION }}
files: |
${{ env.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}.zip
dist/main.js
dist/manifest.json
dist/styles.css
25 changes: 25 additions & 0 deletions .gitignore
@@ -0,0 +1,25 @@
# vscode
.vscode

# Intellij
*.iml
.idea

# npm
node_modules

# Don't include the compiled main.js file in the repo.
# They should be uploaded to GitHub releases instead.
main.js

# Exclude sourcemaps
*.map

# obsidian
data.json

# Exclude macOS Finder (System Explorer) View States
.DS_Store

# Remove local builds
dist/
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
tag-version-prefix=""
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 andrewmcgivery
Copyright (c) 2023 andrewmcgivery

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
44 changes: 43 additions & 1 deletion README.md
@@ -1 +1,43 @@
# obsidian-soundscapes
# Obsidian Soundscapes

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.

![Screenshot of Obsidian Soundscapes player](screenshot1.png)

![Screenshot of Obsidian Soundscapes player](screenshot2.png)

## How to Install

Plugin will be added to official repository shortly.

## How to Use

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.

![Settings screen](settings.png)

## Requesting New Soundscapes

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!

## External Resources

This plugin makes use of the Youtube IFrame API and includes that script as a result. Youtube videos are loaded in the background.

## Credits

- [Lofi beats](https://www.youtube.com/watch?v=jfKfPfyJRdk)
- [Spa atmosphere](https://www.youtube.com/watch?v=luxiL4SQVVE)
- [The Sims complete soundtrack](https://www.youtube.com/watch?v=wKnkQdsITUE)
- [Thunderstorm](https://www.youtube.com/watch?v=nDq6TstdEi8)
- [Cozy fireplace](https://www.youtube.com/watch?v=rCYzRXLWcIg)
- [Birds chirping](https://www.youtube.com/watch?v=mFjU4JuJgnM)
- [Ocean waves](https://www.youtube.com/watch?v=bn9F19Hi1Lk)
- [Relaxing jazz](https://www.youtube.com/watch?v=tNvh2w8lTes)
- [Coffee shop ambience](https://www.youtube.com/watch?v=uiMXGIG_DQo)
- [Animal Crossing New Horizons](https://www.youtube.com/watch?v=zru-TLye9jo)
- [Calm Nintendo music](https://www.youtube.com/watch?v=sA0qrPOMy2Y)

## Reporting Issues

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.
67 changes: 67 additions & 0 deletions esbuild.config.mjs
@@ -0,0 +1,67 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
import { sassPlugin } from "esbuild-sass-plugin";
import copyStaticFiles from "esbuild-copy-static-files";
import path from "path";

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";
const outdir = prod
? "./dist/"
: // Assumed local path. Update this to the path of your local development vault
"E:/Documents/PersonalObsidianVault/.obsidian/plugins/obsidian-soundscapes/";

const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["main.ts", "styles.scss"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins,
],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
minifySyntax: true,
plugins: [
sassPlugin(),
copyStaticFiles({
src: "./manifest.json",
dest: path.join(outdir, "manifest.json"),
}),
],
outdir: outdir,
define: {
"process.env.NODE_ENV": prod ? '"production"' : '"development"',
},
});

if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
await context.serve(); // This enables the "live reload"
}

0 comments on commit 522e59f

Please sign in to comment.