Skip to content

Commit 3909d18

Browse files
authored
Merge branch 'master' into yoann/lighten-readmes
2 parents 517d291 + 0558ca7 commit 3909d18

File tree

17 files changed

+33
-32
lines changed

17 files changed

+33
-32
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ jobs:
88
fail-fast: false
99
matrix:
1010
node:
11-
- 18
12-
- 20
11+
- node-version-file: 'package.json'
12+
- node-version: 20.x
1313

14-
name: Unit tests w/ Node.js ${{matrix.node}}.x
14+
name: Unit tests w/ Node.js ${{matrix.node.node-version || matrix.node.node-version-file}}
1515
runs-on: ubuntu-latest
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Install Node ${{matrix.node}}.x
19+
- name: Install Node ${{matrix.node.node-version || matrix.node.node-version-file}}
2020
uses: actions/setup-node@v4
21-
with:
22-
node-version: ${{matrix.node}}.x
21+
with: ${{matrix.node}}
2322
- run: yarn install
2423
- run: yarn build:all
2524
- run: yarn test
@@ -33,7 +32,7 @@ jobs:
3332
- name: Install node
3433
uses: actions/setup-node@v4
3534
with:
36-
node-version: '18.19.0'
35+
node-version-file: 'package.json'
3736
- run: yarn install
3837
- run: yarn build:all
3938
- run: yarn typecheck:all

.node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/core/src/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ export const INJECTED_FILE = '__datadog-helper-file';
77
export const ALL_BUNDLERS = ['webpack', 'vite', 'esbuild', 'rollup', 'rspack', 'rolldown', 'farm'];
88
export const SUPPORTED_BUNDLERS = ['webpack', 'vite', 'esbuild', 'rollup', 'rspack'] as const;
99
export const FULL_NAME_BUNDLERS = [
10-
'webpack4',
11-
'webpack5',
12-
'vite',
1310
'esbuild',
1411
'rollup',
1512
'rspack',
13+
'vite',
14+
'webpack4',
15+
'webpack5',
1616
] as const;

packages/core/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const getEsbuildEntries = async (
5353
const fullPath = entry && typeof entry === 'object' ? entry.in : entry;
5454
entryPaths.push({ path: fullPath });
5555
}
56-
} else if (typeof entryPoints === 'object') {
56+
} else if (entryPoints && typeof entryPoints === 'object') {
5757
entryPaths.push(
5858
...Object.entries(entryPoints).map(([name, filepath]) => ({ name, path: filepath })),
5959
);

packages/plugins/bundler-report/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ export const getBundlerReportPlugins = (context: GlobalContext): PluginOptions[]
135135
// so we have to compute it based on existing configurations.
136136
// The basic idea is to compare input vs output and keep the common part of the paths.
137137
vite: {
138+
...rollupPlugin(),
138139
config(config) {
139140
if (config.root) {
140141
context.cwd = config.root;
141142
} else {
142143
handleCwd(Array.from(directories), context);
143144
}
144145
},
145-
...rollupPlugin(),
146146
},
147147
rollup: rollupPlugin(),
148148
};

packages/published/esbuild-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@datadog/esbuild-plugin",
33
"packageManager": "[email protected]",
4-
"version": "2.4.0",
4+
"version": "2.4.1",
55
"license": "MIT",
66
"author": "Datadog",
77
"description": "Datadog ESBuild Plugin",

packages/published/esbuild-plugin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Anything between #types-export-injection-marker
77
// will be updated using the 'yarn cli integrity' command.
88

9+
import type { Options } from '@dd/core/types';
910
import * as factory from '@dd/factory';
1011
import esbuild from 'esbuild';
1112

@@ -16,7 +17,7 @@ export const datadogEsbuildPlugin = factory.buildPluginFactory({
1617
version: pkg.version,
1718
}).esbuild;
1819

19-
export type { Options as EsbuildPluginOptions } from '@dd/core/types';
20+
export type EsbuildPluginOptions = Options;
2021

