Skip to content

refactor: samples generation#1122

Closed
shuowu wants to merge 3 commits intomasterfrom
sw-samples-generation-refactor
Closed

refactor: samples generation#1122
shuowu wants to merge 3 commits intomasterfrom
sw-samples-generation-refactor

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.

"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.

"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

@shuowu-okta shuowu-okta force-pushed the sw-samples-generation-refactor branch from cf53d09 to 8e52c19 Compare February 25, 2022 19:43
const viewTemplatesDir = `${SRC_DIR}/${template}/**/views/*`;
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 eng_productivity_ci_bot_okta@okta.com>>>
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