mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
* feat(build): Make build tasks invoke their prerequisites
- Divide gulp targets into three kinds: main sequence,
manually invokable, and script-only. The first two categories
automatically invoke their prerequisites.
- Give (most of) the affected gulp targets shorter and more memorable
names that could become their npm script names in future.
* feat(build): Make package tasks invoke their prerequisites
Have the package task invoke the cleanBuildDir (as well as
cleanPackageDir) and build tasks. Remove the checkBuildDir
task as it is now redundant since a fresh build is done every
time.
* feat(build): Make git tasks invoke their prerequisites
* feat(build): Make cleanup, license [sic] tasks invoke their prerequisites
Turns out they don't have any, so this commit just classifies
their gulp targets according to the established scheme.
* feat(build): Make appengine tasks invoke their prerequisites
In this case prepareDeployDir will eventually depend on package
but does not for now.
* feat(build): Have npm scripts run npm ci first where applicable
Have any npm script that have external effects (e.g. publishing an
npm package, pushing a new version to appengine, or updating GitHub
Pages) start by running npm ci to ensure that all dependencies are
up-to-date with respect to package-lock.json.
(This is done by npm and not a gulp script because gulp itself
might need updating. So might npm, but that is less likely to
make any difference to what gets published/pushed.)
* chore(build): have tests use package target
Have the tests just run the package target (with debug flags)
since that runs the the build target automatically.
* feat(tests): Write Closure Compiler output directly to dist/
Since they are already UMD-wrapped, have Closure Compiler write
output chunks directly to RELEASE_DIR, i.e. dist/.
* chore(tests): Use freshly-build files in compressed mode.
Use the freshly-built build/*_compresssed.js files when bootstrapping
in compressed mode, rather than using the checked-in files in the
repository root.
This helps ensure that compressed and uncompressed mode will be
testing (as closely as possible) the same code.
Obsoletes #6218 (though the issues discussed there have not actually
yet been addressed in this branch).
* chore(build): Write intermediate langfiles to build/msg
Write the results of create_messages.py to build/msg instead of
build/msg/js.
* fix(build): Use build/msg/en.js instead of msg/messages.js in tests
This has no direct effect but fixes a long-standing misdesign
where we are testing against the input to, rather than the output
of, the language file processing pipeline.
* feat(demos): Use freshly-built files
Use the freshly-built dist/*_compresssed.js and build/msg/* files
rather than using the checked-in files in the repository root.
This helps ensure that these demos are using the most recent
version of Blockly (even in the develop branch).
* fix(build): Update appengine deployment to include built files
Modify the prepareDemos task as follows:
- Use the git index instead of HEAD, so that most local changes
will be applied (without copying whatever .gitignored cruft
might be in the local directory).
- Run clean and build and then copy build/msg and
dist/*_compressed.js* to the deploy directory.
This fixes the problem created by the previous commit, wherein the
demos relied on built files that were not being deployed to
appengine.
* fix(build): Update GitHub Pages deployment to include built files
Modify the updateGithubPages task to run clean and build and
then git add build/msg dist/*_compressed.js*, so that they will
be included in the deployed pages.
This fixes the problem created by the previous^2 commit,
wherein the demos relied on built files that were not being
deployed to GitHub Pages.
* chore(build): Remove build products from repository
Remove *_compressed.js* and msg/js/* from the blockly repository.
Also remove the now-obsolete checkinBuilt gulp task.
* chore(build): Apply relevant changes to test_tasks.js
Apply changes made to run_all_tests.sh and check_metadata.sh to
the corresponding parts of their JS replacements in
test_tasks.js.
* chore(build): Make updates suggested in PR #6475
- Remove `clean:builddir` and `clean:releasedir` - `clean`
is sufficient.
- Remove duplicate `require` from `appengine_tasks.js`.
* feat(build): Use shorter npm script names
Since scripts that run build tasks now automatically run their
prerequisite tasks, the previous naming scheme of task `build`
running all the `build:subtask`s no longe really makes very
much sense.
Additionally, following a chat discussion, there seems to be a
rough consensus to use "messages" to refer to the .json input
files, and "langfiles" to the generated .js output files.
Consequently, simplify npm script names by renaming as follows:
- "generate:langfiles" -> "messages"
- "build:langfiles" -> "langfiles"
- "build:js" -> "tsc"
- "build:deps" -> "deps"
- "build:compiled" -> "minify"
- "build:compressed": delete this synonym for "build:compiled",
("minify" was chosen as agnostic to Closure Compiler vs. WebPack.)
* chores(build): Add deprecation notice for old scripts
To reduce potential confusion/frustration, restore the previous
npm scripts but have them display a deprecation notice instead
(note that npm prints the script contents before running it, so
echo is not needed).
* docs(build): Add comments distinguishing 'messages' from 'langfiles'
225 lines
6.8 KiB
HTML
225 lines
6.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="target-densitydpi=device-dpi, height=660, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
<title>Blockly Demo: Block Factory</title>
|
|
<script src="/storage.js"></script>
|
|
<script src="factory.js"></script>
|
|
<script src="../../dist/blockly_compressed.js"></script>
|
|
<script src="../../build/msg/en.js"></script>
|
|
<script src="blocks.js"></script>
|
|
<style>
|
|
html, body {
|
|
height: 100%;
|
|
}
|
|
body {
|
|
background-color: #fff;
|
|
font-family: sans-serif;
|
|
margin: 0 5px;
|
|
overflow: hidden
|
|
}
|
|
h1 {
|
|
font-weight: normal;
|
|
font-size: 140%;
|
|
}
|
|
h3 {
|
|
margin-top: 5px;
|
|
margin-bottom: 0;
|
|
}
|
|
table {
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
td {
|
|
vertical-align: top;
|
|
padding: 0;
|
|
}
|
|
#blockly {
|
|
position: fixed;
|
|
}
|
|
#blocklyMask {
|
|
background-color: #000;
|
|
cursor: not-allowed;
|
|
display: none;
|
|
position: fixed;
|
|
opacity: 0.2;
|
|
z-index: 9;
|
|
}
|
|
#preview {
|
|
position: absolute;
|
|
}
|
|
pre,
|
|
#languageTA {
|
|
border: #ddd 1px solid;
|
|
margin-top: 0;
|
|
position: absolute;
|
|
overflow: scroll;
|
|
}
|
|
#languageTA {
|
|
display: none;
|
|
font-family: monospace;
|
|
font-size: 10pt;
|
|
}
|
|
|
|
button {
|
|
border-radius: 4px;
|
|
border: 1px solid #ddd;
|
|
background-color: #eee;
|
|
color: #000;
|
|
padding: 10px;
|
|
margin: 0 5px;
|
|
font-size: large;
|
|
}
|
|
button:hover:not(:disabled) {
|
|
box-shadow: 2px 2px 5px #888;
|
|
}
|
|
button:disabled {
|
|
opacity: 0.6;
|
|
}
|
|
button>* {
|
|
opacity: 0.6;
|
|
vertical-align: text-bottom;
|
|
}
|
|
button:hover:not(:disabled)>* {
|
|
opacity: 1;
|
|
}
|
|
#linkButton {
|
|
display: none;
|
|
}
|
|
</style>
|
|
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
|
|
</head>
|
|
<body>
|
|
<table>
|
|
<tr>
|
|
<td width="50%" height="5%">
|
|
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
|
<a href="../index.html">Demos</a> > Block Factory</h1>
|
|
</td>
|
|
<td width="50%" height="5%">
|
|
<table>
|
|
<tr>
|
|
<td style="vertical-align: bottom;">
|
|
<h3>Preview:
|
|
<select id="direction">
|
|
<option value="ltr">LTR</option>
|
|
<option value="rtl">RTL</option>
|
|
</select>
|
|
</h3>
|
|
</td>
|
|
<td style="vertical-align: middle; text-align: right;">
|
|
<button id="linkButton" title="Save and link to blocks.">
|
|
<img src="link.png" height="21" width="21">
|
|
</button>
|
|
<button id="linkButton" title="Save and link to blocks.">
|
|
<img src="link.png" height="21" width="21">
|
|
</button>
|
|
<button id="helpButton" title="View documentation in new window.">
|
|
<span>Help</span>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="50%" height="95%" style="padding: 2px;">
|
|
<div id="blockly"></div>
|
|
<div id="blocklyMask"></div>
|
|
</td>
|
|
<td width="50%" height="95%">
|
|
<table>
|
|
<tr>
|
|
<td height="30%">
|
|
<div id="preview"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td height="5%">
|
|
<h3>Language code:
|
|
<select id="format">
|
|
<option value="JSON">JSON</option>
|
|
<option value="JavaScript">JavaScript</option>
|
|
<option value="Manual">Manual edit…</option>
|
|
</select>
|
|
</h3>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td height="30%">
|
|
<pre id="languagePre" class="prettyprint lang-js"></pre>
|
|
<textarea id="languageTA"></textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td height="5%">
|
|
<h3>Generator stub:
|
|
<select id="language">
|
|
<option value="JavaScript">JavaScript</option>
|
|
<option value="Python">Python</option>
|
|
<option value="PHP">PHP</option>
|
|
<option value="Lua">Lua</option>
|
|
<option value="Dart">Dart</option>
|
|
</select>
|
|
</h3>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td height="30%">
|
|
<pre id="generatorPre" class="prettyprint lang-js"></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display: none">
|
|
<category name="Input">
|
|
<block type="input_value">
|
|
<value name="TYPE">
|
|
<shadow type="type_null"></shadow>
|
|
</value>
|
|
</block>
|
|
<block type="input_statement">
|
|
<value name="TYPE">
|
|
<shadow type="type_null"></shadow>
|
|
</value>
|
|
</block>
|
|
<block type="input_dummy"></block>
|
|
</category>
|
|
<category name="Field">
|
|
<block type="field_static"></block>
|
|
<block type="field_input"></block>
|
|
<block type="field_number"></block>
|
|
<block type="field_angle"></block>
|
|
<block type="field_dropdown"></block>
|
|
<block type="field_checkbox"></block>
|
|
<block type="field_colour"></block>
|
|
<block type="field_variable"></block>
|
|
<block type="field_image"></block>
|
|
</category>
|
|
<category name="Type">
|
|
<block type="type_group"></block>
|
|
<block type="type_null"></block>
|
|
<block type="type_boolean"></block>
|
|
<block type="type_number"></block>
|
|
<block type="type_string"></block>
|
|
<block type="type_list"></block>
|
|
<block type="type_other"></block>
|
|
</category>
|
|
<category name="Colour" id="colourCategory">
|
|
<block type="colour_hue"><mutation colour="20"></mutation><field name="HUE">20</field></block>
|
|
<block type="colour_hue"><mutation colour="65"></mutation><field name="HUE">65</field></block>
|
|
<block type="colour_hue"><mutation colour="120"></mutation><field name="HUE">120</field></block>
|
|
<block type="colour_hue"><mutation colour="160"></mutation><field name="HUE">160</field></block>
|
|
<block type="colour_hue"><mutation colour="210"></mutation><field name="HUE">210</field></block>
|
|
<block type="colour_hue"><mutation colour="230"></mutation><field name="HUE">230</field></block>
|
|
<block type="colour_hue"><mutation colour="260"></mutation><field name="HUE">260</field></block>
|
|
<block type="colour_hue"><mutation colour="290"></mutation><field name="HUE">290</field></block>
|
|
<block type="colour_hue"><mutation colour="330"></mutation><field name="HUE">330</field></block>
|
|
</category>
|
|
</xml>
|
|
</body>
|
|
</html>
|