chore(@embark/site): Add `—template` deprecation notice.

This commit is contained in:
emizzle 2019-11-25 17:59:31 +11:00 committed by Iuri Matias
parent 0c5984c66d
commit db0e45e96e
8 changed files with 87 additions and 32 deletions

View File

@ -7,6 +7,7 @@
// https://github.com/embark-framework/embark-flow-template // https://github.com/embark-framework/embark-flow-template
// A new DApp can be created from that template with: // A new DApp can be created from that template with:
// embark new --template flow // embark new --template flow
// NOTE: the `--template` option is DEPRECATED in v5.
module.exports = { module.exports = {
typescript: false, typescript: false,
@ -20,6 +21,7 @@ module.exports = {
// https://github.com/embark-framework/embark-typescript-template // https://github.com/embark-framework/embark-typescript-template
// A new DApp can be created from that template with: // A new DApp can be created from that template with:
// embark new --template typescript // embark new --template typescript
// NOTE: the `--template` option is DEPRECATED in v5.
enabled: true enabled: true
// Setting `enabled: false` in this config will disable Embark's built-in Webpack // Setting `enabled: false` in this config will disable Embark's built-in Webpack
// pipeline. The developer will need to use a different frontend build tool, such as // pipeline. The developer will need to use a different frontend build tool, such as

View File

@ -7,6 +7,7 @@
// https://github.com/embark-framework/embark-flow-template // https://github.com/embark-framework/embark-flow-template
// A new DApp can be created from that template with: // A new DApp can be created from that template with:
// embark new --template flow // embark new --template flow
// NOTE: the `--template` option is DEPRECATED in v5.
module.exports = { module.exports = {
typescript: false, typescript: false,
@ -20,6 +21,7 @@ module.exports = {
// https://github.com/embark-framework/embark-typescript-template // https://github.com/embark-framework/embark-typescript-template
// A new DApp can be created from that template with: // A new DApp can be created from that template with:
// embark new --template typescript // embark new --template typescript
// NOTE: the `--template` option is DEPRECATED in v5.
enabled: true enabled: true
// Setting `enabled: false` in this config will disable Embark's built-in Webpack // Setting `enabled: false` in this config will disable Embark's built-in Webpack
// pipeline. The developer will need to use a different frontend build tool, such as // pipeline. The developer will need to use a different frontend build tool, such as

View File

@ -52,10 +52,14 @@ class Cmd {
.option('--simple', __('an alias for --contracts-only')) .option('--simple', __('an alias for --contracts-only'))
.option('--contracts-only', __('create a barebones project meant only for contract development')) .option('--contracts-only', __('create a barebones project meant only for contract development'))
.option('--locale [locale]', __('language to use (default: en)')) .option('--locale [locale]', __('language to use (default: en)'))
.option('--template <name/url>', __('download a template using a known name or a git host URL')) .option('--template <name/url>', __('DEPRECATED download a template using a known name or a git host URL'))
.action(function (name, options) { .action(function (name, options) {
setOrDetectLocale(options.locale); setOrDetectLocale(options.locale);
if (options.template) {
console.warn('--template has been deprecated and will be removed in future versions.');
}
if (options.contractsOnly && options.template) { if (options.contractsOnly && options.template) {
console.error('invalid: --contracts-only and --template options cannot be used together'.red); console.error('invalid: --contracts-only and --template options cannot be used together'.red);
process.exit(1); process.exit(1);
@ -97,7 +101,7 @@ class Cmd {
program program
.command('demo') .command('demo')
.option('--locale [locale]', __('language to use (default: en)')) .option('--locale [locale]', __('language to use (default: en)'))
.option('--template <name/url>', __('download a demo template using a known name or a git host URL')) .option('--template <name/url>', __('[DEPRECATED] download a demo template using a known name or a git host URL'))
.description(__('create a working dapp with a SimpleStorage contract')) .description(__('create a working dapp with a SimpleStorage contract'))
.action(function (options) { .action(function (options) {
setOrDetectLocale(options.locale); setOrDetectLocale(options.locale);
@ -106,6 +110,7 @@ class Cmd {
const hgi = hostedGitInfo.fromUrl(options.template); const hgi = hostedGitInfo.fromUrl(options.template);
const url = !hgi ? `embark-framework/embark-${options.template}-template#demo` : options.template; const url = !hgi ? `embark-framework/embark-${options.template}-template#demo` : options.template;
const folderName = !hgi ? `embark_${options.template}_demo` : 'template_demo'; const folderName = !hgi ? `embark_${options.template}_demo` : 'template_demo';
console.warn('--template has been deprecated and will be removed in future versions.');
embark.generateTemplate('demo', './', folderName, url); embark.generateTemplate('demo', './', folderName, url);
} else { } else {
embark.generateTemplate('demo', './', 'embark_demo'); embark.generateTemplate('demo', './', 'embark_demo');

View File

@ -88,6 +88,9 @@ embark new --template embark-react-dapp my-dapp
cd my-dapp cd my-dapp
embark run embark run
``` ```
{% notification danger 'DEPRECATION NOTICE' %}
The `--template` option has been deprecated in v5 and support will be removed in future versions.
{% endnotification %}
Then, in another terminal, Then, in another terminal,

View File

@ -25,6 +25,9 @@ $ embark new <YourDappName>
``` ```
## Creating apps from templates ## Creating apps from templates
{% notification danger 'DEPRECATION NOTICE' %}
The `--template` option has been deprecated in v5 and support will be removed in future versions.
{% endnotification %}
Another possible scenario to start from is taking advantage of a template. Embark [comes with templates](/templates) for various environments and frameworks, but you can also use any template created by the community. In order to create a new app from a template, use the `--template` option and either specify a supported template name, or a Git host URL. Another possible scenario to start from is taking advantage of a template. Embark [comes with templates](/templates) for various environments and frameworks, but you can also use any template created by the community. In order to create a new app from a template, use the `--template` option and either specify a supported template name, or a Git host URL.

View File

@ -16,7 +16,11 @@ Option | Description
--- | --- --- | ---
`--contracts-only` | create a barebones project meant only for contract development `--contracts-only` | create a barebones project meant only for contract development
`--simple` | an alias for `--contracts-only` `--simple` | an alias for `--contracts-only`
`--template` | download a template using a known name or a git host URL `--template` | **DEPRECATED IN v5** download a template using a known name or a git host URL
{% notification danger 'DEPRECATION NOTICE' %}
The `--template` option has been deprecated in v5 and support will be removed in future versions.
{% endnotification %}
The `--template` option supports several URL styles and shortcuts for git hosts: The `--template` option supports several URL styles and shortcuts for git hosts:
@ -47,8 +51,6 @@ A short name can be used for templates maintained in the Embark GitHub organizat
$ embark new --template typescript $ embark new --template typescript
``` ```
Please see our list of [officially supported templates](/templates/).
## demo ## demo
``` ```

View File

@ -1,5 +1,6 @@
layout: plugins layout: templates
tagline: 'Pick one and start right away.' tagline: 'Pick one and start right away.'
title: Templates title: Templates
data: templates data: templates
deprecationNotice: 'The <code>--template</code> option has been deprecated in v5 and support will be removed in future versions.'
--- ---

View File

@ -0,0 +1,37 @@
{{
partial('partial/header', {
title: __(page.title),
tagline: __(page.tagline),
compact: true
})
}}
<main role="main">
{% if page.deprecationNotice %}
<section class="o-container o-distance">
{{
partial('partial/notification', {
type: 'danger',
title: 'DEPRECATION NOTICE',
text: page.deprecationNotice
})
}}
</section>
{% endif %}
<section class="o-container o-distance">
<div class="o-grid">
{% for plugin in site.data[page.data] %}
{{
partial('partial/whisperbox', {
className: 'o-grid__column--1-1 o-grid__column--large-1-3',
title: plugin.name,
text: __(plugin.description),
link: {
text: __('plugins_page.learn_more_link'),
href: plugin.link
}
})
}}
{% endfor %}
</div>
</section>
</main>