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

[DEVOPS-3113] Add ability to version static assets #2

Merged
merged 49 commits into from
Dec 2, 2021

Conversation

ep-linden
Copy link
Contributor

@ep-linden ep-linden commented Nov 22, 2021

This PR implements the feature to version one or more static assets under website/static/ directory of Docusaurus V1 site structure.

This PR closes issue #3

…icVersion to improve clarity. Add static folder path in siteUtils.
…atible. Add helper function get versions json size.
…ion name as asset files are being versioned rather than just simply being moved elsewhere.
…. Change to relative paths in versioning assets.
…logic to check if docs is versioned for the first time to make the proper path updates. Accept sitepaths from versioning function.
…sion function. Add an if logic to check if static asset versioning needs to be done. Add better descriptions for the CLI options
Copy link
Contributor

@pa-eps pa-eps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the commit is old. I'm not seeing the latest changes/codes that we had discussed last time.

src/snapshotVersion.js Outdated Show resolved Hide resolved
src/snapshotVersion.js Outdated Show resolved Hide resolved
src/snapshotVersion.js Outdated Show resolved Hide resolved
src/lib/createVersion.js Outdated Show resolved Hide resolved
src/lib/assetVersioning.js Outdated Show resolved Hide resolved
…o check whether the next path exists by checking if there is access to it. Add comments accordingly

.
…encies because it is needed to test non-exported functions.
…variable name to directory from folder to be consistent with naming.
src/lib/siteUtils.js Outdated Show resolved Hide resolved
src/lib/createVersion.js Outdated Show resolved Hide resolved
src/lib/createVersion.js Outdated Show resolved Hide resolved
src/lib/staticVersioner.js Outdated Show resolved Hide resolved
…ts. Pass in next directly instead of setting it to a variable because it won't be used elsewhere and change logic in theremove function accordingly. Change variable name from assets to docs assets for clarity.
src/snapshotVersion.js Outdated Show resolved Hide resolved
src/snapshotVersion.js Outdated Show resolved Hide resolved
src/lib/createVersion.js Outdated Show resolved Hide resolved
src/lib/staticVersioner.js Outdated Show resolved Hide resolved
…et type is being versioned for the first time.
…. Remove console.log in staticVersioner and add static type variable to console.info to provide better information. Add package.json file.
…reateVersion includes new logic for versioning static assets and error-handling.
Copy link
Contributor

@pa-eps pa-eps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor changes needed as discussed.

src/lib/createVersion.js Outdated Show resolved Hide resolved
src/lib/staticVersioner.js Outdated Show resolved Hide resolved
src/snapshotVersion.js Outdated Show resolved Hide resolved
test/lib/createVersionTest.js Outdated Show resolved Hide resolved
…ync. Remove sinon-chai and upgrade commander version to latest. Since commander version is upgraded, remove storeOptionsAsProperties option. Add comments in staticVersioner.js to improve clarity and move the copyDirectory function in to the then and catch blocks. Include yarn.lock file.
…ningTest.js file. Capitalize the beginning of comments for consistency.
…exclusions. Reorganize test, add describes, and change the descriptions to improve clarity.
…e has been versioned already so the right regex can be searched and replaced.
src/snapshotVersion.js Outdated Show resolved Hide resolved
src/lib/staticVersioner.js Outdated Show resolved Hide resolved
src/lib/staticVersioner.js Outdated Show resolved Hide resolved
src/lib/staticVersioner.js Outdated Show resolved Hide resolved
…e variables are not being used again. Change staticDir description.
…mprove clarity. Fix the comment for the versionStaticAssets function to improve clarity. Rename relativeLinkPattern to searchPattern to improve clarity.
…and add negative tests for the private functions.
Copy link
Contributor

@pa-eps pa-eps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you 👍

@pa-eps pa-eps changed the title [DEVOPS-3113] Automate Static Asset Versioning [DEVOPS-3113] Add ability to version static assets Dec 2, 2021
@pa-eps pa-eps merged commit e503d06 into elasticpath:master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants