Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add experimental support for syncing notes #290

Merged
merged 57 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
4125bcf
feat: Log when missing localized string and return fallback value
dvanoni Feb 7, 2023
9f19767
feat: Add `getDOMParser` utility function
dvanoni Feb 7, 2023
4e5376f
refactor: Use named exports instead of default exports
dvanoni Feb 19, 2023
c273021
feat: Add `chunkString` utility function
dvanoni Feb 19, 2023
16ce7d3
chore: Add `Prefs` to cSpell dictionary
dvanoni Feb 19, 2023
320a529
refactor: Rename `test` files to `spec` files
dvanoni Feb 19, 2023
366fc85
build: Change Jest test environment to `jsdom`
dvanoni Feb 20, 2023
5e1b20a
test(chunkString): Use `it.each` to streamline tests
dvanoni Feb 20, 2023
7f6697c
test: Mock Zotero and XPCOM globally
dvanoni Feb 20, 2023
b23a32b
refactor: Simplify type definitions by using overloaded functions
dvanoni Feb 6, 2023
11c8ea2
refactor: Rename `typings` directory to `types`
dvanoni Feb 20, 2023
1964083
build(tsconfig): Enable source maps to enable debugging tests
dvanoni Feb 20, 2023
372a4c4
feat: Add wip note builder and tests
dvanoni Feb 24, 2023
0c486cb
feat: Add wip `NotesService` for syncing notes to Notion
dvanoni Feb 24, 2023
cd9ed36
feat: Support more HTML formatting for notes
dvanoni Mar 1, 2023
c1b1af0
feat: Collapse whitespace in HTML
dvanoni Mar 12, 2023
7b7e678
fix: Polyfill string `trimStart` and `trimEnd` to support Zotero 6
dvanoni Mar 13, 2023
87dacc7
test: Ensure only `spec` and `test` files run as tests
dvanoni Mar 14, 2023
df495f3
refactor: Move files into `html-to-notion` directory
dvanoni Mar 14, 2023
e3d819c
refactor: Move `updateTextContent` into `trimRichText`
dvanoni Mar 15, 2023
22da973
test: Add additional nested blockquote
dvanoni Mar 20, 2023
7f6c534
refactor: Implement workaround for invalid computed property key types
dvanoni Mar 20, 2023
c4d3e27
feat: Add support for color on block elements
dvanoni Mar 20, 2023
27bab3b
refactor: Change error message to say `HTML` instead of `note`
dvanoni Apr 1, 2023
cfd3dfd
test: Add blockquote test case
dvanoni Apr 2, 2023
2d0a398
feat: Update `trimRichText` to support non-text items
dvanoni Apr 2, 2023
87eb33a
refactor: Fix lint errors
dvanoni Apr 2, 2023
877b2de
feat: Support nested blockquote elements
dvanoni Apr 4, 2023
c38a396
test: Add nested styles test case
dvanoni Apr 4, 2023
8a5313b
refactor: Simplify options passed to `buildRichText`
dvanoni Apr 4, 2023
7592d52
refactor: Extract `isMathElement` function
dvanoni Apr 4, 2023
478d865
refactor: Rename `__fixtures__` directory to `fixtures`
dvanoni Apr 5, 2023
c628b06
build: Install `@total-typescript/ts-reset` package
dvanoni Apr 5, 2023
23e5165
refactor: Use new const type parameter to improve `keyValue`
dvanoni Apr 10, 2023
4308e7a
test: Add more features to blockquote test
dvanoni Apr 10, 2023
a56a6a6
feat: Support blocks both with and without children
dvanoni Apr 10, 2023
7b9981c
feat: Support HTML list and br elements
dvanoni Apr 11, 2023
b1a128f
refactor: Use `BlockObjectRequest` type in test fixtures
dvanoni Apr 12, 2023
0d16ee9
refactor: Extract content result types and helpers
dvanoni Apr 19, 2023
6e52653
refactor: Simplify combining child results
dvanoni Apr 23, 2023
e62915e
test: Add another nested paragraph to blockquote test
dvanoni Apr 23, 2023
2599acf
refactor: Remove duplicate logic for returning top-level blocks
dvanoni Apr 24, 2023
3004318
refactor: Remove extra iteration through child results
dvanoni Apr 24, 2023
844d6ab
build: Add `dev` script to start dev build
dvanoni Apr 24, 2023
3eae809
chore: Remove note comment
dvanoni Apr 24, 2023
a2271fd
test: Ensure newlines are preserved at start of `pre` block
dvanoni Apr 24, 2023
0b13db2
test: Ensure whitespace is properly trimmed
dvanoni Apr 30, 2023
dfb7bf8
refactor: Change `RichTextResult` to use snake_case type
dvanoni May 1, 2023
2f71d11
refactor: Extract node parsing
dvanoni May 1, 2023
2cce526
build: Make `dev` script agnostic to Zotero version
dvanoni Jun 25, 2023
92e499b
build(eslint): Change to JS config file to use `tsconfigRootDir` option
dvanoni Jun 25, 2023
2ffded3
refactor(SyncManager): Separate shared logic in event handlers
dvanoni Jun 30, 2023
bf98cf2
refactor: Extract `isObject` utility function
dvanoni Jul 2, 2023
43926a7
refactor: Extract `isNotionErrorWithCode` utility function
dvanoni Jul 10, 2023
0619837
feat: Add "sync notes" boolean preference
dvanoni Jul 9, 2023
13ed465
feat: Enable manual syncing of notes
dvanoni Jul 10, 2023
a6b862f
refactor: Remove obsolete `NotesService` and related functionality
dvanoni Jul 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build
gen
node_modules
esbuild.js
.eslintrc.js
47 changes: 47 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'import'],
settings: {
'import/resolver': {
node: true,
typescript: true,
},
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
'import/no-default-export': 'error',
'import/order': [
'error',
{
alphabetize: { order: 'asc' },
'newlines-between': 'always',
warnOnUnassignedImports: true,
},
],
},
};
45 changes: 0 additions & 45 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"cSpell.words": ["Notero", "XPCOM", "Zotero"]
"cSpell.words": ["Notero", "Prefs", "XPCOM", "Zotero"]
}
6 changes: 4 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const config: Config = {
clearMocks: true,
errorOnDeprecated: true,
preset: 'ts-jest',
rootDir: 'src',
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/test/setup-tests.ts'],
testEnvironment: 'jsdom',
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
};

// eslint-disable-next-line import/no-default-export
export default config;
Loading