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

refactor: samples generation #1122

Closed
wants to merge 3 commits into from
Closed

Conversation

shuowu
Copy link
Contributor

@shuowu shuowu commented Feb 23, 2022

Only perform overwrite with templates for express-embedded related samples, so engineers can develop directly from the samples folder.

@@ -7,8 +7,8 @@
"node": ">=10.0.0"
},
"scripts": {
"start": "node ./web-server/server.js",
"dev": "nodemon ./web-server/server.js --watch ../../../build/cjs"
"start": "SIW_VERSION=6.0.1 node ./web-server/server.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

How about

SIW_VERSION=${SIW_VERSION-6.0.1}

so that it will have a default value but also respect existing environment variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is overwrote by template, and template always load latest version from registry.

@@ -7,8 +7,8 @@
"node": ">=10.0.0"
},
"scripts": {
"start": "node ./web-server/server.js",
"dev": "nodemon ./web-server/server.js --watch ../../../build/cjs"
"start": "SIW_VERSION={{ siwVersion }} node ./web-server/server.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above,

SIW_VERSION=${SIW_VERSION-{{ siwVersion }} }

to respect existing env var

@aarongranick-okta
Copy link
Contributor

I'm not sure about this one. Some of the samples are now partially generated and partially edited in-place. How is a developer to know that package.json should be edited in samples/templates, but server.js should be edited in samples/generated? I think we should have a clear separation of generated code or we will get confused and edit the wrong file. Maybe the debugger problem could be solved with source maps? handlebars-lang/handlebars.js#902

const outDir = `${BUILD_DIR}/` + (subDir ? `${subDir}/` : '') + `${name}`;

console.log('outDir', outDir);
Copy link
Contributor

Choose a reason for hiding this comment

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

intentional log?

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2022

Codecov Report

Merging #1122 (631473d) into master (550944e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1122   +/-   ##
=======================================
  Coverage   93.51%   93.51%           
=======================================
  Files         154      154           
  Lines        4147     4147           
  Branches      906      906           
=======================================
  Hits         3878     3878           
  Misses        253      253           
  Partials       16       16           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 550944e...631473d. Read the comment docs.

eng-prod-CI-bot-okta pushed a commit that referenced this pull request Feb 26, 2022
OKTA-474183
<<<Jenkins Check-In of Tested SHA: 631473d for [email protected]>>>
Artifact: okta-auth-js
Files changed count: 99
PR Link: "#1122"
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.

4 participants