@nx/vue 0.0.0-pr-22179-271588f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +68 -0
  3. package/executors.json +3 -0
  4. package/generators.json +50 -0
  5. package/index.d.ts +13 -0
  6. package/index.js +21 -0
  7. package/migrations.json +14 -0
  8. package/package.json +52 -0
  9. package/src/generators/application/application.d.ts +5 -0
  10. package/src/generators/application/application.js +70 -0
  11. package/src/generators/application/files/common/index.html.template +13 -0
  12. package/src/generators/application/files/common/src/app/App.spec.ts.template +12 -0
  13. package/src/generators/application/files/common/src/app/App.vue.template +54 -0
  14. package/src/generators/application/files/common/src/app/NxWelcome.vue.template +833 -0
  15. package/src/generators/application/files/common/src/main.ts.template +15 -0
  16. package/src/generators/application/files/common/tsconfig.app.json.template +8 -0
  17. package/src/generators/application/files/routing/src/router/index.ts.template +23 -0
  18. package/src/generators/application/files/routing/src/views/AboutView.vue.template +16 -0
  19. package/src/generators/application/files/routing/src/views/HomeView.vue.template +9 -0
  20. package/src/generators/application/files/stylesheet/src/styles.__style__.template +42 -0
  21. package/src/generators/application/lib/add-e2e.d.ts +3 -0
  22. package/src/generators/application/lib/add-e2e.js +67 -0
  23. package/src/generators/application/lib/add-vite.d.ts +3 -0
  24. package/src/generators/application/lib/add-vite.js +35 -0
  25. package/src/generators/application/lib/create-application-files.d.ts +3 -0
  26. package/src/generators/application/lib/create-application-files.js +30 -0
  27. package/src/generators/application/lib/normalize-options.d.ts +4 -0
  28. package/src/generators/application/lib/normalize-options.js +45 -0
  29. package/src/generators/application/schema.d.ts +31 -0
  30. package/src/generators/application/schema.json +140 -0
  31. package/src/generators/component/component.d.ts +5 -0
  32. package/src/generators/component/component.js +41 -0
  33. package/src/generators/component/files/__fileName__.spec.ts__tmpl__ +9 -0
  34. package/src/generators/component/files/__fileName__.vue__tmpl__ +10 -0
  35. package/src/generators/component/lib/utils.d.ts +4 -0
  36. package/src/generators/component/lib/utils.js +66 -0
  37. package/src/generators/component/schema.d.ts +37 -0
  38. package/src/generators/component/schema.json +104 -0
  39. package/src/generators/init/init.d.ts +4 -0
  40. package/src/generators/init/init.js +23 -0
  41. package/src/generators/init/schema.d.ts +5 -0
  42. package/src/generators/init/schema.json +27 -0
  43. package/src/generators/library/files/README.md +7 -0
  44. package/src/generators/library/files/package.json__tmpl__ +12 -0
  45. package/src/generators/library/files/src/index.ts__tmpl__ +0 -0
  46. package/src/generators/library/files/src/vue-shims.d.ts__tmpl__ +5 -0
  47. package/src/generators/library/files/tsconfig.lib.json__tmpl__ +27 -0
  48. package/src/generators/library/files/tsconfig.spec.json__tmpl__ +27 -0
  49. package/src/generators/library/lib/add-vite.d.ts +3 -0
  50. package/src/generators/library/lib/add-vite.js +58 -0
  51. package/src/generators/library/lib/create-library-files.d.ts +3 -0
  52. package/src/generators/library/lib/create-library-files.js +28 -0
  53. package/src/generators/library/lib/normalize-options.d.ts +3 -0
  54. package/src/generators/library/lib/normalize-options.js +56 -0
  55. package/src/generators/library/library.d.ts +5 -0
  56. package/src/generators/library/library.js +80 -0
  57. package/src/generators/library/schema.d.ts +42 -0
  58. package/src/generators/library/schema.json +139 -0
  59. package/src/generators/setup-tailwind/files/postcss.config.js.template +10 -0
  60. package/src/generators/setup-tailwind/files/tailwind.config.js.template +18 -0
  61. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts +3 -0
  62. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js +32 -0
  63. package/src/generators/setup-tailwind/schema.d.ts +6 -0
  64. package/src/generators/setup-tailwind/schema.json +45 -0
  65. package/src/generators/setup-tailwind/setup-tailwind.d.ts +4 -0
  66. package/src/generators/setup-tailwind/setup-tailwind.js +25 -0
  67. package/src/generators/stories/lib/component-story.d.ts +3 -0
  68. package/src/generators/stories/lib/component-story.js +34 -0
  69. package/src/generators/stories/lib/files/js/__componentFileName__.stories.js__tmpl__ +25 -0
  70. package/src/generators/stories/lib/files/ts/__componentFileName__.stories.ts__tmpl__ +32 -0
  71. package/src/generators/stories/lib/utils.d.ts +10 -0
  72. package/src/generators/stories/lib/utils.js +75 -0
  73. package/src/generators/stories/schema.json +67 -0
  74. package/src/generators/stories/stories.d.ts +13 -0
  75. package/src/generators/stories/stories.js +62 -0
  76. package/src/generators/storybook-configuration/configuration.d.ts +5 -0
  77. package/src/generators/storybook-configuration/configuration.js +43 -0
  78. package/src/generators/storybook-configuration/schema.d.ts +13 -0
  79. package/src/generators/storybook-configuration/schema.json +80 -0
  80. package/src/tailwind.d.ts +6 -0
  81. package/src/tailwind.js +29 -0
  82. package/src/utils/add-linting.d.ts +13 -0
  83. package/src/utils/add-linting.js +118 -0
  84. package/src/utils/ast-utils.d.ts +3 -0
  85. package/src/utils/ast-utils.js +33 -0
  86. package/src/utils/create-ts-config.d.ts +8 -0
  87. package/src/utils/create-ts-config.js +66 -0
  88. package/src/utils/ensure-dependencies.d.ts +6 -0
  89. package/src/utils/ensure-dependencies.js +24 -0
  90. package/src/utils/lint.d.ts +8 -0
  91. package/src/utils/lint.js +12 -0
  92. package/src/utils/test-utils.d.ts +3 -0
  93. package/src/utils/test-utils.js +30 -0
  94. package/src/utils/versions.d.ts +14 -0
  95. package/src/utils/versions.js +22 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017-2023 Narwhal Technologies Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ <p style="text-align: center;">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
