Skip to content

Commit 8405d41

Browse files
committed
feat: individual package entries
1 parent 3e5d7a7 commit 8405d41

5 files changed

Lines changed: 28 additions & 5 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "Minimal Markdown",
3+
"content_type": "SN|Component",
4+
"main": "index.html",
5+
"area": "editor-editor",
6+
"spellcheckControl": true,
7+
"note_type": "markdown",
8+
"file_type": "txt",
9+
"base64": "f44b4d0ca78b3deed9931a568c526fe49a6b420258325a85e5f89e94cb2ca540",
10+
"binary": "253d19c1d84df15daa47c329a7299c6a50873c27929656ee96fa61ae988526d7",
11+
"url": "https://raw.githubusercontent.com/standardnotes/community-packages/main/cdn/static/com.sncommunity.minimal-markdown/index.html",
12+
"download_url": "https://raw.githubusercontent.com/standardnotes/community-packages/main/cdn/zips/com.sncommunity.minimal-markdown.zip"
13+
}

cdn/packages.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"com.sncommunity.minimal-markdown": {
33
"name": "Minimal Markdown",
44
"content_type": "SN|Component",
5+
"main": "index.html",
56
"area": "editor-editor",
67
"spellcheckControl": true,
78
"note_type": "markdown",
89
"file_type": "txt",
9-
"base64": "f731673036cdaf22ee83442ac9065e84fc61254d7e6a5e796e45f7f01ab76fee",
10-
"binary": "c1ccc1124db21b7113dc2ef2c27b99d8958f1ab7b1100cc8d370f96e96790f82",
11-
"url": "https://raw.githubusercontent.com/standardnotes/community-packages/main/cdn//static/com.sncommunity.minimal-markdown/undefined",
12-
"download_url": "https://raw.githubusercontent.com/standardnotes/community-packages/main/cdn//zips/com.sncommunity.minimal-markdown.zip"
10+
"base64": "f44b4d0ca78b3deed9931a568c526fe49a6b420258325a85e5f89e94cb2ca540",
11+
"binary": "253d19c1d84df15daa47c329a7299c6a50873c27929656ee96fa61ae988526d7",
12+
"url": "https://raw.githubusercontent.com/standardnotes/community-packages/main/cdn/static/com.sncommunity.minimal-markdown/index.html",
13+
"download_url": "https://raw.githubusercontent.com/standardnotes/community-packages/main/cdn/zips/com.sncommunity.minimal-markdown.zip"
1314
}
1415
}
10 Bytes
Binary file not shown.

packages/com.sncommunity.minimal-markdown/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"sn": {
88
"name": "Minimal Markdown",
99
"content_type": "SN|Component",
10+
"main": "index.html",
1011
"area": "editor-editor",
1112
"spellcheckControl": true,
1213
"note_type": "markdown",

scripts/Package.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const SourceFilesPath = path.join(__dirname, "../packages")
2424
const CdnDir = path.join(__dirname, "../cdn")
2525
const ZipsDir = path.join(CdnDir, "/zips")
2626
const AssetsDir = path.join(CdnDir, "/static")
27+
const EntriesDir = path.join(CdnDir, "/entries")
2728

2829
const TmpDir = path.join(__dirname, "../tmp")
2930
const PackagesJsonPath = path.join(CdnDir, "packages.json")
@@ -158,13 +159,20 @@ const packageFeature = async ({ feature, noZip }) => {
158159
packageJsonFile.version
159160
)
160161

161-
PackagesJson[feature.identifier] = {
162+
const packageEntry = {
162163
...packageJsonFile.sn,
163164
...checksum,
164165
url: `${CdnInfoJson.host}/static/${feature.identifier}/${packageJsonFile.sn.main}`,
165166
download_url: `${CdnInfoJson.host}/zips/${feature.identifier}.zip`,
166167
}
167168

169+
PackagesJson[feature.identifier] = packageEntry
170+
171+
fs.writeFileSync(
172+
`${EntriesDir}/${feature.identifier}.json`,
173+
JSON.stringify(packageEntry, undefined, 2)
174+
)
175+
168176
console.log(`Computed checksums for ${feature.identifier}:`, checksum)
169177
}
170178

0 commit comments

Comments
 (0)