2122
export type {
2223
// #types-export-injection-marker

packages/published/rollup-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@datadog/rollup-plugin",
33
"packageManager": "[email protected]",
4-
"version": "2.4.0",
4+
"version": "2.4.1",
55
"license": "MIT",
66
"author": "Datadog",
77
"description": "Datadog Rollup Plugin",

packages/published/rollup-plugin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Anything between #types-export-injection-marker
77
// will be updated using the 'yarn cli integrity' command.
88

9+
import type { Options } from '@dd/core/types';
910
import * as factory from '@dd/factory';
1011
import rollup from 'rollup';
1112

@@ -16,7 +17,7 @@ export const datadogRollupPlugin = factory.buildPluginFactory({
1617
version: pkg.version,
1718
}).rollup;
1819

19-
export type { Options as RollupPluginOptions } from '@dd/core/types';
20+
export type RollupPluginOptions = Options;
2021

2122
export type {
2223
// #types-export-injection-marker

packages/published/rspack-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@datadog/rspack-plugin",
33
"packageManager": "[email protected]",
4-
"version": "2.4.0",
4+
"version": "2.4.1",
55
"license": "MIT",
66
"author": "Datadog",
77
"description": "Datadog Rspack Plugin",

packages/published/rspack-plugin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Anything between #types-export-injection-marker
77
// will be updated using the 'yarn cli integrity' command.
88

9+
import type { Options } from '@dd/core/types';
910
import * as factory from '@dd/factory';
1011
import rspack from '@rspack/core';
1112

@@ -16,7 +17,7 @@ export const datadogRspackPlugin = factory.buildPluginFactory({
1617
version: pkg.version,
1718
}).rspack;
1819

19-
export type { Options as RspackPluginOptions } from '@dd/core/types';
20+
export type RspackPluginOptions = Options;
2021

2122
export type {
2223
// #types-export-injection-marker

packages/published/vite-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@datadog/vite-plugin",
33
"packageManager": "[email protected]",
4-
"version": "2.4.0",
4+
"version": "2.4.1",
55
"license": "MIT",
66
"author": "Datadog",
77
"description": "Datadog Vite Plugin",

packages/published/vite-plugin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Anything between #types-export-injection-marker
77
// will be updated using the 'yarn cli integrity' command.
88

9+
import type { Options } from '@dd/core/types';
910
import * as factory from '@dd/factory';
1011
import vite from 'vite';
1112

@@ -16,7 +17,7 @@ export const datadogVitePlugin = factory.buildPluginFactory({
1617
version: pkg.version,
1718
}).vite;
1819

19-
export type { Options as VitePluginOptions } from '@dd/core/types';
20+
export type VitePluginOptions = Options;
2021

2122
export type {
2223
// #types-export-injection-marker

packages/published/webpack-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@datadog/webpack-plugin",
33
"packageManager": "[email protected]",
4-
"version": "2.4.0",
4+
"version": "2.4.1",
55
"license": "MIT",
66
"author": "Datadog",
77
"description": "Datadog Webpack Plugin",

packages/published/webpack-plugin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Anything between #types-export-injection-marker
77
// will be updated using the 'yarn cli integrity' command.
88

9+
import type { Options } from '@dd/core/types';
910
import * as factory from '@dd/factory';
1011
import webpack from 'webpack';
1112

@@ -16,7 +17,7 @@ export const datadogWebpackPlugin = factory.buildPluginFactory({
1617
version: pkg.version,
1718
}).webpack;
1819

19-
export type { Options as WebpackPluginOptions } from '@dd/core/types';
20+
export type WebpackPluginOptions = Options;
2021

2122
export type {
2223
// #types-export-injection-marker

packages/tests/src/_jest/helpers/env.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ export const logEnv = (env: TestEnv) => {
7676
throw new Error(
7777
`Invalid "${red(`--bundlers ${REQUESTED_BUNDLERS.join(',')}`)}".\nValid bundlers are ${FULL_NAME_BUNDLERS.map(
7878
(b) => green(b),
79-
)
80-
.sort()
81-
.join(', ')}.`,
79+
).join(', ')}.`,
8280
);
8381
}
8482
const bundlersList = REQUESTED_BUNDLERS.map((bundler) => green(bundler)).join(', ');

packages/tests/src/_jest/helpers/mocks.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const logFn: Logger = {
5858
};
5959
export const mockLogger: Logger = logFn;
6060

61-
export const getEsbuildMock = (options: Partial<PluginBuild> = {}): PluginBuild => {
61+
export const getEsbuildMock = (overrides: Partial<PluginBuild> = {}): PluginBuild => {
6262
return {
6363
resolve: async (filepath) => {
6464
return {
@@ -77,7 +77,7 @@ export const getEsbuildMock = (options: Partial<PluginBuild> = {}): PluginBuild
7777
onResolve: jest.fn(),
7878
onLoad: jest.fn(),
7979
onDispose: jest.fn(),
80-
...options,
80+
...overrides,
8181
esbuild: {
8282
context: jest.fn(),
8383
build: jest.fn(),
@@ -90,15 +90,15 @@ export const getEsbuildMock = (options: Partial<PluginBuild> = {}): PluginBuild
9090
analyzeMetafileSync: jest.fn(),
9191
initialize: jest.fn(),
9292
version: '1.0.0',
93-
...(options.esbuild || {}),
93+
...(overrides.esbuild || {}),
9494
},
9595
initialOptions: {
96-
...(options.initialOptions || {}),
96+
...(overrides.initialOptions || {}),
9797
},
9898
};
9999
};
100100

101-
export const getContextMock = (options: Partial<GlobalContext> = {}): GlobalContext => {
101+
export const getContextMock = (overrides: Partial<GlobalContext> = {}): GlobalContext => {
102102
return {
103103
auth: { apiKey: 'FAKE_API_KEY' },
104104
bundler: {
@@ -117,7 +117,7 @@ export const getContextMock = (options: Partial<GlobalContext> = {}): GlobalCont
117117
pluginNames: [],
118118
start: Date.now(),
119119
version: 'FAKE_VERSION',
120-
...options,
120+
...overrides,
121121
};
122122
};
123123

0 commit comments

Comments
 (0)