Skip to content

Commit cb07f16

Browse files
committed
1.0.7
1 parent 0d8f724 commit cb07f16

27 files changed

+448
-225
lines changed

Diff for: .github/workflows/release.yml

+21-57
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,34 @@
1-
name: Release Obsidian Plugin
1+
name: Release Obsidian plugin
2+
23
on:
34
push:
45
tags:
56
- '*'
7+
68
jobs:
79
build:
810
runs-on: ubuntu-latest
11+
912
steps:
10-
- uses: actions/checkout@v2
11-
with:
12-
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
13+
- uses: actions/checkout@v3
14+
1315
- name: Use Node.js
14-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v3
1517
with:
16-
node-version: '14.x'
17-
- name: Get Version
18-
id: version
19-
run: |
20-
echo "::set-output name=tag::$(git describe --abbrev=0)"
21-
- name: Build
22-
id: build
18+
node-version: '18.x'
19+
20+
- name: Build plugin
2321
run: |
24-
yarn
25-
yarn run build
26-
# Create the release on github
27-
- name: Create Release
28-
id: create_release
29-
uses: actions/create-release@v1
22+
npm install
23+
npm run build
24+
25+
- name: Create release
3026
env:
3127
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
VERSION: ${{ github.ref }}
33-
with:
34-
tag_name: ${{ github.ref }}
35-
release_name: ${{ github.ref }}
36-
draft: false
37-
prerelease: false
38-
# Upload the main.js
39-
- name: Upload main.js
40-
id: upload-main
41-
uses: actions/upload-release-asset@v1
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
with:
45-
upload_url: ${{ steps.create_release.outputs.upload_url }}
46-
asset_path: ./main.js
47-
asset_name: main.js
48-
asset_content_type: text/javascript
49-
# Upload the manifest.json
50-
- name: Upload manifest.json
51-
id: upload-manifest
52-
uses: actions/upload-release-asset@v1
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
with:
56-
upload_url: ${{ steps.create_release.outputs.upload_url }}
57-
asset_path: ./manifest.json
58-
asset_name: manifest.json
59-
asset_content_type: application/json
60-
# Upload the style.css
61-
- name: Upload styles.css
62-
id: upload-css
63-
uses: actions/upload-release-asset@v1
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
with:
67-
upload_url: ${{ steps.create_release.outputs.upload_url }}
68-
asset_path: ./styles.css
69-
asset_name: styles.css
70-
asset_content_type: text/css
28+
run: |
29+
tag="${GITHUB_REF#refs/tags/}"
30+
31+
gh release create "$tag" \
32+
--title="$tag" \
33+
--notes-file="release-notes.md" \
34+
main.js manifest.json styles.css

Diff for: manifest.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{
2-
"id": "obsidian-style-settings",
3-
"name": "Style Settings",
4-
"version": "1.0.6",
5-
"minAppVersion": "0.11.5",
6-
"description": "Offers controls for adjusting theme, plugin, and snippet CSS variables.",
7-
"author": "mgmeyers",
8-
"authorUrl": "https://github.com/mgmeyers/obsidian-style-settings",
9-
"isDesktopOnly": false
10-
}
1+
{
2+
"id": "obsidian-style-settings",
3+
"name": "Style Settings",
4+
"version": "1.0.7",
5+
"minAppVersion": "0.11.5",
6+
"description": "Offers controls for adjusting theme, plugin, and snippet CSS variables.",
7+
"author": "mgmeyers",
8+
"authorUrl": "https://github.com/mgmeyers/obsidian-style-settings",
9+
"isDesktopOnly": false
10+
}

