Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/blockly/demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<body>
<h1><a href="https://docs.blockly.com/">Blockly</a> &gt; Demos</h1>

<p>Check out the <a href="https://google.github.io/blockly-samples/">Blockly samples page</a> for a comprehensive list of demos for developers who want to integrate Blockly into their own applications.</p>
<p>Check out the <a href="https://raspberrypifoundation.github.io/blockly-samples/">Blockly samples page</a> for a comprehensive list of demos for developers who want to integrate Blockly into their own applications.</p>
<p>The demos on this page combine Blockly features and AppEngine storage.</p>

<table>
Expand Down
64 changes: 13 additions & 51 deletions packages/blockly/scripts/gulpfiles/appengine_tasks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,11 @@ function prepareDeployDir(done) {
}

/**
* Copies all files from current git index into static deploy
* directory. We do this rather than just copying the working tree,
* because the working tree is probably full of leftover editor
* backup-save files, vesigial empty directories, etc.
* Copies demo and media files into the static deploy directory.
*/
function copyStaticSrc(done) {
execSync(`GIT_WORK_TREE='${demoStaticTmpDir}' git checkout-index --all`,
{ stdio: 'inherit' });
done();
return gulp.src(['demos/**', 'media/**'], {base: '.', encoding: false})
.pipe(gulp.dest(demoStaticTmpDir));
}

/**
Expand All @@ -50,57 +46,25 @@ function copyStaticSrc(done) {
* Prerequisite: clean, build.
*/
function copyBuilt(done) {
return gulp.src(['build/src/**/*', 'build/msg/*', 'dist/*_compressed.js*', 'build/*.loader.mjs'], {base: '.'})
.pipe(gulp.dest(demoStaticBlocklyDir));
}

/**
* Copies compressed files into the places they used to be used from, for the
* benefit of our Developers site and (for now) any other websites that
* hotlink them. Delete this once devsite is fixed.
*
* Prerequisite: clean, build.
*/
function copyCompressedToOldLocation(done) {
return gulp.src(['dist/*_compressed.js*'])
.pipe(gulp.dest(demoStaticTmpDir));
}

/**
* Copies messages files into the places they used to be used from, for the
* benefit of our Developers site and (for now) any other websites that
* hotlink them. Delete this once devsite is fixed.
*
* Prerequisite: clean, build.
*/
function copyMessagesToOldLocation(done) {
return gulp.src(['build/msg/*'])
.pipe(gulp.dest(`${demoStaticTmpDir}/msg/js`));
return gulp.src([
'build/src/**/*',
'build/msg/*',
'dist/*_compressed.js*',
'build/*.loader.mjs'
], {base: '.'}).pipe(gulp.dest(demoStaticTmpDir));
}

/**
* Copies appengine files into deploy directory.
*/
function copyAppengineSrc() {
const appengineSrc = [
`${demoStaticBlocklyDir}/appengine/**/*`,
`${demoStaticBlocklyDir}/appengine/.gcloudignore`,
`appengine/**/*`,
`appengine/.gcloudignore`,
];
return gulp.src(appengineSrc).pipe(gulp.dest(demoTmpDir));
}

/**
* Copies playground deps into deploy directory.
*/
function copyPlaygroundDeps() {
const playgroundDeps = [
'../../node_modules/@blockly/dev-tools/dist/index.js',
'../../node_modules/@blockly/theme-modern/dist/index.js',
'../../node_modules/@blockly/block-test/dist/index.js',
];
return gulp.src(playgroundDeps, {base: '../..'}).pipe(gulp.dest(demoStaticBlocklyDir));
}

/**
* Deploys files from tmp directory to appengine to version based on the version
* passed in and then cleans the tmp directory.
Expand Down Expand Up @@ -179,10 +143,8 @@ export const prepareDemos = gulp.series(
gulp.parallel(cleanBuildDir,
cleanReleaseDir),
execBuild,
gulp.parallel(copyBuilt,
copyCompressedToOldLocation,
copyMessagesToOldLocation)),
copyPlaygroundDeps));
copyBuilt),
));

/**
* Deploys demos.
Expand Down
Loading