Skip to content

Commit a755e37

Browse files
Point gh-pages examples at the released A-Frame CDN build (#5838)
Rewrite the example aframe-master.js and aframe-master.module.min.js references to https://aframe.io/releases/<version>/aframe(.module).min.js, taking the version from package.json. Read the super-three version from the released tag's package.json instead of master so the examples reference the three version that shipped with this release. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b2fb2ff commit a755e37

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

scripts/preghpages.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ const shell = require('shelljs');
66
const replaceInFileSync = require('replace-in-file').replaceInFileSync;
77

88
const pkg = require('../package.json');
9-
const threeVersion = pkg.dependencies.three.split('@')[1];
9+
const aframeVersion = pkg.version;
10+
11+
// Take the super-three version from the released tag's package.json, not from
12+
// master, so the gh-pages examples reference the three version that shipped
13+
// with this A-Frame release.
14+
const taggedPkg = JSON.parse(
15+
shell.exec(`git show v${aframeVersion}:package.json`, { silent: true }).stdout
16+
);
17+
const threeVersion = taggedPkg.dependencies.three.split('@')[1];
1018

1119
const rootDir = path.join(__dirname, '..');
1220

@@ -29,5 +37,6 @@ function htmlReplace (before, after) {
2937
});
3038
}
3139

32-
htmlReplace('dist/aframe-master.js', 'dist/aframe-master.min.js');
40+
htmlReplace('../../../dist/aframe-master.module.min.js', `https://aframe.io/releases/${aframeVersion}/aframe.module.min.js`);
41+
htmlReplace('../../../dist/aframe-master.js', `https://aframe.io/releases/${aframeVersion}/aframe.min.js`);
3342
htmlReplace(/\.\.\/\.\.\/\.\.\/super-three-package/g, `https://cdn.jsdelivr.net/npm/super-three@${threeVersion}`);

0 commit comments

Comments
 (0)