Skip to content

Commit fbdc471

Browse files
committed
Merge branch 'main' into filer-smart-duplicate
2 parents 364821a + 16460d2 commit fbdc471

File tree

528 files changed

+63738
-85953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

528 files changed

+63738
-85953
lines changed

.babelrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.cursorignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
2+
node_modules/
3+
.history/
4+
.git/

.eslintrc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"extends": [
33
"eslint:recommended",
44
"plugin:import/recommended",
5+
// "plugin:prettier/recommended",
56
"plugin:import/errors",
67
"plugin:import/warnings",
78
"plugin:flowtype/recommended",
89
"prettier",
910
"plugin:react/recommended"
1011
],
1112
"plugins": [
13+
// "prettier",
1214
"import",
1315
"flowtype",
1416
"unused-imports",
@@ -36,7 +38,7 @@
3638
1,
3739
{
3840
"args": "all",
39-
"varsIgnorePattern": "^_|^clo$|^timer$|^log|^JSP$|^clof$|^res$",
41+
"varsIgnorePattern": "^_|^clo$|^clvt$|^timer$|^log|^JSP$|^clof$|^res$|^describe$|^test$|^expect$|^beforeAll$|customConsole$|simpleFormatter$|Note$|^Paragraph$|^NotePlan$|^Editor$|^DataStore$|^CommandBar$|^Calendar$|^CalendarItem$|^Clipboard$|^HTMLView$|^globalThis$",
4042
"argsIgnorePattern": "^_"
4143
}
4244
],
@@ -68,17 +70,18 @@
6870
],
6971
"new-cap": "off",
7072
"no-case-declarations": "error",
73+
"no-console": "off",
7174
"no-floating-promise/no-floating-promise": 2,
75+
"no-prototype-builtins": "off",
76+
// "no-return-in-foreach": "error",
77+
"no-useless-escape": "off",
7278
"no-var": "error",
7379
"prefer-const": "warn",
74-
"no-prototype-builtins": "off",
7580
"import/order": "warn",
76-
"no-useless-escape": "off",
81+
"react/react-in-jsx-scope": 0,
7782
"require-await": "error",
7883
"unused-imports/no-unused-imports": "off",
79-
"unused-imports/no-unused-vars": "off",
80-
"react/react-in-jsx-scope": 0,
81-
"no-console": "off"
84+
"unused-imports/no-unused-vars": "off"
8285
},
8386
"env": {
8487
"node": true,

.flowconfig

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
flow-typed
1717

1818
[lints]
19-
# warn on all sketchy-null checks
20-
sketchy-null=warn
21-
sketchy-number=warn
22-
unnecessary-optional-chain=warn
23-
# unused-promise=warn # needs v0.201.0, but is not working for @jgclark
19+
# FIXME: all of the below seem to crash flow in VSCode
20+
#all=warn # warn on everything, except those specified. I don't see why this isn't working.
21+
#sketchy-null=warn
22+
#sketchy-number=warn
23+
#invalid-computed-prop=off
24+
#unnecessary-optional-chain=warn
25+
#unused-promise=warn # was not working for @jgclark at v0.202
2426

2527
[options]
2628
autoimports=false

.github/workflows/node.js.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Disable/enable this script at: https://github.com/NotePlan/plugins/actions/workflows/node.js.yml
2+
13
# Run tests on push or pull_request
24
# per: https://joelhooks.com/jest-and-github-actions/
35
# also uses github-actions-reporter.js for reporting
@@ -27,8 +29,8 @@ jobs:
2729
runs-on: macos-latest
2830
strategy:
2931
matrix:
30-
# node-version: [14.x, 16.x, 18.x, 19.x]
31-
node-version: [20.x,22.x]
32+
# node-version: [14.x, 16.x, 18.x, 19.x, 20.x]
33+
node-version: [22.x]
3234
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
3335

3436
steps:
@@ -38,9 +40,11 @@ jobs:
3840
with:
3941
node-version: ${{ matrix.node-version }}
4042
cache: 'npm'
43+
- name: Disable optional dependencies # work around git bug on macos arm64 dependencies
44+
run: export NPM_CONFIG_OPTIONAL=false
4145
# shoulde eventually be a clean install using: - run: npm ci --legacy-peer-deps
4246
# - run: npm i -g node-gyp@latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js"
43-
- run: npm ci # clean install (deletes node_modules)
47+
- run: npm ci --legacy-peer-deps # clean install (deletes node_modules)
4448
- run: npm link # necessary for some reason specific to NP dev setup
4549
# note: when upgrade to node 16+, add this to the following --max-old-space-size=8192
4650
- run: NODE_OPTIONS=--max-old-space-size=8192 npm run test:ci # run Jest CI version and stop if errors
@@ -88,7 +92,7 @@ jobs:
8892
cache: 'npm'
8993
# shoulde eventually be a clean install using: - run: npm ci --legacy-peer-deps
9094
# - run: npm i -g node-gyp@latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js"
91-
- run: npm ci # clean install (deletes node_modules)
95+
- run: npm ci --legacy-peer-deps # clean install (deletes node_modules)
9296
- run: npm link # necessary for some reason specific to NP dev setup
9397
# note: when upgrade to node 16+, add this to the following --max-old-space-size=8192
9498
- run: NODE_OPTIONS=--max-old-space-size=8192 node scripts/rollup.js -b -ci # build all plugins and stop if errors
@@ -119,4 +123,4 @@ jobs:
119123
"state": "failure",
120124
"description": "Plugins Build failed",
121125
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
122-
}'
126+
}'

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DS_Store
2-
node_modules/
2+
node_modules*
33
dist/
44
.cache/
55
*/ts-template/*.*
@@ -21,5 +21,5 @@ coverage/
2121
docs/assets/
2222
docs/index.html
2323
Documentation-Helpers
24-
**/*.bundle.dev.js
25-
**/*.bundle.min.js
24+
**/react.*.dev.js
25+
**/react.*.min.js

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
jgclark.*

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"semi": false
3+
}