+ <img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
7
+
8
+ <div style="text-align: center;">
9
+
10
+ [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
+ [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
+ [![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nx/workspace)
13
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
+ [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
16
+ [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
17
+
18
+ </div>
19
+
20
+
21
+ <hr>
22
+
23
+ # Nx: Smart Monorepos · Fast CI
24
+
25
+ Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
26
+
27
+ This package is a [Vue plugin for Nx](https://nx.dev/packages/vue).
28
+
29
+ ## Getting Started
30
+
31
+ ### Creating an Nx Workspace
32
+
33
+ **Using `npx`**
34
+
35
+ ```bash
36
+ npx create-nx-workspace
37
+ ```
38
+
39
+ **Using `npm init`**
40
+
41
+ ```bash
42
+ npm init nx-workspace
43
+ ```
44
+
45
+ **Using `yarn create`**
46
+
47
+ ```bash
48
+ yarn create nx-workspace
49
+ ```
50
+
51
+ ### Adding Nx to an Existing Repository
52
+
53
+ Run:
54
+
55
+ ```bash
56
+ npx nx@latest init
57
+ ```
58
+
59
+ ## Documentation & Resources
60
+
61
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
62
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
63
+ - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
64
+ - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
65
+
66
+ <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
67
+ width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
68
+
package/executors.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "executors": {}
3
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "Nx Vue",
3
+ "version": "0.1",
4
+ "generators": {
5
+ "init": {
6
+ "factory": "./src/generators/init/init",
7
+ "schema": "./src/generators/init/schema.json",
8
+ "description": "Initialize the `@nx/vue` plugin.",
9
+ "aliases": ["ng-add"],
10
+ "hidden": true
11
+ },
12
+ "application": {
13
+ "factory": "./src/generators/application/application#applicationGeneratorInternal",
14
+ "schema": "./src/generators/application/schema.json",
15
+ "aliases": ["app"],
16
+ "description": "Create a Vue application."
17
+ },
18
+ "library": {
19
+ "factory": "./src/generators/library/library#libraryGeneratorInternal",
20
+ "schema": "./src/generators/library/schema.json",
21
+ "aliases": ["lib"],
22
+ "x-type": "library",
23
+ "description": "Create a Vue library."
24
+ },
25
+ "component": {
26
+ "factory": "./src/generators/component/component#componentGeneratorInternal",
27
+ "schema": "./src/generators/component/schema.json",
28
+ "aliases": ["c"],
29
+ "x-type": "component",
30
+ "description": "Create a Vue component."
31
+ },
32
+ "setup-tailwind": {
33
+ "factory": "./src/generators/setup-tailwind/setup-tailwind",
34
+ "schema": "./src/generators/setup-tailwind/schema.json",
35
+ "description": "Set up Tailwind configuration for a project."
36
+ },
37
+ "storybook-configuration": {
38
+ "factory": "./src/generators/storybook-configuration/configuration#storybookConfigurationGeneratorInternal",
39
+ "schema": "./src/generators/storybook-configuration/schema.json",
40
+ "description": "Set up storybook for a Vue app or library.",
41
+ "hidden": false
42
+ },
43
+ "stories": {
44
+ "factory": "./src/generators/stories/stories",
45
+ "schema": "./src/generators/stories/schema.json",
46
+ "description": "Create stories for all components declared in an app or library.",
47
+ "hidden": false
48
+ }
49
+ }
50
+ }
package/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export * from './src/utils/versions';
2
+ export { applicationGenerator } from './src/generators/application/application';
3
+ export { libraryGenerator } from './src/generators/library/library';
4
+ export { componentGenerator } from './src/generators/component/component';
5
+ export { ComponentGeneratorSchema } from './src/generators/component/schema';
6
+ export { storybookConfigurationGenerator } from './src/generators/storybook-configuration/configuration';
7
+ export { storiesGenerator, StorybookStoriesSchema, } from './src/generators/stories/stories';
8
+ export { setupTailwindGenerator } from './src/generators/setup-tailwind/setup-tailwind';
9
+ export { SetupTailwindOptions } from './src/generators/setup-tailwind/schema';
10
+ export { type InitSchema } from './src/generators/init/schema';
11
+ export { vueInitGenerator } from './src/generators/init/init';
12
+ export * from './src/utils/versions';
13
+ export * from './src/utils/add-linting';
package/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vueInitGenerator = exports.setupTailwindGenerator = exports.storiesGenerator = exports.storybookConfigurationGenerator = exports.componentGenerator = exports.libraryGenerator = exports.applicationGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("./src/utils/versions"), exports);
6
+ var application_1 = require("./src/generators/application/application");
7
+ Object.defineProperty(exports, "applicationGenerator", { enumerable: true, get: function () { return application_1.applicationGenerator; } });
8
+ var library_1 = require("./src/generators/library/library");
9
+ Object.defineProperty(exports, "libraryGenerator", { enumerable: true, get: function () { return library_1.libraryGenerator; } });
10
+ var component_1 = require("./src/generators/component/component");
11
+ Object.defineProperty(exports, "componentGenerator", { enumerable: true, get: function () { return component_1.componentGenerator; } });
12
+ var configuration_1 = require("./src/generators/storybook-configuration/configuration");
13
+ Object.defineProperty(exports, "storybookConfigurationGenerator", { enumerable: true, get: function () { return configuration_1.storybookConfigurationGenerator; } });
14
+ var stories_1 = require("./src/generators/stories/stories");
15
+ Object.defineProperty(exports, "storiesGenerator", { enumerable: true, get: function () { return stories_1.storiesGenerator; } });
16
+ var setup_tailwind_1 = require("./src/generators/setup-tailwind/setup-tailwind");
17
+ Object.defineProperty(exports, "setupTailwindGenerator", { enumerable: true, get: function () { return setup_tailwind_1.setupTailwindGenerator; } });
18
+ var init_1 = require("./src/generators/init/init");
19
+ Object.defineProperty(exports, "vueInitGenerator", { enumerable: true, get: function () { return init_1.vueInitGenerator; } });
20
+ tslib_1.__exportStar(require("./src/utils/versions"), exports);
21
+ tslib_1.__exportStar(require("./src/utils/add-linting"), exports);
@@ -0,0 +1,14 @@
1
+ {
2
+ "generators": {},
3
+ "packageJsonUpdates": {
4
+ "17.2.0": {
5
+ "version": "17.2.0-beta.2",
6
+ "packages": {
7
+ "@vitejs/plugin-vue": {
8
+ "version": "^4.5.0",
9
+ "alwaysAddToPackageJson": false
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@nx/vue",
3
+ "version": "0.0.0-pr-22179-271588f",
4
+ "private": false,
5
+ "description": "The Vue plugin for Nx contains executors and generators for managing Vue applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/nrwl/nx.git",
9
+ "directory": "packages/vue"
10
+ },
11
+ "keywords": [
12
+ "Monorepo",
13
+ "Vue",
14
+ "Web",
15
+ "CLI"
16
+ ],
17
+ "main": "./index.js",
18
+ "typings": "./index.d.ts",
19
+ "author": "Victor Savkin",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/nrwl/nx/issues"
23
+ },
24
+ "homepage": "https://nx.dev",
25
+ "generators": "./generators.json",
26
+ "executors": "./executors.json",
27
+ "nx-migrations": {
28
+ "migrations": "./migrations.json"
29
+ },
30
+ "dependencies": {
31
+ "minimatch": "9.0.3",
32
+ "tslib": "^2.3.0",
33
+ "@nx/devkit": "0.0.0-pr-22179-271588f",
34
+ "@nx/js": "0.0.0-pr-22179-271588f",
35
+ "@nx/eslint": "0.0.0-pr-22179-271588f",
36
+ "@nx/vite": "0.0.0-pr-22179-271588f",
37
+ "@nx/web": "0.0.0-pr-22179-271588f"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "peerDependencies": {},
43
+ "exports": {
44
+ "./package.json": "./package.json",
45
+ ".": "./index.js",
46
+ "./executors.json": "./executors.json",
47
+ "./generators.json": "./generators.json",
48
+ "./migrations.json": "./migrations.json",
49
+ "./tailwind": "./src/tailwind.js"
50
+ },
51
+ "type": "commonjs"
52
+ }
@@ -0,0 +1,5 @@
1
+ import { GeneratorCallback, Tree } from '@nx/devkit';
2
+ import { Schema } from './schema';
3
+ export declare function applicationGenerator(tree: Tree, options: Schema): Promise<GeneratorCallback>;
4
+ export declare function applicationGeneratorInternal(tree: Tree, _options: Schema): Promise<GeneratorCallback>;
5
+ export default applicationGenerator;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applicationGeneratorInternal = exports.applicationGenerator = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const eslint_1 = require("@nx/eslint");
6
+ const js_1 = require("@nx/js");
7
+ const normalize_options_1 = require("./lib/normalize-options");
8
+ const init_1 = require("../init/init");
9
+ const add_linting_1 = require("../../utils/add-linting");
10
+ const add_e2e_1 = require("./lib/add-e2e");
11
+ const create_application_files_1 = require("./lib/create-application-files");
12
+ const add_vite_1 = require("./lib/add-vite");
13
+ const create_ts_config_1 = require("../../utils/create-ts-config");
14
+ const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
15
+ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
16
+ function applicationGenerator(tree, options) {
17
+ return applicationGeneratorInternal(tree, { addPlugin: false, ...options });
18
+ }
19
+ exports.applicationGenerator = applicationGenerator;
20
+ async function applicationGeneratorInternal(tree, _options) {
21
+ const options = await (0, normalize_options_1.normalizeOptions)(tree, _options);
22
+ options.addPlugin ??= process.env.NX_ADD_PLUGINS !== 'false';
23
+ const tasks = [];
24
+ (0, devkit_1.addProjectConfiguration)(tree, options.name, {
25
+ root: options.appProjectRoot,
26
+ projectType: 'application',
27
+ sourceRoot: `${options.appProjectRoot}/src`,
28
+ targets: {},
29
+ });
30
+ tasks.push(await (0, js_1.initGenerator)(tree, {
31
+ ...options,
32
+ tsConfigName: options.rootProject
33
+ ? 'tsconfig.json'
34
+ : 'tsconfig.base.json',
35
+ skipFormat: true,
36
+ }));
37
+ tasks.push(await (0, init_1.vueInitGenerator)(tree, {
38
+ ...options,
39
+ skipFormat: true,
40
+ }));
41
+ if (!options.skipPackageJson) {
42
+ tasks.push((0, ensure_dependencies_1.ensureDependencies)(tree, options));
43
+ }
44
+ if (!options.rootProject) {
45
+ (0, create_ts_config_1.extractTsConfigBase)(tree);
46
+ }
47
+ (0, create_application_files_1.createApplicationFiles)(tree, options);
48
+ tasks.push(await (0, add_linting_1.addLinting)(tree, {
49
+ name: options.projectName,
50
+ projectRoot: options.appProjectRoot,
51
+ linter: options.linter ?? eslint_1.Linter.EsLint,
52
+ unitTestRunner: options.unitTestRunner,
53
+ skipPackageJson: options.skipPackageJson,
54
+ setParserOptionsProject: options.setParserOptionsProject,
55
+ rootProject: options.rootProject,
56
+ addPlugin: options.addPlugin,
57
+ }, 'app'));
58
+ tasks.push(await (0, add_vite_1.addVite)(tree, options));
59
+ tasks.push(await (0, add_e2e_1.addE2e)(tree, options));
60
+ if (options.js)
61
+ (0, devkit_1.toJS)(tree);
62
+ if (!options.skipFormat)
63
+ await (0, devkit_1.formatFiles)(tree);
64
+ tasks.push(() => {
65
+ (0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
66
+ });
67
+ return (0, devkit_1.runTasksInSerial)(...tasks);
68
+ }
69
+ exports.applicationGeneratorInternal = applicationGeneratorInternal;
70
+ exports.default = applicationGenerator;
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="icon" href="/favicon.ico">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title><%= title %></title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,12 @@
1
+ <% if ( unitTestRunner === 'vitest' ) { %>
2
+ import { describe, it, expect } from 'vitest'
3
+ <% } %>
4
+ import { mount } from '@vue/test-utils'
5
+ import App from './App.vue';
6
+
7
+ describe('App', () => {
8
+ it('renders properly', () => {
9
+ const wrapper = mount(App, {})
10
+ expect(wrapper.text()).toContain('Welcome <%= title %> 👋')
11
+ })
12
+ });
@@ -0,0 +1,54 @@
1
+ <script setup lang="ts">
2
+ <% if (routing) { %>
3
+ import { RouterLink, RouterView } from 'vue-router';
4
+ <% } else { %>
5
+ import NxWelcome from './NxWelcome.vue';
6
+ <% } %>
7
+ </script>
8
+
9
+ <template>
10
+ <% if (routing) { %>
11
+ <header>
12
+ <nav>
13
+ <RouterLink to="/">Home</RouterLink>
14
+ <RouterLink to="/about">About</RouterLink>
15
+ </nav>
16
+ </header>
17
+ <RouterView />
18
+ <% } else { %>
19
+ <NxWelcome title="<%= title %>" />
20
+ <% } %>
21
+ </template>
22
+
23
+ <% if (routing && style !== 'none') { %>
24
+ <style scoped lang="<%= style %>">
25
+ header {
26
+ line-height: 1.5;
27
+ max-width: 100vw;
28
+ }
29
+
30
+ nav > a {
31
+ padding-left: 1rem;
32
+ padding-right: 1rem;
33
+ }
34
+
35
+ @media (min-width: 768px) {
36
+ header {
37
+ display: flex;
38
+ place-items: center;
39
+ padding-right: calc(var(--section-gap) / 2);
40
+ margin-left: auto;
41
+ margin-right: auto;
42
+ max-width: 768px;
43
+ }
44
+
45
+ nav {
46
+ text-align: left;
47
+ font-size: 1rem;
48
+
49
+ padding: 1rem 0;
50
+ margin-top: 1rem;
51
+ }
52
+ }
53
+ </style>
54
+ <% } %>