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
3 changes: 1 addition & 2 deletions packages/blockly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
"minify": "gulp minify",
"package": "gulp pack",
"prepareDemos": "gulp prepareDemos",
"start": "npm run build && concurrently -n tsc,server \"tsc --watch --preserveWatchOutput --outDir \"build/src\" --declarationDir \"build/declarations\"\" \"http-server ./ -s -o /tests/playground.html -c-1\"",
"start:advanced": "npm run package && npx nx run @blockly/dev-tools:build && concurrently -n server,watch \"npx nx run @blockly/dev-tools:start\" \"npx nx watch --projects=@blockly/dev-tools --includeDependencies -- npm run build\"",
"start": "npm run package && npx nx run @blockly/dev-tools:build && concurrently -n watch,devtools-server,core-server \"npx nx watch --projects=@blockly/dev-tools --includeDependencies -- npm run build\" \"npx nx run @blockly/dev-tools:start --no-open\" \"http-server ./ -p 8081 -s -o /tests/playground.html -c-1\"",
"tsc": "gulp tsc",
"test": "gulp test",
"test:browser": "npx mocha --config tests/browser/.mocharc.js",
Expand Down
20 changes: 19 additions & 1 deletion packages/blockly/tests/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@
addEventHandlers();

document.querySelector('#version').innerText = Blockly.VERSION;

// If we're running locally, display the Advanced Playground link
if (
window.location.href.includes('127.0.0.1') ||
window.location.href.includes('localhost')
) {
document.querySelector('.advancedPlayground').style.display =
'inline';
}
}

/**
Expand Down Expand Up @@ -506,6 +515,10 @@
font-family: monospace;
}

.advancedPlayground {
display: none;
}

.ioLabel > .blocklyFlyoutLabelText {
font-style: italic;
}
Expand Down Expand Up @@ -534,7 +547,12 @@ <h1>Blockly Playground (<span id="version"></span>)</h1>

<p>
<input id="show" type="button" value="Show" /> -
<input id="hide" type="button" value="Hide" />
<input id="hide" type="button" value="Hide" /> -
<span class="advancedPlayground"
><a href="http://localhost:8080/">Advanced</a> -</span
>
<a href="playgrounds/web_component.html">Web Component</a> -
<a href="multi_playground.html">Multi Playground</a>
</p>

<form id="options">
Expand Down
6 changes: 6 additions & 0 deletions packages/plugins/dev-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);

const packageJson = require(resolveApp('package.json'));
const isTypescript = fs.existsSync(resolveApp('tsconfig.json'));
const options = process.argv.slice(2);

console.log(`Running start for ${packageJson.name}`);

Expand Down Expand Up @@ -178,6 +179,11 @@ compiler.hooks.done.tap('done', async (stats) => {
// Read the webpack devServer configuration.
const serverConfig = webpackDevServerConfig();

// If the --no-open option was passed in, respect it.
if (options.includes('--no-open')) {
serverConfig.open = false;
}

// Start the dev server.
const devServer = new WebpackDevServer(serverConfig, compiler);
devServer.startCallback((err) => {
Expand Down