Skip to content

feat(workspace-plugin): various executor fixes and inferred ws plugin configuration capabilities#33098

Merged
Hotell merged 12 commits into
microsoft:masterfrom
Hotell:nx/workspace-plugin/v9-inferred-plugin-v2
Oct 23, 2024
Merged

feat(workspace-plugin): various executor fixes and inferred ws plugin configuration capabilities#33098
Hotell merged 12 commits into
microsoft:masterfrom
Hotell:nx/workspace-plugin/v9-inferred-plugin-v2

Conversation

@Hotell

@Hotell Hotell commented Oct 22, 2024

Copy link
Copy Markdown
Contributor

Previous Behavior

New Behavior

this PR addresses all issues observed while migrating all v9 to inferred plugins #33074

Features

Workspace inferred plugin 🧪

Targets build based on project context

following targets are added to project based on project configuration:

  • storybook (any project)
  • start executing storybook ( v9 project in split mode "library/stories")

Configuration options

becuase testSSR and verifyPackaging tools have no physical configuration that we can infer from, we need to implement include/exclude options on plugin level.

Now both target support:

  • include,
  • exclude,
  • targetName

Example:

// @filename nx.json
{
      "plugin": "./tools/workspace-plugin/src/plugins/workspace-plugin.ts",
      "options": {
        "testSSR": {
          "exclude": ["react-theme-stories", "react-migration-v8-v9-stories", "react-migration-v0-v9-stories"]
        },
        "verifyPackaging": {
          "include": ["react-text", "react-components"]
        }
      },
}

Performance

  • plugin will emit execution time in --verbose mode
State Execution Timings: workspace-plugin
current (no caching) 27.25 s
this PR perf improvement (no caching) 0.09s / 𝚫 99.7% FASTER

Fixes

Build executor

Type-check, Generate-api executor

  • sets baseUrl via absolute path to properly turn off path aliases

Verify-packaging executor

  • resolves issues with cross domain package assertions (v9 and v0 , v9 and v8)

Related Issue(s)

@Hotell Hotell changed the title Nx/workspace plugin/v9 inferred plugin v2 feat(workspace-plugin): various executor fixes and inferred ws plugin configuration capabilities Oct 22, 2024
@fabricteam

fabricteam commented Oct 22, 2024

Copy link
Copy Markdown
Collaborator

📊 Bundle size report

✅ No changes found

Comment thread tools/workspace-plugin/src/executors/build/executor.spec.ts
Comment thread tools/workspace-plugin/src/executors/build/lib/swc.ts
Comment thread tools/workspace-plugin/src/executors/build/schema.json
Comment thread tools/workspace-plugin/src/executors/generate-api/executor.spec.ts
Comment thread tools/workspace-plugin/src/executors/generate-api/executor.ts
Comment thread tools/workspace-plugin/src/executors/type-check/executor.ts
Comment thread tools/workspace-plugin/src/plugins/workspace-plugin.spec.ts
Comment thread tools/workspace-plugin/src/plugins/workspace-plugin.ts
Comment thread tools/workspace-plugin/src/plugins/workspace-plugin.ts
// extend @swc/core types by missing apis
declare module '@swc/core' {
interface BaseModuleConfig {
resolveFully?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create a new issue/PR for @swc/core or @swc/types to fix this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we definitely should , ty

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread tools/workspace-plugin/src/plugins/workspace-plugin.ts Outdated
Comment thread tools/workspace-plugin/src/plugins/workspace-plugin.ts Outdated
@Hotell Hotell enabled auto-merge (squash) October 23, 2024 13:21
@Hotell Hotell merged commit 02d0cc1 into microsoft:master Oct 23, 2024
@Hotell Hotell deleted the nx/workspace-plugin/v9-inferred-plugin-v2 branch October 23, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants