Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"oxfmt": "^0.74.0",
"oxlint": "^1.89.0",
"oxlint-tsgolint": "^7.0.2005",
"tsdown": "^0.23.1",
"tsdown": "^0.23.2",
"typescript": "^7.0.2",
"vitest": "^5.0.5"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/babel/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export interface PluginOptions extends Omit<InnerTransformOptions, 'include' | '
export type ResolvedPluginOptions = PluginOptions &
Required<Pick<PluginOptions, 'include' | 'exclude' | 'sourceMap'>>

export const DEFAULT_INCLUDE = [/\.(?:[jt]sx?|[cm][jt]s)(?:$|\?)/]
export const DEFAULT_INCLUDE: RegExp[] = [/\.(?:[jt]sx?|[cm][jt]s)(?:$|\?)/]
// oxlint-disable-next-line no-control-regex
export const DEFAULT_EXCLUDE = [/[/\\]node_modules[/\\]|^\0rolldown\/runtime\.js$/]
export const DEFAULT_EXCLUDE: RegExp[] = [/[/\\]node_modules[/\\]|^\0rolldown\/runtime\.js$/]

export function resolveOptions(options: PluginOptions): ResolvedPluginOptions {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/babel/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { defineConfig } from 'tsdown'
export default defineConfig({
entry: './src/index.ts',
dts: {
tsconfig: '../../tsconfig.common.json',
tsconfig: '../../tsconfig.src.json',
},
})
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures-labels/basic/output.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
function doThing() {
return /* @__PURE__ */ css("display:flex;", "label:doThing;", "/*# sourceMappingURL=[sourcemap] */");
}
//#endregion
export { doThing };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
function doThing() {
return /* @__PURE__ */ css({ color: "hotpink" }, "label:doThing", "/*# sourceMappingURL=[sourcemap] */");
}
//#endregion
export { doThing };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const thing = /* @__PURE__ */ css("display:flex;&:hover{", css`
color: hotpink;
`, ";}", "label:thing;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { thing };
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const doThing = /* @__PURE__ */ css("green", ";/*\n\n something:", "something", ";*/\n color:hotpink;", "label:doThing;", "/*# sourceMappingURL=[sourcemap] */");
const doThing2 = /* @__PURE__ */ css("green", ";/*\n\n something:", "something", ";*/\n color:", "hotpink", ";", "label:doThing2;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { doThing, doThing2 };
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { css } from "@emotion/css";
//#region virtual:entry.ts
// virtual:entry.ts
const wrapFunction = (cb) => {
return cb();
};
const classes = wrapFunction(() => {
return { class1: /* @__PURE__ */ css({ color: "red" }, "label:class1", "/*# sourceMappingURL=[sourcemap] */") };
});
//#endregion
export { classes };
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures-labels/impure/output.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
function doThing() {
return /* @__PURE__ */ css("display:", void 0, ";", "label:doThing;", "/*# sourceMappingURL=[sourcemap] */");
}
//#endregion
export { doThing };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
var virtual_entry_default = () => {
return /* @__PURE__ */ css("color:hotpink;", "", "/*# sourceMappingURL=[sourcemap] */");
};
//#endregion
export { virtual_entry_default as default };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
var virtual_entry_default = () => {
return /* @__PURE__ */ css("color:hotpink;", "", "/*# sourceMappingURL=[sourcemap] */");
};
//#endregion
export { virtual_entry_default as default };
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures-labels/label-1/output.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const thing = /* @__PURE__ */ css("color:hotpink;", "label:thing;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { thing };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const styles = { colorFn1: () => /* @__PURE__ */ css("color:hotpink;", "label:colorFn1;", "/*# sourceMappingURL=[sourcemap] */") };
//#endregion
export { styles };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const styles = { colorFn1: function() {
return /* @__PURE__ */ css("color:hotpink;", "label:colorFn1;", "/*# sourceMappingURL=[sourcemap] */");
} };
//#endregion
export { styles };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const thing = function someName() {
return /* @__PURE__ */ css("color:hotpink;", "label:someName;", "/*# sourceMappingURL=[sourcemap] */");
};
//#endregion
export { thing };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const thing = function() {
return /* @__PURE__ */ css("color:hotpink;", "label:thing;", "/*# sourceMappingURL=[sourcemap] */");
};
//#endregion
export { thing };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const thing = /* @__PURE__ */ css("color:hotpink", "label:thing;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { thing };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const thing = {
thisShouldBeTheLabel: /* @__PURE__ */ css("color:hotpink;", "label:thisShouldBeTheLabel;", "/*# sourceMappingURL=[sourcemap] */"),
"shouldBeAnotherLabel": /* @__PURE__ */ css("color:green;", "label:shouldBeAnotherLabel;", "/*# sourceMappingURL=[sourcemap] */")
};
//#endregion
export { thing };
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const thing = /* @__PURE__ */ css("color:hotpink;", "label:thing;", "/*# sourceMappingURL=[sourcemap] */");
const otherThing = /* @__PURE__ */ css("color:green;", "label:otherThing;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { otherThing, thing };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const [weirdo] = [/* @__PURE__ */ css("color:hotpink;", "", "/*# sourceMappingURL=[sourcemap] */")];
//#endregion
export { weirdo as default };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const { weirdo } = { ["weirdo"]: /* @__PURE__ */ css("color:hotpink;", "", "/*# sourceMappingURL=[sourcemap] */") };
//#endregion
export { weirdo as default };
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
function doThing() {
return { [/* @__PURE__ */ css({ color: "hotpink" }, "", "/*# sourceMappingURL=[sourcemap] */")]: "coldblue" };
}
//#endregion
export { doThing };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.tsx
// virtual:entry.tsx
const StyledDiv = /* @__PURE__ */ styled("div", {
target: "ee6yw5a0",
label: "--virtual-entry-StyledDiv"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { StyledDiv };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.tsx
// virtual:entry.tsx
const StyledDiv = /* @__PURE__ */ styled("div", {
target: "ee6yw5a0",
label: "-"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { StyledDiv };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.tsx
// virtual:entry.tsx
const StyledDiv = /* @__PURE__ */ styled("div", {
target: "ee6yw5a0",
label: "virtual-entry-StyledDiv"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { StyledDiv };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.tsx
// virtual:entry.tsx
const StyledDiv = /* @__PURE__ */ styled("div", {
target: "ee6yw5a0",
label: "virtual-entry"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { StyledDiv };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.tsx
// virtual:entry.tsx
const StyledDiv = /* @__PURE__ */ styled("div", {
target: "ee6yw5a0",
label: "StyledDiv"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { StyledDiv };
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { nonExistantImport } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
nonExistantImport();
//#endregion
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const doThing = /* @__PURE__ */ css("color:hotpink;", "label:doThing;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { doThing };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
const doThing = /* @__PURE__ */ css("color:hotpink;", "label:doThing;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { doThing };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.ts
// virtual:entry.ts
const Dollar$Div = /* @__PURE__ */ styled("div", {
target: "e1347i8e0",
label: "Dollar-Div"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { Dollar$Div };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.ts
// virtual:entry.ts
const StyledDiv = /* @__PURE__ */ styled("div", {
target: "ee6yw5a0",
label: "StyledDiv"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { StyledDiv };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.ts
// virtual:entry.ts
const StyledDiv = /* @__PURE__ */ styled("div", {
target: "ee6yw5a0",
label: "StyledDiv"
})("background-color:black;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { StyledDiv };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { css } from "@emotion/react";
//#region virtual:entry.ts
// virtual:entry.ts
function media(...args) {
return /* @__PURE__ */ css("@media (min-width:100px){", css(...args), ";}", "label:media;", "/*# sourceMappingURL=[sourcemap] */");
}
const test = /* @__PURE__ */ css(media`color: red;`, ";", "label:test;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { test };
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures/comments/output.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import styled from "@emotion/styled";
//#region virtual:entry.tsx
// virtual:entry.tsx
var virtual_entry_default = /* @__PURE__ */ styled("div", {
target: "eluin830",
label: ""
})("color:red;.foo{color:blue;}width:10px;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { virtual_entry_default as default };
1 change: 0 additions & 1 deletion packages/emotion/tests/fixtures/compress/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ const StyledInput = /* @__PURE__ */ styled("input", {
color: "red",
width: "4px"
}), "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { Animated, Example, StyledInput, shadowBorder };
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures/css-default-export/output.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import css from "@emotion/css";
//#region virtual:entry.tsx
// virtual:entry.tsx
const styles = /* @__PURE__ */ css("color:red;", "label:styles;", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { styles };
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures/css-in-callback/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "@emotion/styled";
import { PureComponent } from "react";
import ReactDOM from "react-dom";
import { jsx, jsxs } from "react/jsx-runtime";
//#region virtual:entry.tsx
// virtual:entry.tsx
const stylesInCallback = (props) => /* @__PURE__ */ css({
color: "red",
background: "yellow",
Expand Down Expand Up @@ -56,5 +56,4 @@ var SimpleComponent = class extends PureComponent {
}
};
ReactDOM.render(/* @__PURE__ */ jsx(SimpleComponent, {}), document.querySelector("#app"));
//#endregion
export { Container2, ContainerWithOptions, DivContainer2, DivContainerExtended, DivContainerExtended2, SimpleComponent, SpanContainer, styles, styles2 };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css } from "@emotion/react";
//#region virtual:entry.tsx
// virtual:entry.tsx
const contents = /* @__PURE__ */ css({ position: "absolute" }, "label:contents", "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { contents };
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures/global-styles/output.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Global, css } from "@emotion/react";
import { jsx } from "react/jsx-runtime";
//#region virtual:entry.tsx
// virtual:entry.tsx
var virtual_entry_default = () => /* @__PURE__ */ jsx(Global, { styles: [css("body{margin:0;}"), "/*# sourceMappingURL=[sourcemap] */"] });
//#endregion
export { virtual_entry_default as default };
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import "react";
import { SomeGlobalFromCore } from "package-two";
import { jsx } from "react/jsx-runtime";
//#region virtual:entry.tsx
// virtual:entry.tsx
const getBgColor = () => ({ backgroundColor: "#fff" });
var virtual_entry_default = () => /* @__PURE__ */ jsx(SomeGlobalFromCore, { styles: [{
color: "hotpink",
...getBgColor()
}, "/*# sourceMappingURL=[sourcemap] */"] });
//#endregion
export { virtual_entry_default as default };
3 changes: 1 addition & 2 deletions packages/emotion/tests/fixtures/import-map/global/output.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "react";
import { SomeGlobalFromCore } from "package-two";
import { jsx } from "react/jsx-runtime";
//#region virtual:entry.tsx
// virtual:entry.tsx
var virtual_entry_default = () => /* @__PURE__ */ jsx(SomeGlobalFromCore, { styles: [{ color: "hotpink" }, "/*# sourceMappingURL=[sourcemap] */"] });
//#endregion
export { virtual_entry_default as default };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { nonDefaultStyled } from "package-one";
//#region virtual:entry.tsx
// virtual:entry.tsx
let SomeComp = /* @__PURE__ */ nonDefaultStyled("div", {
target: "e1v42pg20",
label: "SomeComp"
})({ color: "hotpink" }, "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { SomeComp };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { nonDefaultStyled } from "package-one";
//#region virtual:entry.tsx
// virtual:entry.tsx
let SomeComp = /* @__PURE__ */ nonDefaultStyled("div", {
target: "e9npfi30",
label: "SomeComp"
})({ color: "hotpink" }, "/*# sourceMappingURL=[sourcemap] */");
//#endregion
export { SomeComp };
Loading
Loading