.windsurfrules

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# NOTEPLAN PLUGINS DEVELOPMENT GUIDE
2+
3+
## Build/Test Commands
4+
- Build plugin: `npm run build <plugin-name>` or `npm run build:minified`
5+
- Lint code: `npm run lint` or fix issues with `npm run lint-fix`
6+
- Type check: `npm run typecheck`
7+
- Run a test: `jest <test-file> --no-watch`
8+
9+
## Code Style Guidelines
10+
- Use Flow for static typing
11+
- No semicolons (enforced by ESLint/Prettier)
12+
- Single quotes for strings
13+
- Max line length: 180 characters
14+
- Use template literals instead of string concatenation
15+
- Use ES6+ features (const/let, arrow functions)
16+
- Use async/await and handle promises properly (no floating promises)
17+
- Follow existing naming patterns in the codebase
18+
- Proper error handling with try/catch blocks
19+
- Follow import order: external libs -> internal libs -> local files
20+
- Keep code DRY and modular with clear function responsibilities
21+
- Use JSDoc comments for public functions
22+
23+
## Common Helper Functions
24+
The most frequently used functions in the codebase are:
25+
- Logging: logDebug, logError, clo, logInfo, logWarn
26+
- Note utilities: findNote, getParagraphs, getSelectedParagraphs, getTasksFromNote
27+
- Date handling: getTodaysDateHyphenated, getDateStringFromCalendarFilename
28+
- Configuration: getSettings, updateSettingsForPlugin
29+
- UI interaction: showMessage, showMessageYesNo, displayTitle
30+
31+
When developing, check the helpers/ directory for existing utility functions before writing your own.
32+
33+
For JS/TS, please provide Flow (as appropriate) and JSDOC with all responses. If you are rewriting a full file, make sure to include all import statements also. Do not remove any console.logs or comments (or logDebug, clo, logInfo, logError statements).
34+
35+
**DO NOT EVER HARD-CODE JEST WORKAROUNDS INTO FUNCTIONS WE ARE TESTING**
36+
When you run jest tests, always include the flag --no-watch at the end because my jest config by default watches

CLAUDE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# NOTEPLAN PLUGINS DEVELOPMENT GUIDE
2+
3+
## Build/Test Commands
4+
- Build plugin: `npm run build <plugin-name>` or `npm run build:minified`
5+
- Lint code: `npm run lint` or fix issues with `npm run lint-fix`
6+
- Type check: `npm run typecheck`
7+
- Run all tests: `npm run test`
8+
- Run single test: `npx jest path/to/file.test.js -t "test name"`
9+
- Watch tests: `npm run test:watch`
10+
- Development mode: `npm run dev`
11+
12+
## Code Style Guidelines
13+
- Use Flow for static typing
14+
- No semicolons (enforced by ESLint/Prettier)
15+
- Single quotes for strings
16+
- Max line length: 180 characters
17+
- Use template literals instead of string concatenation
18+
- Use ES6+ features (const/let, arrow functions)
19+
- Use async/await and handle promises properly (no floating promises)
20+
- Follow existing naming patterns in the codebase
21+
- Proper error handling with try/catch blocks
22+
- Follow import order: external libs -> internal libs -> local files
23+
- Keep code DRY and modular with clear function responsibilities
24+
- Use JSDoc comments for public functions
25+
26+
## Common Helper Functions
27+
The most frequently used functions in the codebase are:
28+
- Logging: logDebug, logError, clo, logInfo, logWarn
29+
- Note utilities: findNote, getParagraphs, getSelectedParagraphs, getTasksFromNote
30+
- Date handling: getTodaysDateHyphenated, getDateStringFromCalendarFilename
31+
- Configuration: getSettings, updateSettingsForPlugin
32+
- UI interaction: showMessage, showMessageYesNo, displayTitle
33+
34+
When developing, check the helpers/ directory for existing utility functions before writing your own.

0 commit comments

Comments
 (0)