-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update CDN installation instructions (#349)
* wip: update installation instructions * refactor: update CDN installation instructions * feat: add french translation for new CDN instructions * docs: update CDN instructions
- Loading branch information
1 parent
0f458f5
commit e50337c
Showing
7 changed files
with
138 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
async function getLatestCdnVersion() { | ||
try { | ||
// Fetch package metadata | ||
const response = await fetch( | ||
'https://registry.npmjs.org/@cdssnc/gcds-components', | ||
); | ||
const data = await response.json(); | ||
|
||
// Get latest version and release date | ||
const latestVersion = data['dist-tags'].latest; | ||
const releaseDate = new Date(data.time[latestVersion]); | ||
|
||
// Format the release date to 'YYYY-MM-DD' | ||
const formattedReleaseDate = `${releaseDate.getFullYear()}-${String(releaseDate.getMonth() + 1).padStart(2, '0')}-${String(releaseDate.getDate()).padStart(2, '0')}`; | ||
|
||
return { version: latestVersion, releaseDate: formattedReleaseDate }; | ||
} catch (error) { | ||
console.error('Error fetching latest version:', error); | ||
return { version: 'Unknown', releaseDate: 'Unknown' }; | ||
} | ||
} | ||
|
||
module.exports = { getLatestCdnVersion }; |