Skip to content

Commit

Permalink
Add NotificationClient as feature (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
tophtucker authored Oct 30, 2023
1 parent 09901d0 commit 82211b8
Show file tree
Hide file tree
Showing 108 changed files with 320 additions and 119 deletions.
2 changes: 2 additions & 0 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ function parseFeatures(cell, input) {
cell.fileAttachments = findFeatures(cell, "FileAttachment");
cell.databaseClients = findFeatures(cell, "DatabaseClient");
cell.secrets = findFeatures(cell, "Secret");
cell.notificationClients = findFeatures(cell, "NotificationClient");
} catch (error) {
if (error.node) {
const loc = getLineInfo(input, error.node.start);
Expand All @@ -381,6 +382,7 @@ function parseFeatures(cell, input) {
cell.fileAttachments = new Map();
cell.databaseClients = new Map();
cell.secrets = new Map();
cell.notificationClients = new Map();
}
return cell;
}
3 changes: 3 additions & 0 deletions test/input/notification-client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
let a = NotificationClient("slack:@claire");
}
3 changes: 2 additions & 1 deletion test/output/anonymous-block-cell.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/anonymous-expression-cell.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/anonymous-function.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/await-block-cell.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/await-in-arrow-function-expression.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/await-in-arrow-function.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/await-in-class.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/await-in-function.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/await-in-markdown.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": false,
"references": [
Expand All @@ -88,5 +89,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/await-yield.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/backslash-after-dollar-markdown.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": false,
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/backslash-before-dollar-markdown.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": false,
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/backslash-markdown.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": false,
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/bare-dynamic-import.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/basic.db.sql.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
]
]
],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": false,
"references": [
Expand All @@ -119,5 +120,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/basic.html.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": false,
"references": [
Expand All @@ -89,5 +90,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/basic.sql.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": false,
"references": [
Expand All @@ -88,5 +89,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
6 changes: 4 additions & 2 deletions test/output/basic.tex.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
},
"raw": true,
"references": [
Expand All @@ -110,5 +111,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/bigint-zero.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/bigint.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/binary-expression.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/block-leading-comment.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/block-trailing-comment.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/catch-clause.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/comment.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/computed-property-name.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/database-client.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@
]
]
],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/destructured-arrow-with-default.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/destructured-assignment-with-default.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@
],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/destructured-object-with-default.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/dynamic-import.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/empty.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/empty.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
3 changes: 2 additions & 1 deletion test/output/expression-trailing-comment.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"references": [],
"fileAttachments": [],
"databaseClients": [],
"secrets": []
"secrets": [],
"notificationClients": []
}
Loading

0 comments on commit 82211b8

Please sign in to comment.