ember-welcome-page
Version:
Welcome page for Ember CLI applications
38 lines (32 loc) • 2.95 kB
JavaScript
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { getOwner } from '@ember/application';
import { VERSION } from '@ember/version';
import Component from '@glimmer/component';
import './welcome-page.css';
var TEMPLATE = precompileTemplate("<main id=\"ember-welcome-page-id-selector\">\n <div class=\"columns\">\n <div class=\"tomster\">\n <img src=\"{{this.rootURL}}ember-welcome-page/images/construction.png\" alt=\"Under construction\">\n </div>\n <div class=\"welcome\">\n <h1 id=\"title\">Congratulations, you made it!</h1>\n\n <p>You’ve officially spun up your Ember app. You’ve got one more decision to make: what do you want to do next? We’d suggest one of the following to help you get going:</p>\n <ul>\n <li><a href=\"{{this.urlForEmberGuides}}/getting-started/quick-start/\">Quick Start</a> - a quick introduction to how Ember works. Learn about defining your first route, writing a UI component and deploying your application.</li>\n <li><a href=\"{{this.urlForEmberGuides}}/tutorial/\">Tutorial</a> - this is our more thorough, hands-on intro to Ember. Your crash course in Ember philosophy, background and some in-depth discussion of how things work (and why they work the way they do).</li>\n </ul>\n <p>If you run into problems, please join <a href=\"https://discord.gg/emberjs\">our community\'s Discord server</a> or visit <a href=\"http://discuss.emberjs.com/\">our forums</a> for ideas and answers— our community is filled with friendly folks who are willing to help! We enjoy helping new Ember developers get started, and our <a href=\"https://emberjs.com/community/\">Ember Community</a> is incredibly supportive.</p>\n </div>\n </div>\n <p class=\"postscript\">To remove this welcome message, remove the\n <code>\n <WelcomePage />\n </code>\n component from your\n <code>\n app/templates/application.hbs\n </code>\n file and save it...you\'ll see this page update soon after!\n </p>\n</main>\n\n");
function isLatestVersion() {
const stableRegex = /^\d+\.\d+\.\d+$/;
return !stableRegex.test(VERSION);
}
/* eslint-disable-next-line @typescript-eslint/no-empty-interface */
class WelcomePageComponent extends Component {
get rootURL() {
const config = getOwner(this).factoryFor('config:environment');
if (config) {
return config.class.rootURL;
}
return '/';
}
get urlForEmberGuides() {
if (isLatestVersion()) {
return `https://guides.emberjs.com/release`;
}
const [majorVersion, minorVersion] = VERSION.split('.');
const emberVersion = `${majorVersion}.${minorVersion}.0`;
return `https://guides.emberjs.com/v${emberVersion}`;
}
}
setComponentTemplate(TEMPLATE, WelcomePageComponent);
export { WelcomePageComponent as default };
//# sourceMappingURL=welcome-page.js.map