@rsbuild/plugin-source-build 1.0.1-beta.9 → 1.0.1

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 CHANGED
@@ -1,49 +1,69 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-source-build",
3
- "version": "1.0.1-beta.9",
4
- "description": "Source build plugin of Rsbuild",
5
- "homepage": "https://rsbuild.dev",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/web-infra-dev/rsbuild",
9
- "directory": "packages/plugin-source-build"
10
- },
3
+ "version": "1.0.1",
4
+ "repository": "https://github.com/rspack-contrib/rsbuild-plugin-source-build",
11
5
  "license": "MIT",
12
6
  "type": "module",
13
7
  "exports": {
14
8
  ".": {
15
- "types": "./dist-types/index.d.ts",
9
+ "types": "./dist/index.d.ts",
16
10
  "import": "./dist/index.js",
17
11
  "require": "./dist/index.cjs"
18
12
  }
19
13
  },
20
- "main": "./dist/index.cjs",
21
- "types": "./dist-types/index.d.ts",
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.mjs",
16
+ "types": "./dist/index.d.ts",
22
17
  "files": [
23
- "dist",
24
- "dist-types"
18
+ "dist"
25
19
  ],
20
+ "simple-git-hooks": {
21
+ "pre-commit": "npx nano-staged"
22
+ },
23
+ "nano-staged": {
24
+ "*.{js,jsx,ts,tsx,mjs,cjs}": [
25
+ "biome check --write --no-errors-on-unmatched"
26
+ ]
27
+ },
26
28
  "dependencies": {
27
29
  "fast-glob": "^3.3.2",
28
- "json5": "^2.2.3"
30
+ "json5": "^2.2.3",
31
+ "yaml": "^2.5.0"
29
32
  },
30
33
  "devDependencies": {
31
- "typescript": "^5.5.2",
32
- "yaml": "^2.5.0",
33
- "@rsbuild/core": "1.0.1-beta.9",
34
- "@rsbuild/plugin-babel": "1.0.1-beta.9",
35
- "@scripts/test-helper": "1.0.1-beta.9"
34
+ "@biomejs/biome": "^1.8.3",
35
+ "@playwright/test": "^1.45.3",
36
+ "@rsbuild/core": "^1.0.1-beta.8",
37
+ "@rsbuild/plugin-react": "1.0.1-beta.10",
38
+ "@rsbuild/plugin-type-check": "1.0.1-beta.10",
39
+ "@types/node": "^20.14.13",
40
+ "@types/react": "^18.3.3",
41
+ "@types/react-dom": "^18.3.0",
42
+ "nano-staged": "^0.8.0",
43
+ "playwright": "^1.45.3",
44
+ "react": "^18.3.1",
45
+ "react-dom": "^18.3.1",
46
+ "simple-git-hooks": "^2.11.1",
47
+ "tsup": "^8.2.3",
48
+ "typescript": "^5.5.4"
36
49
  },
37
50
  "peerDependencies": {
38
- "@rsbuild/core": "^1.0.1-beta.9"
51
+ "@rsbuild/core": "0.x || 1.x || ^1.0.1-beta.0"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "@rsbuild/core": {
55
+ "optional": true
56
+ }
39
57
  },
40
58
  "publishConfig": {
41
59
  "access": "public",
42
- "provenance": true,
43
60
  "registry": "https://registry.npmjs.org/"
44
61
  },
45
62
  "scripts": {
46
- "build": "modern build",
47
- "dev": "modern build --watch"
63
+ "build": "tsup",
64
+ "dev": "tsup --watch",
65
+ "lint": "biome check .",
66
+ "lint:write": "biome check . --write",
67
+ "test": "playwright test"
48
68
  }
49
69
  }