Diff for: package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-style-settings",
3-
"version": "0.0.1",
3+
"version": "1.0.7",
44
"description": "Offers controls for adjusting theme, plugin, and CSS snippet styles.",
55
"main": "main.js",
66
"scripts": {
@@ -9,7 +9,10 @@
99
"prettier": "prettier --write \"./src/**/*.{ts,tsx}\"",
1010
"lint": "eslint ./src",
1111
"lint:fix": "eslint ./src --fix",
12-
"clean": "yarn prettier && yarn lint:fix"
12+
"clean": "yarn prettier && yarn lint:fix",
13+
"rlnotes": "git log $(git describe --tags --abbrev=0)..HEAD --oneline > release-notes.md && git add release-notes.md",
14+
"bump": "node version-bump.mjs && git add manifest.json versions.json && yarn rlnotes",
15+
"release": "git commit -m $npm_package_version && git tag $npm_package_version && git push && git push --tags"
1316
},
1417
"keywords": [],
1518
"author": "",
@@ -18,6 +21,7 @@
1821
"@rollup/plugin-commonjs": "^15.1.0",
1922
"@rollup/plugin-node-resolve": "^9.0.0",
2023
"@rollup/plugin-typescript": "^6.0.0",
24+
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
2125
"@types/node": "^14.14.2",
2226
"eslint": "^8.33.0",
2327
"obsidian": "^1.1.1",

Diff for: prettier.config.cjs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-disable no-undef */
2+
module.exports = {
3+
arrowParens: 'always',
4+
bracketSpacing: true,
5+
endOfLine: 'lf',
6+
htmlWhitespaceSensitivity: 'css',
7+
bracketSameLine: false,
8+
jsxSingleQuote: false,
9+
printWidth: 80,
10+
proseWrap: 'preserve',
11+
quoteProps: 'as-needed',
12+
semi: true,
13+
singleQuote: true,
14+
tabWidth: 2,
15+
trailingComma: 'es5',
16+
useTabs: false,
17+
importOrder: ['^[./]'],
18+
importOrderSeparation: true,
19+
importOrderSortSpecifiers: true,
20+
plugins: ["@trivago/prettier-plugin-sort-imports"]
21+
};

Diff for: release-notes.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
0d8f724 Merge pull request #136 from ebullient/commented
2+
7035a31 Include "/*! @settings" when looking for settings

Diff for: src/ExportModal.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { App, Modal, Setting, TextAreaComponent } from 'obsidian';
2-
import CSSSettingsPlugin from './main';
31
import { SettingValue } from './SettingsManager';
2+
import CSSSettingsPlugin from './main';
3+
import { App, Modal, Setting, TextAreaComponent } from 'obsidian';
44

