Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

feat(scripts): generate one-app-statics package #82

Merged
merged 13 commits into from
Apr 8, 2020

Conversation

infoxicator
Copy link
Contributor

@infoxicator infoxicator commented Mar 27, 2020

Created a script to generate the package.json for the one-app-statics package. The one-app-statics folder will contain the signed client assets generated by one app and published to npm so they can be accessed using jsDelivr

package.json inside the statics will be maintained by the release draft PR

Description

  1. The script copies the version number from the main package.json
  2. The statics assets folder includes a README to explain why we created that package
  3. Warnings have been placed in the postinstall.js script and the index.js script of the one-app-statics package so people do not use it by mistake
  4. the build artefacts are generated at build time and extracted from the production docker image when the continuous integration system runs.

Motivation and Context

This change supports the deployment of static client assets so they can be loaded from a CDN

How Has This Been Tested?

~~Tested script using node ./scripts/generate-statics-package-json.js and ~~ uploaded npm package using travis, however the release cycle will be addressed on a separate PR using Github actions.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)

Checklist:

  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • These changes should be applied to a maintenance branch.
  • This change requires cross browser checks.
  • Performance tests should be ran against the server prior to merging.
  • This change impacts caching for client browsers.
  • This change impacts HTTP headers.
  • This change adds additional environment variable requirements for One App users.
  • I have added the Apache 2.0 license header to any new files created.

What is the Impact to Developers Using One App?

No Impact to users, this is used to support the One App release cycle

@infoxicator infoxicator requested a review from a team as a code owner March 27, 2020 11:45
@CLAassistant
Copy link

CLAassistant commented Mar 27, 2020

CLA assistant check
All committers have signed the CLA.

one-app-statics/README.md Outdated Show resolved Hide resolved
one-app-statics/README.md Outdated Show resolved Hide resolved
one-app-statics/README.md Show resolved Hide resolved
one-app-statics/LICENSE.txt Show resolved Hide resolved
one-app-statics/index.js Outdated Show resolved Hide resolved
one-app-statics/postinstall.js Outdated Show resolved Hide resolved
scripts/generate-statics-package-json.js Outdated Show resolved Hide resolved
one-app-statics/index.js Outdated Show resolved Hide resolved
one-app-statics/package.json Show resolved Hide resolved
scripts/generate-statics-package-json.js Outdated Show resolved Hide resolved
infoxicator and others added 2 commits March 30, 2020 10:34
Co-Authored-By: Jonny Adshead <JAdshead@users.noreply.github.com>
one-app-statics/README.md Show resolved Hide resolved
one-app-statics/index.js Show resolved Hide resolved
@infoxicator
Copy link
Contributor Author

End to end release workflow was achieved in this branch https://github.com/infoxicator/one-app/blob/feat/actions-publish-statics/.github/workflows/docker_release.yml however, it requires changes to the build process here: https://github.com/infoxicator/one-app/blob/feat/actions-publish-statics/package.json#L22 and to the docker image here: https://github.com/infoxicator/one-app/blob/feat/actions-publish-statics/Dockerfile#L29 which is not ideal, so I have come up with an easier alternative and that is adding theone-app-scripts/package.json file to source control and bump the version using the automatic PR that @nellyk created the same way it is updating the main package.json, this simplifies the process and removes the need for a build script and changes to the docker image.

@JAdshead JAdshead requested a review from a team as a code owner April 2, 2020 18:28
@nellyk nellyk mentioned this pull request Apr 2, 2020
12 tasks
@mtomcal
Copy link
Contributor

mtomcal commented Apr 6, 2020

Looks good. Very simple using jsdelivr 👍

@infoxicator infoxicator merged commit 8b65858 into americanexpress:master Apr 8, 2020
@infoxicator infoxicator deleted the feat/one-app-statics branch April 8, 2020 10:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants