Skip to content

Commit 80c9fae

Browse files
authored
[other] clarify run instructions / editing in startDev.js (#1108)
# Pull Request Template ## Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. Fixes # (issue) ## Type of change Please delete options that are not relevant. - [ ] 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) - [ ] This change requires a documentation update ## How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [ ] Unit test - [ ] Integration test ## JS Budget Check Please mention the size in kb before abd after this PR | Files | Before | After | | ----------- | ----------- | ----------- | | dist/build.js. | | | | dist/build.min.js| | | ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules - [ ] I have checked my code and corrected any misspellings ## Mentions: List the person or team responsible for reviewing proposed changes. cc @BranchMetrics/saas-sdk-devs for visibility.
1 parent c041e9d commit 80c9fae

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

startDev.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const defaultDev = {
1010
"port": "3000"
1111
};
1212

13+
const TEMPLATE_FILE = 'examples/example.template.html';
14+
const DEV_HTML = 'dev.html';
15+
1316
async function fileExists(filePath) {
1417
try {
1518
await fs.access(filePath);
@@ -61,8 +64,8 @@ async function processTemplate(templateFile, outputFile, replacements) {
6164

6265
async function writeExampleHtml(config) {
6366
// Define your file paths and replacements
64-
const templateFile = path.join(__dirname, 'examples/example.template.html');
65-
const outputFile = path.join(__dirname, 'dev.html');
67+
const templateFile = path.join(__dirname, TEMPLATE_FILE);
68+
const outputFile = path.join(__dirname, DEV_HTML);
6669
const replacements = {
6770
'key_place_holder': config.sdkKey,
6871
'api_place_holder': config.APIEndpoint,
@@ -79,13 +82,12 @@ function executeBuild(config) {
7982
console.error(`Error executing makefile: ${error.message}`);
8083
return;
8184
}
82-
console.log('Dev build successful.');
83-
console.log('Starting server...');
85+
console.log(`Dev websdk build successful, ${DEV_HTML} built from ${TEMPLATE_FILE}`);
8486
const app = new Koa();
8587
app.use(serve('.'));
8688
app.listen(config.port, () => {
8789
console.log('Server started successfully.');
88-
console.log(`Example page running at http://localhost:${config.port}/dev.html`);
90+
console.log(`Example page running at http://localhost:${config.port}/${DEV_HTML}. To edit, update ${TEMPLATE_FILE}`);
8991
});
9092
});
9193
}

0 commit comments

Comments
 (0)