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

Add console log for npm version number and github hash #324

Merged
merged 13 commits into from
Aug 8, 2023

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Aug 3, 2023

Description

This PR adds a console log statement to log the npm version number from package.json and the current GitHub hash. The version number is injected into the build using the DefinePlugin in webpack, and the log statement is added to the main JavaScript file. This provides useful versioning information and helps with debugging.

Summary of Changes

  • Modified src/index.js to add a console.log statement to log the npm version number and GitHub hash.
  • Updated webpack.config.js to include the DefinePlugin that injects the npm version number into the build.

Fixes #260.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/add-console-log

To make tweaks to this pull request, leave a comment below or in the code.

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 3, 2023
@netlify
Copy link

netlify bot commented Aug 3, 2023

Deploy Preview for 3dstreet-core-builds ready!

Name Link
🔨 Latest commit 0eebcb5
🔍 Latest deploy log https://app.netlify.com/sites/3dstreet-core-builds/deploys/64d2b29bf02b650008971168
😎 Deploy Preview https://deploy-preview-324--3dstreet-core-builds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kfarr
Copy link
Collaborator

kfarr commented Aug 3, 2023

Thanks can you capitalize the V in version so that it says "Version"

Also is it possible to include in the console log the last date of the latest commit and the 8 character commit hash from github?

@kfarr
Copy link
Collaborator

kfarr commented Aug 3, 2023

please also include commit date and hash in the actual console log output in src/index.js

@kfarr
Copy link
Collaborator

kfarr commented Aug 3, 2023

Almost there, please format the console log output as follows:

3DStreet Version: [Version] (Date: [Date in YEAR-MM-DD format], Commit Hash: #[HASH])

@kfarr
Copy link
Collaborator

kfarr commented Aug 4, 2023

This does not work on local development server, when using npm start there is the following error:
Uncaught ReferenceError: VERSION is not defined

How to handle this case?

@kfarr
Copy link
Collaborator

kfarr commented Aug 4, 2023

Close but it still raises errors. Instead, if VERSION does not exist, then simply do not display the console log.

@kfarr
Copy link
Collaborator

kfarr commented Aug 4, 2023

Bump

@kfarr
Copy link
Collaborator

kfarr commented Aug 8, 2023

Close but it still raises errors. Instead, if VERSION does not exist, then simply do not display the console log.

@kfarr kfarr merged commit 3d4432e into main Aug 8, 2023
6 checks passed
@kfarr kfarr deleted the sweep/add-console-log branch August 8, 2023 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

console log npm version number and github hash
1 participant