@@ -1,9 +0,0 @@
1
- import type { MonorepoAnalyzer } from '../types';
2
- import type { GetProjectsFunc } from './getProjects';
3
- export interface IMonorepoBaseData {
4
- isMonorepo: boolean;
5
- type: string;
6
- rootPath: string;
7
- getProjects?: GetProjectsFunc;
8
- }
9
- export declare const getMonorepoBaseData: (starFindPath: string, otherMonorepoAnalyzer?: Record<string, MonorepoAnalyzer>) => Promise<IMonorepoBaseData>;
@@ -1,4 +0,0 @@
1
- import type { Project } from '../project';
2
- import type { IMonorepoBaseData } from './getBaseData';
3
- export type GetProjectsFunc = (rootPath: string) => Promise<Project[]> | Project[];
4
- export declare const getMonorepoSubProjects: (monorepoBaseData: IMonorepoBaseData) => Promise<Project[]>;
@@ -1,6 +0,0 @@
1
- export * from './getBaseData';
2
- export * from './isMonorepo';
3
- export { getMonorepoSubProjects } from './getProjects';
4
- export { getProjects as getPnpmMonorepoSubProjects } from './pnpm';
5
- export { getProjects as getRushMonorepoSubProjects } from './rush';
6
- export type { GetProjectsFunc } from './getProjects';
@@ -1,8 +0,0 @@
1
- export type IsMonorepoFn = (monorepoRootPath: string) => Promise<boolean> | boolean;
2
- export type IsMonorepoResult = {
3
- isMonorepo: boolean;
4
- type: 'rush' | 'pnpm' | string;
5
- };
6
- export declare const isPnpmMonorepo: IsMonorepoFn;
7
- export declare const isRushMonorepo: IsMonorepoFn;
8
- export declare const isMonorepo: (monorepoRootPath: string, otherMonorepoChecks?: Record<string, IsMonorepoFn>) => Promise<IsMonorepoResult>;
@@ -1,2 +0,0 @@
1
- import { Project } from '../project';
2
- export declare const getProjects: (monorepoRoot: string) => Promise<Project[]>;
@@ -1,2 +0,0 @@
1
- import { Project } from '../project';
2
- export declare const getProjects: (monorepoRoot: string) => Promise<Project[]>;
@@ -1,3 +0,0 @@
1
- export declare const PNPM_WORKSPACE_FILE = "pnpm-workspace.yaml";
2
- export declare const RUSH_JSON_FILE = "rush.json";
3
- export declare const PACKAGE_JSON = "package.json";
@@ -1,4 +0,0 @@
1
- export { PLUGIN_SOURCE_BUILD_NAME, pluginSourceBuild, type PluginSourceBuildOptions, } from './plugin';
2
- export { Project } from './project';
3
- export { getMonorepoBaseData, getMonorepoSubProjects } from './common';
4
- export type { MonorepoAnalyzer } from './types';
@@ -1 +0,0 @@
1
- {"//":"This file is for making TypeScript work with moduleResolution node16+.","version":"1.0.0"}
@@ -1,23 +0,0 @@
1
- import type { RsbuildPlugin } from '@rsbuild/core';
2
- import type { Project } from './project';
3
- import { type ExtraMonorepoStrategies } from './project-utils';
4
- export declare const PLUGIN_SOURCE_BUILD_NAME = "rsbuild:source-build";
5
- export declare const getSourceInclude: (options: {
6
- projects: Project[];
7
- sourceField: string;
8
- }) => Promise<string[]>;
9
- export interface PluginSourceBuildOptions {
10
- /**
11
- * Used to configure the resolve field of the source code files.
12
- * @default 'source''
13
- */
14
- sourceField?: string;
15
- /**
16
- * Whether to read source code or output code first.
17
- * @default 'source'
18
- */
19
- resolvePriority?: 'source' | 'output';
20
- projectName?: string;
21
- extraMonorepoStrategies?: ExtraMonorepoStrategies;
22
- }
23
- export declare function pluginSourceBuild(options?: PluginSourceBuildOptions): RsbuildPlugin;
@@ -1,4 +0,0 @@
1
- import type { Project } from '../project';
2
- export type Filter = FilterFunction;
3
- export type FilterFunction = (projects: Project[]) => Project[] | Promise<Project[]>;
4
- export declare const filterByField: (fieldName: string, checkExports?: boolean) => FilterFunction;
@@ -1,12 +0,0 @@
1
- import type { Project } from '../project';
2
- import type { MonorepoAnalyzer } from '../types';
3
- import type { Filter } from './filter';
4
- export type ExtraMonorepoStrategies = Record<string, MonorepoAnalyzer>;
5
- export interface GetDependentProjectsOptions {
6
- cwd?: string;
7
- recursive?: boolean;
8
- filter?: Filter;
9
- extraMonorepoStrategies?: ExtraMonorepoStrategies;
10
- }
11
- declare const getDependentProjects: (projectNameOrRootPath: string, options: GetDependentProjectsOptions) => Promise<Project[]>;
12
- export { getDependentProjects };
@@ -1,2 +0,0 @@
1
- export * from './getDependentProjects';
2
- export * from './filter';
@@ -1,18 +0,0 @@
1
- import type { INodePackageJson } from './types/packageJson';
2
- export declare class Project {
3
- #private;
4
- name: string;
5
- dir: string;
6
- metaData: INodePackageJson;
7
- constructor(name: string, dir: string);
8
- init(): Promise<void>;
9
- getMetaData(): INodePackageJson;
10
- getDependentProjects(monorepoProjects: Project[], options?: {
11
- recursive?: boolean;
12
- }): Project[];
13
- getDirectDependentProjects(allProjectMap: Map<string, Project>): Project[];
14
- getSourceEntryPaths(options?: {
15
- field?: string;
16
- exports?: boolean;
17
- }): string[];
18
- }
@@ -1,16 +0,0 @@
1
- import type { GetProjectsFunc } from '../common/getProjects';
2
- import type { IsMonorepoFn } from '../common/isMonorepo';
3
- export * from './packageJson';
4
- export * from './rushJson';
5
- export interface MonorepoAnalyzer {
6
- check: IsMonorepoFn;
7
- getProjects: GetProjectsFunc;
8
- }
9
- export interface IPnpmWorkSpace {
10
- packages: string[];
11
- }
12
- export type TsConfig = {
13
- references?: Array<{
14
- path?: string;
15
- }>;
16
- };
@@ -1,7 +0,0 @@
1
- export interface RushConfigurationProject {
2
- readonly packageName: string;
3
- readonly projectFolder: string;
4
- }
5
- export interface IRushConfig {
6
- projects?: RushConfigurationProject[];
7
- }
@@ -1,4 +0,0 @@
1
- import type { INodePackageJson, IRushConfig } from './types';
2
- export declare const readPackageJson: (pkgJsonFilePath: string) => Promise<INodePackageJson>;
3
- export declare const readRushJson: (rushJsonFilePath: string) => Promise<IRushConfig>;
4
- export declare const readJson: <T>(jsonFileAbsPath: string) => Promise<T>;