55
export class ExportModal extends Modal {
66
plugin: CSSSettingsPlugin;

Diff for: src/ImportModal.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import { SettingValue } from './SettingsManager';
2+
import CSSSettingsPlugin from './main';
13
import {
24
App,
35
ButtonComponent,
46
Modal,
57
Setting,
68
TextAreaComponent,
79
} from 'obsidian';
8-
import CSSSettingsPlugin from './main';
9-
import { SettingValue } from './SettingsManager';
1010

1111
export class ImportModal extends Modal {
1212
plugin: CSSSettingsPlugin;

Diff for: src/SettingsManager.ts

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ExportModal } from './ExportModal';
2+
import { ImportModal } from './ImportModal';
13
import {
24
AltFormatList,
35
ClassMultiToggle,
@@ -13,12 +15,9 @@ import {
1315
VariableText,
1416
VariableThemedColor,
1517
} from './SettingHandlers';
16-
1718
import CSSSettingsPlugin from './main';
18-
import chroma from 'chroma-js';
19-
import { ImportModal } from './ImportModal';
20-
import { ExportModal } from './ExportModal';
2119
import { SettingType } from './settingsView/SettingComponents/types';
20+
import chroma from 'chroma-js';
2221

2322
type VariableKV = Array<{ key: string; value: string }>;
2423

@@ -472,26 +471,28 @@ export class CSSSettingsManager {
472471
this.styleTag.innerText = `
473472
body.css-settings-manager {
474473
${vars.reduce((combined, current) => {
475-
return combined + `--${current.key}: ${current.value}; `;
476-
}, '')}
474+
return combined + `--${current.key}: ${current.value}; `;
475+
}, '')}
477476
}
478477
479478
body.theme-light.css-settings-manager {
480479
${themedLight.reduce((combined, current) => {
481-
return combined + `--${current.key}: ${current.value}; `;
482-
}, '')}
480+
return combined + `--${current.key}: ${current.value}; `;
481+
}, '')}
483482
}
484483
485484
body.theme-dark.css-settings-manager {
486485
${themedDark.reduce((combined, current) => {
487-
return combined + `--${current.key}: ${current.value}; `;
488-
}, '')}
486+
return combined + `--${current.key}: ${current.value}; `;
487+
}, '')}
489488
}
490489
`
491490
.trim()
492491
.replace(/[\r\n\s]+/g, ' ');
493492

494-
this.plugin.app.workspace.trigger('css-change', { source: 'style-settings' });
493+
this.plugin.app.workspace.trigger('css-change', {
494+
source: 'style-settings',
495+
});
495496
}
496497

497498
setConfig(settings: ParsedCSSSettings[]) {

Diff for: src/Utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { lang, t } from './lang/helpers';
21
import { Meta, WithDescription, WithTitle } from './SettingHandlers';
2+
import { lang, t } from './lang/helpers';
33
import Pickr from '@simonwep/pickr';
44

55
export const settingRegExp = /\/\*!?\s*@settings[\r\n]+?([\s\S]+?)\*\//g;

Diff for: src/main.ts

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
import '@simonwep/pickr/dist/themes/nano.min.css';
2-
import './css/pickerOverrides.css';
3-
import './css/settings.css';
4-
5-
import { Command, Plugin } from 'obsidian';
6-
import { CSSSettingsManager } from './SettingsManager';
71
import { ClassToggle, ParsedCSSSettings } from './SettingHandlers';
8-
import yaml from 'js-yaml';
9-
import detectIndent from 'detect-indent';
10-
11-
import { CSSSettingsTab } from './settingsView/CSSSettingsTab';
12-
import { SettingsView, viewType } from './settingsView/SettingsView';
2+
import { CSSSettingsManager } from './SettingsManager';
133
import {
144
ErrorList,
155
getDescription,
@@ -18,7 +8,15 @@ import {
188
settingRegExp,
199
SettingsSeachResource,
2010
} from './Utils';
11+
import './css/pickerOverrides.css';
12+
import './css/settings.css';
13+
import { CSSSettingsTab } from './settingsView/CSSSettingsTab';
2114
import { SettingType } from './settingsView/SettingComponents/types';
15+
import { SettingsView, viewType } from './settingsView/SettingsView';
16+
import '@simonwep/pickr/dist/themes/nano.min.css';
17+
import detectIndent from 'detect-indent';
18+
import yaml from 'js-yaml';
19+
import { Command, Plugin } from 'obsidian';
2220

2321
export default class CSSSettingsPlugin extends Plugin {
2422
settingsManager: CSSSettingsManager;
@@ -49,11 +47,14 @@ export default class CSSSettingsPlugin extends Plugin {
4947
});
5048

5149
this.registerEvent(
52-
(this.app.workspace as any).on('css-change', (data?: { source: string }) => {
53-
if (data?.source !== 'style-settings') {
54-
this.parseCSS();
50+
(this.app.workspace as any).on(
51+
'css-change',
52+
(data?: { source: string }) => {
53+
if (data?.source !== 'style-settings') {
54+
this.parseCSS();
55+
}
5556
}
56-
})
57+
)
5758
);
5859

5960
this.registerEvent(

Diff for: src/settingsView/CSSSettingsTab.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { App, PluginSettingTab } from 'obsidian';
2-
import { SettingsMarkup } from './SettingsMarkup';
31
import CSSSettingsPlugin from '../main';
4-
import { ErrorList } from 'src/Utils';
2+
import { SettingsMarkup } from './SettingsMarkup';
3+
import { App, PluginSettingTab } from 'obsidian';
54
import { ParsedCSSSettings } from 'src/SettingHandlers';
5+
import { ErrorList } from 'src/Utils';
66

77
export class CSSSettingsTab extends PluginSettingTab {
88
settingsMarkup: SettingsMarkup;

Diff for: src/settingsView/SettingComponents/AbstractSettingComponent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CSSSettingsManager } from '../../SettingsManager';
21
import { CSSSetting } from '../../SettingHandlers';
2+
import { CSSSettingsManager } from '../../SettingsManager';
33
import { getDescription, getTitle } from '../../Utils';
44
import fuzzysort from 'fuzzysort';
55
import { Component } from 'obsidian';

Diff for: src/settingsView/SettingComponents/ClassMultiToggleSettingComponent.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { AbstractSettingComponent } from './AbstractSettingComponent';
2-
import { DropdownComponent, Setting } from 'obsidian';
31
import {
42
ClassMultiToggle,
53
resetTooltip,
64
SelectOption,
75
} from '../../SettingHandlers';
8-
import { t } from '../../lang/helpers';
96
import { createDescription, getDescription, getTitle } from '../../Utils';
7+
import { t } from '../../lang/helpers';
8+
import { AbstractSettingComponent } from './AbstractSettingComponent';
9+
import { DropdownComponent, Setting } from 'obsidian';
1010

1111
export class ClassMultiToggleSettingComponent extends AbstractSettingComponent {
1212
settingEl: Setting;

Diff for: src/settingsView/SettingComponents/ClassToggleSettingComponent.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { AbstractSettingComponent } from './AbstractSettingComponent';
2-
import { Setting, ToggleComponent } from 'obsidian';
31
import { ClassToggle, resetTooltip } from '../../SettingHandlers';
42
import { getDescription, getTitle } from '../../Utils';
3+
import { AbstractSettingComponent } from './AbstractSettingComponent';
4+
import { Setting, ToggleComponent } from 'obsidian';
55

66
export class ClassToggleSettingComponent extends AbstractSettingComponent {
77
settingEl: Setting;

Diff for: src/settingsView/SettingComponents/HeadingSettingComponent.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { AbstractSettingComponent } from './AbstractSettingComponent';
2-
import { setIcon, Setting } from 'obsidian';
3-
import { getDescription, getTitle } from '../../Utils';
41
import { CSSSetting, Heading } from '../../SettingHandlers';
5-
import { SettingType } from './types';
6-
import { CSSSettingsManager } from 'src/SettingsManager';
7-
import { ClassToggleSettingComponent } from './ClassToggleSettingComponent';
2+
import { getDescription, getTitle } from '../../Utils';
3+
import { AbstractSettingComponent } from './AbstractSettingComponent';
84
import { ClassMultiToggleSettingComponent } from './ClassMultiToggleSettingComponent';
9-
import { VariableTextSettingComponent } from './VariableTextSettingComponent';
5+
import { ClassToggleSettingComponent } from './ClassToggleSettingComponent';
6+
import { InfoTextSettingComponent } from './InfoTextSettingComponent';
7+
import { VariableColorSettingComponent } from './VariableColorSettingComponent';
108
import { VariableNumberSettingComponent } from './VariableNumberSettingComponent';
119
import { VariableNumberSliderSettingComponent } from './VariableNumberSliderSettingComponent';
1210
import { VariableSelectSettingComponent } from './VariableSelectSettingComponent';
13-
import { VariableColorSettingComponent } from './VariableColorSettingComponent';
11+
import { VariableTextSettingComponent } from './VariableTextSettingComponent';
1412
import { VariableThemedColorSettingComponent } from './VariableThemedColorSettingComponent';
15-
import { InfoTextSettingComponent } from './InfoTextSettingComponent';
13+
import { SettingType } from './types';
14+
import { setIcon, Setting } from 'obsidian';
15+
import { CSSSettingsManager } from 'src/SettingsManager';
1616

1717
export function createSettingComponent(
1818
parent: AbstractSettingComponent,

Diff for: src/settingsView/SettingComponents/InfoTextSettingComponent.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { AbstractSettingComponent } from './AbstractSettingComponent';
2-
import { MarkdownRenderer, Setting } from 'obsidian';
31
import { InfoText } from '../../SettingHandlers';
42
import { getDescription, getTitle } from '../../Utils';
3+
import { AbstractSettingComponent } from './AbstractSettingComponent';
4+
import { MarkdownRenderer, Setting } from 'obsidian';
55

66
export class InfoTextSettingComponent extends AbstractSettingComponent {
77
settingEl: Setting;

0 commit comments

Comments
 (0)