@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
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.storybookConfigurationGeneratorInternal = exports.storybookConfigurationGenerator = void 0;
4
+ const stories_1 = require("../stories/stories");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const versions_1 = require("../../utils/versions");
7
+ async function generateStories(host, schema) {
8
+ await (0, stories_1.default)(host, {
9
+ project: schema.project,
10
+ js: schema.js,
11
+ ignorePaths: schema.ignorePaths,
12
+ skipFormat: true,
13
+ interactionTests: schema.interactionTests ?? true,
14
+ });
15
+ }
16
+ function storybookConfigurationGenerator(host, schema) {
17
+ return storybookConfigurationGeneratorInternal(host, {
18
+ addPlugin: false,
19
+ ...schema,
20
+ });
21
+ }
22
+ exports.storybookConfigurationGenerator = storybookConfigurationGenerator;
23
+ async function storybookConfigurationGeneratorInternal(host, schema) {
24
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
25
+ const installTask = await configurationGenerator(host, {
26
+ project: schema.project,
27
+ js: schema.js,
28
+ linter: schema.linter,
29
+ tsConfiguration: schema.tsConfiguration ?? true, // default is true
30
+ interactionTests: schema.interactionTests ?? true, // default is true
31
+ configureStaticServe: schema.configureStaticServe,
32
+ uiFramework: '@storybook/vue3-vite',
33
+ skipFormat: true,
34
+ addPlugin: schema.addPlugin,
35
+ });
36
+ if (schema.generateStories) {
37
+ await generateStories(host, schema);
38
+ }
39
+ await (0, devkit_1.formatFiles)(host);
40
+ return installTask;
41
+ }
42
+ exports.storybookConfigurationGeneratorInternal = storybookConfigurationGeneratorInternal;
43
+ exports.default = storybookConfigurationGenerator;
@@ -0,0 +1,13 @@
1
+ import { Linter } from '@nx/eslint';
2
+
3
+ export interface StorybookConfigureSchema {
4
+ project: string;
5
+ interactionTests?: boolean;
6
+ generateStories?: boolean;
7
+ js?: boolean;
8
+ tsConfiguration?: boolean;
9
+ linter?: Linter;
10
+ ignorePaths?: string[];
11
+ configureStaticServe?: boolean;
12
+ addPlugin?: boolean;
13
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxVueStorybookConfigure",
5
+ "title": "Vue Storybook Configure",
6
+ "description": "Set up Storybook for a Vue project.",
7
+ "type": "object",
8
+ "properties": {
9
+ "project": {
10
+ "type": "string",
11
+ "aliases": ["name", "projectName"],
12
+ "description": "Project for which to generate Storybook configuration.",
13
+ "$default": {
14
+ "$source": "argv",
15
+ "index": 0
16
+ },
17
+ "x-prompt": "For which project do you want to generate Storybook configuration?",
18
+ "x-dropdown": "projects",
19
+ "x-priority": "important"
20
+ },
21
+ "interactionTests": {
22
+ "type": "boolean",
23
+ "description": "Set up Storybook interaction tests.",
24
+ "x-prompt": "Do you want to set up Storybook interaction tests?",
25
+ "x-priority": "important",
26
+ "alias": ["configureTestRunner"],
27
+ "default": true
28
+ },
29
+ "generateStories": {
30
+ "type": "boolean",
31
+ "description": "Automatically generate `*.stories.ts` files for components declared in this project?",
32
+ "x-prompt": "Automatically generate *.stories.ts files for components declared in this project?",
33
+ "default": true,
34
+ "x-priority": "important"
35
+ },
36
+ "configureStaticServe": {
37
+ "type": "boolean",
38
+ "description": "Specifies whether to configure a static file server target for serving storybook. Helpful for speeding up CI build/test times.",
39
+ "x-prompt": "Configure a static file server for the storybook instance?",
40
+ "default": true,
41
+ "x-priority": "important"
42
+ },
43
+ "js": {
44
+ "type": "boolean",
45
+ "description": "Generate JavaScript story files rather than TypeScript story files.",
46
+ "default": false
47
+ },
48
+ "tsConfiguration": {
49
+ "type": "boolean",
50
+ "description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
51
+ "default": true
52
+ },
53
+ "linter": {
54
+ "description": "The tool to use for running lint checks.",
55
+ "type": "string",
56
+ "enum": ["eslint"],
57
+ "default": "eslint"
58
+ },
59
+ "ignorePaths": {
60
+ "type": "array",
61
+ "description": "Paths to ignore when looking for components.",
62
+ "items": {
63
+ "type": "string",
64
+ "description": "Path to ignore."
65
+ },
66
+ "default": [
67
+ "*.stories.ts,*.stories.tsx,*.stories.js,*.stories.jsx,*.stories.mdx"
68
+ ],
69
+ "examples": [
70
+ "apps/my-app/src/not-stories/**",
71
+ "**/**/src/**/not-stories/**",
72
+ "libs/my-lib/**/*.something.ts",
73
+ "**/**/src/**/*.other.*",
74
+ "libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
75
+ ]
76
+ }
77
+ },
78
+ "required": ["project"],
79
+ "examplesFile": "../../../docs/storybook-configuration-examples.md"
80
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Generates a set of glob patterns based off the source root of the app and its dependencies
3
+ * @param dirPath workspace relative directory path that will be used to infer the parent project and dependencies
4
+ * @param fileGlobPattern pass a custom glob pattern to be used
5
+ */
6
+ export declare function createGlobPatternsForDependencies(dirPath: string, fileGlobPattern?: string): string[];
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createGlobPatternsForDependencies = void 0;
4
+ const generate_globs_1 = require("@nx/js/src/utils/generate-globs");
5
+ /**
6
+ * Generates a set of glob patterns based off the source root of the app and its dependencies
7
+ * @param dirPath workspace relative directory path that will be used to infer the parent project and dependencies
8
+ * @param fileGlobPattern pass a custom glob pattern to be used
9
+ */
10
+ function createGlobPatternsForDependencies(dirPath, fileGlobPattern = '/**/*!(*.stories|*.spec).{vue,tsx,ts,jsx,js}') {
11
+ try {
12
+ return (0, generate_globs_1.createGlobPatternsForDependencies)(dirPath, fileGlobPattern);
13
+ }
14
+ catch (e) {
15
+ /**
16
+ * It should not be possible to reach this point when the utility is invoked as part of the normal
17
+ * lifecycle of Nx executors. However, other tooling, such as the VSCode Tailwind IntelliSense plugin
18
+ * or JetBrains editors such as WebStorm, may execute the tailwind.config.js file in order to provide
19
+ * autocomplete features, for example.
20
+ *
21
+ * In order to best support that use-case, we therefore do not hard error when the ProjectGraph is
22
+ * fundamentally unavailable in this tailwind-specific context.
23
+ */
24
+ console.warn('\nWARNING: There was an error creating glob patterns, returning an empty array\n' +
25
+ `${e.message}\n`);
26
+ return [];
27
+ }
28
+ }
29
+ exports.createGlobPatternsForDependencies = createGlobPatternsForDependencies;
@@ -0,0 +1,13 @@
1
+ import { Tree } from 'nx/src/generators/tree';
2
+ import { Linter } from '@nx/eslint';
3
+ export declare function addLinting(host: Tree, options: {
4
+ linter: Linter;
5
+ name: string;
6
+ projectRoot: string;
7
+ unitTestRunner?: 'vitest' | 'none';
8
+ setParserOptionsProject?: boolean;
9
+ skipPackageJson?: boolean;
10
+ rootProject?: boolean;
11
+ addPlugin?: boolean;
12
+ }, projectType: 'lib' | 'app'): Promise<import("@nx/devkit").GeneratorCallback>;
13
+ export declare function editEslintConfigFiles(tree: Tree, projectRoot: string, rootProject?: boolean): void;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.editEslintConfigFiles = exports.addLinting = void 0;
4
+ const eslint_1 = require("@nx/eslint");
5
+ const path_1 = require("nx/src/utils/path");
6
+ const devkit_1 = require("@nx/devkit");
7
+ const lint_1 = require("./lint");
8
+ const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
9
+ async function addLinting(host, options, projectType) {
10
+ if (options.linter === eslint_1.Linter.EsLint) {
11
+ const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
12
+ linter: options.linter,
13
+ project: options.name,
14
+ tsConfigPaths: [
15
+ (0, path_1.joinPathFragments)(options.projectRoot, `tsconfig.${projectType}.json`),
16
+ ],
17
+ unitTestRunner: options.unitTestRunner,
18
+ skipFormat: true,
19
+ setParserOptionsProject: options.setParserOptionsProject,
20
+ rootProject: options.rootProject,
21
+ addPlugin: options.addPlugin,
22
+ });
23
+ if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
24
+ (0, eslint_file_1.addExtendsToLintConfig)(host, options.projectRoot, [
25
+ 'plugin:vue/vue3-essential',
26
+ 'eslint:recommended',
27
+ '@vue/eslint-config-typescript',
28
+ '@vue/eslint-config-prettier/skip-formatting',
29
+ ]);
30
+ }
31
+ editEslintConfigFiles(host, options.projectRoot, options.rootProject);
32
+ let installTask = () => { };
33
+ if (!options.skipPackageJson) {
34
+ installTask = (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
35
+ }
36
+ return (0, devkit_1.runTasksInSerial)(lintTask, installTask);
37
+ }
38
+ else {
39
+ return () => { };
40
+ }
41
+ }
42
+ exports.addLinting = addLinting;
43
+ function editEslintConfigFiles(tree, projectRoot, rootProject) {
44
+ if (tree.exists((0, path_1.joinPathFragments)(projectRoot, 'eslint.config.js'))) {
45
+ const fileName = (0, path_1.joinPathFragments)(projectRoot, 'eslint.config.js');
46
+ (0, devkit_1.updateJson)(tree, fileName, (json) => {
47
+ let updated = false;
48
+ for (let override of json.overrides) {
49
+ if (override.parserOptions) {
50
+ if (!override.files.includes('*.vue')) {
51
+ override.files.push('*.vue');
52
+ }
53
+ updated = true;
54
+ }
55
+ }
56
+ if (!updated) {
57
+ json.overrides = [
58
+ {
59
+ files: ['*.ts', '*.tsx', '*.js', '*.jsx', '*.vue'],
60
+ rules: { 'vue/multi-word-component-names': 'off' },
61
+ },
62
+ ];
63
+ }
64
+ return json;
65
+ });
66
+ }
67
+ else {
68
+ const fileName = (0, path_1.joinPathFragments)(projectRoot, '.eslintrc.json');
69
+ (0, devkit_1.updateJson)(tree, fileName, (json) => {
70
+ let updated = false;
71
+ for (let override of json.overrides) {
72
+ if (override.parserOptions) {
73
+ if (!override.files.includes('*.vue')) {
74
+ override.files.push('*.vue');
75
+ }
76
+ updated = true;
77
+ }
78
+ }
79
+ if (!updated) {
80
+ json.overrides = [
81
+ {
82
+ files: ['*.ts', '*.tsx', '*.js', '*.jsx', '*.vue'],
83
+ rules: { 'vue/multi-word-component-names': 'off' },
84
+ },
85
+ ];
86
+ }
87
+ return json;
88
+ });
89
+ }
90
+ // Edit root config too
91
+ if (tree.exists('.eslintrc.base.json')) {
92
+ (0, devkit_1.updateJson)(tree, '.eslintrc.base.json', (json) => {
93
+ for (let override of json.overrides) {
94
+ if (override.rules &&
95
+ '@nx/enforce-module-boundaries' in override.rules) {
96
+ if (!override.files.includes('*.vue')) {
97
+ override.files.push('*.vue');
98
+ }
99
+ }
100
+ }
101
+ return json;
102
+ });
103
+ }
104
+ else if (tree.exists('.eslintrc.json') && !rootProject) {
105
+ (0, devkit_1.updateJson)(tree, '.eslintrc.json', (json) => {
106
+ for (let override of json.overrides) {
107
+ if (override.rules &&
108
+ '@nx/enforce-module-boundaries' in override.rules) {
109
+ if (!override.files.includes('*.vue')) {
110
+ override.files.push('*.vue');
111
+ }
112
+ }
113
+ }
114
+ return json;
115
+ });
116
+ }
117
+ }
118
+ exports.editEslintConfigFiles = editEslintConfigFiles;
@@ -0,0 +1,3 @@
1
+ import type * as ts from 'typescript';
2
+ import { StringChange } from '@nx/devkit';
3
+ export declare function addImport(source: ts.SourceFile, statement: string): StringChange[];
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addImport = void 0;
4
+ const js_1 = require("@nx/js");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
7
+ let tsModule;
8
+ function addImport(source, statement) {
9
+ if (!tsModule) {
10
+ tsModule = (0, ensure_typescript_1.ensureTypescript)();
11
+ }
12
+ const allImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration);
13
+ if (allImports.length > 0) {
14
+ const lastImport = allImports[allImports.length - 1];
15
+ return [
16
+ {
17
+ type: devkit_1.ChangeType.Insert,
18
+ index: lastImport.end + 1,
19
+ text: `\n${statement}\n`,
20
+ },
21
+ ];
22
+ }
23
+ else {
24
+ return [
25
+ {
26
+ type: devkit_1.ChangeType.Insert,
27
+ index: 0,
28
+ text: `\n${statement}\n`,
29
+ },
30
+ ];
31
+ }
32
+ }
33
+ exports.addImport = addImport;
@@ -0,0 +1,8 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function createTsConfig(host: Tree, projectRoot: string, type: 'app' | 'lib', options: {
3
+ strict?: boolean;
4
+ style?: string;
5
+ rootProject?: boolean;
6
+ unitTestRunner?: string;
7
+ }, relativePathToRootTsConfig: string): void;
8
+ export declare function extractTsConfigBase(host: Tree): void;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractTsConfigBase = exports.createTsConfig = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const shared = require("@nx/js/src/utils/typescript/create-ts-config");
6
+ function createTsConfig(host, projectRoot, type, options, relativePathToRootTsConfig) {
7
+ const json = {
8
+ compilerOptions: {
9
+ allowJs: true,
10
+ esModuleInterop: false,
11
+ allowSyntheticDefaultImports: true,
12
+ strict: options.strict,
13
+ jsx: 'preserve',
14
+ jsxImportSource: 'vue',
15
+ moduleResolution: 'node',
16
+ resolveJsonModule: true,
17
+ verbatimModuleSyntax: true,
18
+ },
19
+ files: [],
20
+ include: [],
21
+ references: [
22
+ {
23
+ path: type === 'app' ? './tsconfig.app.json' : './tsconfig.lib.json',
24
+ },
25
+ ],
26
+ };
27
+ if (options.unitTestRunner === 'vitest') {
28
+ json.references.push({
29
+ path: './tsconfig.spec.json',
30
+ });
31
+ }
32
+ // inline tsconfig.base.json into the project
33
+ if (options.rootProject) {
34
+ json.compileOnSave = false;
35
+ json.compilerOptions = {
36
+ ...shared.tsConfigBaseOptions,
37
+ ...json.compilerOptions,
38
+ };
39
+ json.exclude = ['node_modules', 'tmp'];
40
+ }
41
+ else {
42
+ json.extends = relativePathToRootTsConfig;
43
+ }
44
+ (0, devkit_1.writeJson)(host, `${projectRoot}/tsconfig.json`, json);
45
+ const tsconfigProjectPath = `${projectRoot}/tsconfig.${type}.json`;
46
+ if (host.exists(tsconfigProjectPath)) {
47
+ (0, devkit_1.updateJson)(host, tsconfigProjectPath, (json) => {
48
+ json.compilerOptions ??= {};
49
+ const types = new Set(json.compilerOptions.types ?? []);
50
+ types.add('vite/client');
51
+ json.compilerOptions.types = Array.from(types);
52
+ return json;
53
+ });
54
+ }
55
+ else {
56
+ }
57
+ }
58
+ exports.createTsConfig = createTsConfig;
59
+ function extractTsConfigBase(host) {
60
+ shared.extractTsConfigBase(host);
61
+ if (host.exists('vite.config.ts')) {
62
+ const vite = host.read('vite.config.ts').toString();
63
+ host.write('vite.config.ts', vite.replace(`projects: []`, `projects: ['tsconfig.base.json']`));
64
+ }
65
+ }
66
+ exports.extractTsConfigBase = extractTsConfigBase;
@@ -0,0 +1,6 @@
1
+ import { type GeneratorCallback, type Tree } from '@nx/devkit';
2
+ export type EnsureDependenciesOptions = {
3
+ routing?: boolean;
4
+ style?: 'scss' | 'less' | 'none' | 'css';
5
+ };
6
+ export declare function ensureDependencies(tree: Tree, options: EnsureDependenciesOptions): GeneratorCallback;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ensureDependencies = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const versions_1 = require("./versions");
6
+ function ensureDependencies(tree, options) {
7
+ const dependencies = {};
8
+ const devDependencies = {
9
+ '@vue/test-utils': versions_1.vueTestUtilsVersion,
10
+ '@vitejs/plugin-vue': versions_1.vitePluginVueVersion,
11
+ 'vue-tsc': versions_1.vueTscVersion,
12
+ };
13
+ if (options.routing) {
14
+ dependencies['vue-router'] = versions_1.vueRouterVersion;
15
+ }
16
+ if (options.style === 'scss') {
17
+ devDependencies['sass'] = versions_1.sassVersion;
18
+ }
19
+ else if (options.style === 'less') {
20
+ devDependencies['less'] = versions_1.lessVersion;
21
+ }
22
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, dependencies, devDependencies);
23
+ }
24
+ exports.ensureDependencies = ensureDependencies;
@@ -0,0 +1,8 @@
1
+ export declare const extraEslintDependencies: {
2
+ dependencies: {};
3
+ devDependencies: {
4
+ '@vue/eslint-config-prettier': string;
5
+ '@vue/eslint-config-typescript': string;
6
+ 'eslint-plugin-vue': string;
7
+ };
8
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extraEslintDependencies = void 0;
4
+ const versions_1 = require("./versions");
5
+ exports.extraEslintDependencies = {
6
+ dependencies: {},
7
+ devDependencies: {
8
+ '@vue/eslint-config-prettier': versions_1.vueEslintConfigPrettierVersion,
9
+ '@vue/eslint-config-typescript': versions_1.vueEslintConfigTypescriptVersion,
10
+ 'eslint-plugin-vue': versions_1.eslintPluginVueVersion,
11
+ },
12
+ };
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function createApp(tree: Tree, appName: string): Promise<any>;
3
+ export declare function createLib(tree: Tree, libName: string): Promise<any>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLib = exports.createApp = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const eslint_1 = require("@nx/eslint");
6
+ const application_1 = require("../generators/application/application");
7
+ async function createApp(tree, appName) {
8
+ await (0, application_1.default)(tree, {
9
+ e2eTestRunner: 'none',
10
+ linter: eslint_1.Linter.EsLint,
11
+ skipFormat: true,
12
+ style: 'css',
13
+ unitTestRunner: 'none',
14
+ name: appName,
15
+ projectNameAndRootFormat: 'as-provided',
16
+ });
17
+ }
18
+ exports.createApp = createApp;
19
+ async function createLib(tree, libName) {
20
+ const { fileName } = (0, devkit_1.names)(libName);
21
+ tree.write(`/${fileName}/src/index.ts`, ``);
22
+ (0, devkit_1.addProjectConfiguration)(tree, fileName, {
23
+ tags: [],
24
+ root: `${fileName}`,
25
+ projectType: 'library',
26
+ sourceRoot: `${fileName}/src`,
27
+ targets: {},
28
+ });
29
+ }
30
+ exports.createLib = createLib;
@@ -0,0 +1,14 @@
1
+ export declare const nxVersion: any;
2
+ export declare const vueVersion = "^3.3.4";
3
+ export declare const vueTscVersion = "^1.8.8";
4
+ export declare const vueRouterVersion = "^4.2.4";
5
+ export declare const vueTestUtilsVersion = "^2.4.1";
6
+ export declare const vitePluginVueVersion = "^4.5.0";
7
+ export declare const vueEslintConfigPrettierVersion = "7.1.0";
8
+ export declare const vueEslintConfigTypescriptVersion = "^11.0.3";
9
+ export declare const eslintPluginVueVersion = "^9.16.1";
10
+ export declare const postcssVersion = "8.4.21";
11
+ export declare const tailwindcssVersion = "3.2.7";
12
+ export declare const autoprefixerVersion = "10.4.13";
13
+ export declare const sassVersion = "1.62.1";
14
+ export declare const lessVersion = "3.12.2";
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lessVersion = exports.sassVersion = exports.autoprefixerVersion = exports.tailwindcssVersion = exports.postcssVersion = exports.eslintPluginVueVersion = exports.vueEslintConfigTypescriptVersion = exports.vueEslintConfigPrettierVersion = exports.vitePluginVueVersion = exports.vueTestUtilsVersion = exports.vueRouterVersion = exports.vueTscVersion = exports.vueVersion = exports.nxVersion = void 0;
4
+ exports.nxVersion = require('../../package.json').version;
5
+ // vue core
6
+ exports.vueVersion = '^3.3.4';
7
+ exports.vueTscVersion = '^1.8.8';
8
+ exports.vueRouterVersion = '^4.2.4';
9
+ // test deps
10
+ exports.vueTestUtilsVersion = '^2.4.1';
11
+ exports.vitePluginVueVersion = '^4.5.0';
12
+ // linting deps
13
+ exports.vueEslintConfigPrettierVersion = '7.1.0';
14
+ exports.vueEslintConfigTypescriptVersion = '^11.0.3';
15
+ exports.eslintPluginVueVersion = '^9.16.1';
16
+ // tailwindcss
17
+ exports.postcssVersion = '8.4.21';
18
+ exports.tailwindcssVersion = '3.2.7';
19
+ exports.autoprefixerVersion = '10.4.13';
20
+ // other deps
21
+ exports.sassVersion = '1.62.1';
22
+ exports.lessVersion = '3.12.2';