Skip to content

Commit dcbd21d

Browse files
authored
fix: dont publish test directory, update ghpages (#631)
* fix: dont publish test directory, update ghpages * fix: remove gulp
1 parent f08551a commit dcbd21d

File tree

5 files changed

+24
-79
lines changed

5 files changed

+24
-79
lines changed

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
uses: actions/upload-pages-artifact@v3
6565
with:
6666
# Upload build folder
67-
path: './blockly-keyboard-experimentation/dist'
67+
path: './blockly-keyboard-experimentation/build'
6868

6969
deploy:
7070
environment:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"scripts": {
66
"audit:fix": "blockly-scripts auditFix",
77
"build": "blockly-scripts build",
8-
"ghpages": "webpack",
98
"clean": "blockly-scripts clean",
109
"lint": "eslint .",
1110
"lint:fix": "eslint . --fix",
1211
"format": "prettier --write .",
1312
"format:check": "prettier --check .",
13+
"ghpages": "node scripts/deploy.js",
1414
"predeploy": "blockly-scripts predeploy",
1515
"prepublishOnly": "npm login --registry https://wombat-dressing-room.appspot.com",
1616
"start": "blockly-scripts start",

scripts/deploy.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright 2025 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
const execSync = require('child_process').execSync;
8+
const fs = require('fs');
9+
10+
console.log(`Preparing test page for gh-pages deployment.`);
11+
12+
execSync(`npm run build && npm run predeploy`, {stdio: 'pipe'});
13+
14+
// Copy test/index.html to build/ directory.
15+
// Update the path at which the test_bundle can be found.
16+
let testPage = fs.readFileSync('./test/index.html').toString();
17+
testPage = testPage.replace('../build/test_bundle.js', 'test_bundle.js');
18+
fs.writeFileSync('build/index.html', testPage, 'utf-8');
19+
console.log(
20+
`Open 'build/index.html' in a browser to see results, or upload the 'build' directory to ghpages.`,
21+
);

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
},
1313
// NOTE: `test/**/*` is automatically included in `blockly-scripts start`.
1414
// Only src matters for production builds.
15-
"include": ["./src", "./test"],
16-
"exclude": ["./test/webdriverio/"]
15+
"include": ["./src"]
1716
}

webpack.config.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)