@nx/vue 21.2.0-beta.2 → 21.2.0-beta.3
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.
- package/package.json +6 -6
- package/src/generators/stories/lib/files/js/__componentFileName__.stories.js__tmpl__ +2 -4
- package/src/generators/stories/lib/files/ts/__componentFileName__.stories.ts__tmpl__ +2 -4
- package/src/generators/stories/stories.d.ts +2 -2
- package/src/generators/stories/stories.js +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "21.2.0-beta.
|
|
3
|
+
"version": "21.2.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
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, Playwright, 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
6
|
"repository": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"picomatch": "^4.0.2",
|
|
33
33
|
"tslib": "^2.3.0",
|
|
34
|
-
"@nx/devkit": "21.2.0-beta.
|
|
35
|
-
"@nx/js": "21.2.0-beta.
|
|
36
|
-
"@nx/eslint": "21.2.0-beta.
|
|
37
|
-
"@nx/vite": "21.2.0-beta.
|
|
38
|
-
"@nx/web": "21.2.0-beta.
|
|
34
|
+
"@nx/devkit": "21.2.0-beta.3",
|
|
35
|
+
"@nx/js": "21.2.0-beta.3",
|
|
36
|
+
"@nx/eslint": "21.2.0-beta.3",
|
|
37
|
+
"@nx/vite": "21.2.0-beta.3",
|
|
38
|
+
"@nx/web": "21.2.0-beta.3"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import componentName from './<%= componentImportFileName %>';
|
|
2
2
|
<% if ( interactionTests ) { %>
|
|
3
|
-
import {
|
|
4
|
-
import { expect } from '@storybook/jest';
|
|
3
|
+
import { expect } from 'storybook/test';
|
|
5
4
|
<% } %>
|
|
6
5
|
|
|
7
6
|
export default {
|
|
@@ -17,8 +16,7 @@ export const Primary = {
|
|
|
17
16
|
|
|
18
17
|
<% if ( interactionTests ) { %>
|
|
19
18
|
export const Heading: Story = {
|
|
20
|
-
play: async ({
|
|
21
|
-
const canvas = within(canvasElement);
|
|
19
|
+
play: async ({ canvas }) => {
|
|
22
20
|
await expect(canvas.getByText(/Welcome to <%=componentName%>!/gi)).toBeTruthy();
|
|
23
21
|
},
|
|
24
22
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
2
|
import <%= componentName %> from './<%= componentImportFileName %>';
|
|
3
3
|
<% if ( interactionTests ) { %>
|
|
4
|
-
import {
|
|
5
|
-
import { expect } from '@storybook/jest';
|
|
4
|
+
import { expect } from 'storybook/test';
|
|
6
5
|
<% } %>
|
|
7
6
|
|
|
8
7
|
const meta: Meta<typeof <%= componentName %>> = {
|
|
@@ -24,8 +23,7 @@ export const Heading: Story = {
|
|
|
24
23
|
args: {<% for (let prop of props) { %>
|
|
25
24
|
<%= prop.name %>: <%- prop.defaultValue %>,<% } %>
|
|
26
25
|
},
|
|
27
|
-
play: async ({
|
|
28
|
-
const canvas = within(canvasElement);
|
|
26
|
+
play: async ({ canvas }) => {
|
|
29
27
|
await expect(canvas.getByText(/Welcome to <%=componentName%>!/gi)).toBeTruthy();
|
|
30
28
|
},
|
|
31
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
2
|
export interface StorybookStoriesSchema {
|
|
3
3
|
project: string;
|
|
4
4
|
interactionTests?: boolean;
|
|
@@ -7,5 +7,5 @@ export interface StorybookStoriesSchema {
|
|
|
7
7
|
skipFormat?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare function createAllStories(tree: Tree, projectName: string, interactionTests: boolean, js: boolean, projectConfiguration: ProjectConfiguration, ignorePaths?: string[]): Promise<void>;
|
|
10
|
-
export declare function storiesGenerator(host: Tree, schema: StorybookStoriesSchema): Promise<
|
|
10
|
+
export declare function storiesGenerator(host: Tree, schema: StorybookStoriesSchema): Promise<void>;
|
|
11
11
|
export default storiesGenerator;
|
|
@@ -4,7 +4,6 @@ exports.createAllStories = createAllStories;
|
|
|
4
4
|
exports.storiesGenerator = storiesGenerator;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const path_1 = require("path");
|
|
7
|
-
const versions_1 = require("../../utils/versions");
|
|
8
7
|
const component_story_1 = require("./lib/component-story");
|
|
9
8
|
const picomatch = require("picomatch");
|
|
10
9
|
async function createAllStories(tree, projectName, interactionTests, js, projectConfiguration, ignorePaths) {
|
|
@@ -47,15 +46,8 @@ async function storiesGenerator(host, schema) {
|
|
|
47
46
|
const projectConfiguration = projects.get(schema.project);
|
|
48
47
|
schema.interactionTests = schema.interactionTests ?? true;
|
|
49
48
|
await createAllStories(host, schema.project, schema.interactionTests, schema.js, projectConfiguration, schema.ignorePaths);
|
|
50
|
-
const tasks = [];
|
|
51
|
-
if (schema.interactionTests) {
|
|
52
|
-
const { interactionTestsDependencies, addInteractionsInAddons } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
|
|
53
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, {}, interactionTestsDependencies()));
|
|
54
|
-
addInteractionsInAddons(host, projectConfiguration);
|
|
55
|
-
}
|
|
56
49
|
if (!schema.skipFormat) {
|
|
57
50
|
await (0, devkit_1.formatFiles)(host);
|
|
58
51
|
}
|
|
59
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
60
52
|
}
|
|
61
53
|
exports.default = storiesGenerator;
|