@multiplatform.one/config 8.3.0 → 8.5.0
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/lib/index.js +1 -1
- package/lib/{vitest-C2MTsd5m.js → vitest-B2vcGrZM.js} +6 -2
- package/lib/vitest.js +1 -1
- package/lint.d.ts +2 -0
- package/lint.mjs +3 -1
- package/package.json +2 -2
- package/src/lint.spec.ts +23 -0
- package/src/react-native.config.cjs +7 -1
- package/src/vitest.ts +6 -2
- package/types/vitest.d.ts +6 -2
- package/types/vitest.d.ts.map +1 -1
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as phosphorTokenColorPlugin, n as tamaguiWorkspacePathsFile, t as ensureTamaguiWorkspacePaths } from "./tamaguiWorkspacePaths-DR3dud79.js";
|
|
2
2
|
import { t as createStorybookViteConfig } from "./storybook-BpaziEtP.js";
|
|
3
3
|
import { t as createViteConfig } from "./vite-CeDmMMjx.js";
|
|
4
|
-
import { t as createVitestConfig } from "./vitest-
|
|
4
|
+
import { t as createVitestConfig } from "./vitest-B2vcGrZM.js";
|
|
5
5
|
|
|
6
6
|
export { createStorybookViteConfig, createViteConfig, createVitestConfig, ensureTamaguiWorkspacePaths, phosphorTokenColorPlugin, tamaguiWorkspacePathsFile };
|
|
@@ -91,14 +91,18 @@ function pinNodeReactRequire(reactDir, reactDomDir, schedulerDir) {
|
|
|
91
91
|
* handling Tamagui transforms, react-native-web replacement, React deduplication,
|
|
92
92
|
* and consistent coverage/environment settings.
|
|
93
93
|
*
|
|
94
|
+
* A published package owns its own Tamagui config under tests/ and never
|
|
95
|
+
* reaches up into features/ for the app tier's theme (FZ-10712, gated by
|
|
96
|
+
* scripts/verify-packages-direction.mjs), so the default is what to take.
|
|
97
|
+
*
|
|
94
98
|
* @example
|
|
95
99
|
* ```ts
|
|
96
|
-
* //
|
|
100
|
+
* // public/components/vitest.config.mjs
|
|
97
101
|
* import { createVitestConfig } from "@multiplatform.one/config/vitest";
|
|
98
102
|
*
|
|
99
103
|
* export default createVitestConfig({
|
|
100
104
|
* setupFiles: ["./tests/setup.tsx"],
|
|
101
|
-
* tamaguiConfig: "
|
|
105
|
+
* tamaguiConfig: "./tests/tamagui.config.ts",
|
|
102
106
|
* });
|
|
103
107
|
* ```
|
|
104
108
|
*/
|
package/lib/vitest.js
CHANGED
package/lint.d.ts
CHANGED
package/lint.mjs
CHANGED
|
@@ -468,7 +468,7 @@ function readThemeNames() {
|
|
|
468
468
|
return new Set(names.flatMap((name) => [name, ...name.split("_").slice(1)]));
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
-
function readThemeKeys() {
|
|
471
|
+
export function readThemeKeys() {
|
|
472
472
|
/** @type {Set<string>} */
|
|
473
473
|
const keys = new Set();
|
|
474
474
|
const v5 = tryRequire("@tamagui/themes/v5");
|
|
@@ -490,6 +490,8 @@ function readThemeKeys() {
|
|
|
490
490
|
for (const [, hue] of syntaxHues.matchAll(/"([a-z]+)"/g)) {
|
|
491
491
|
keys.add(`syntax${hue[0].toUpperCase()}${hue.slice(1)}`);
|
|
492
492
|
}
|
|
493
|
+
const postPass = src.match(/export const postPassThemeKeys = \[([^\]]+)\]/)?.[1] ?? "";
|
|
494
|
+
for (const [, key] of postPass.matchAll(/"([A-Za-z0-9]+)"/g)) keys.add(key);
|
|
493
495
|
for (const k of keysOfBlock(sliceBlock(builderSrc, "function getBaseTheme", "\n}"), 4))
|
|
494
496
|
keys.add(k);
|
|
495
497
|
return keys;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/config",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"description": "Shared build and test configuration presets for multiplatform.one",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@babel/parser": "^7.29.9",
|
|
123
123
|
"@babel/plugin-transform-block-scoping": "^7.29.7",
|
|
124
124
|
"@babel/traverse": "^7.29.10",
|
|
125
|
-
"@multiplatform.one/utils": "^8.
|
|
125
|
+
"@multiplatform.one/utils": "^8.5.0",
|
|
126
126
|
"@tamagui/vite-plugin": "2.7.6",
|
|
127
127
|
"@vitejs/plugin-react": "^6.1.2",
|
|
128
128
|
"dotenv": "^17.4.2",
|
package/src/lint.spec.ts
CHANGED
|
@@ -1657,6 +1657,29 @@ describe("the v5 theme registry", () => {
|
|
|
1657
1657
|
warn.mockRestore();
|
|
1658
1658
|
}
|
|
1659
1659
|
});
|
|
1660
|
+
|
|
1661
|
+
it("resolves keys only the theme post-passes write, and still rejects an unknown key", () => {
|
|
1662
|
+
const root = makeTree();
|
|
1663
|
+
symlinkSync(join(process.cwd(), "../../node_modules"), join(root, "node_modules"), "dir");
|
|
1664
|
+
const app = join(root, "apps/demo/App.tsx");
|
|
1665
|
+
const error = vi.spyOn(console, "error").mockImplementation(() => {});
|
|
1666
|
+
const log = vi.spyOn(console, "log").mockImplementation(() => {});
|
|
1667
|
+
const warn = vi.spyOn(console, "warn").mockImplementation(() => {});
|
|
1668
|
+
try {
|
|
1669
|
+
writeFileSync(
|
|
1670
|
+
app,
|
|
1671
|
+
'export const App = () => <View borderColor="$borderColorField"><View borderColor="$borderColorFieldHover" /><View color="$identityInk" /><View color="$accentOnSurface" /><View borderColor="$switchTrackOffBorder" /></View>;',
|
|
1672
|
+
);
|
|
1673
|
+
expect(runConventionChecks({ roots: { root } })).toBe(0);
|
|
1674
|
+
writeFileSync(app, 'export const App = () => <View borderColor="$notAKey" />;');
|
|
1675
|
+
expect(runConventionChecks({ roots: { root } })).toBe(1);
|
|
1676
|
+
expect(error.mock.calls.flat().join("\n")).toContain('borderColor="$notAKey"');
|
|
1677
|
+
} finally {
|
|
1678
|
+
error.mockRestore();
|
|
1679
|
+
log.mockRestore();
|
|
1680
|
+
warn.mockRestore();
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1660
1683
|
});
|
|
1661
1684
|
|
|
1662
1685
|
describe("layout rules (LC-101 ONE-SIDEBAR, LC-102 HUG-CONTENT, LC-103 RESPONSIVE-PARITY)", () => {
|
|
@@ -10,5 +10,11 @@ module.exports = {
|
|
|
10
10
|
// which is empty here and breaks CocoaPods ("Couldn't find react-native
|
|
11
11
|
// package.json"). Resolving it explicitly points the Podfile at the hoisted copy.
|
|
12
12
|
reactNativePath: path.dirname(require.resolve("react-native/package.json")),
|
|
13
|
-
commands:
|
|
13
|
+
commands: (() => {
|
|
14
|
+
try {
|
|
15
|
+
return [...require("vxrn/react-native-commands")];
|
|
16
|
+
} catch {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
})(),
|
|
14
20
|
};
|
package/src/vitest.ts
CHANGED
|
@@ -195,14 +195,18 @@ export interface CreateVitestConfigOptions {
|
|
|
195
195
|
* handling Tamagui transforms, react-native-web replacement, React deduplication,
|
|
196
196
|
* and consistent coverage/environment settings.
|
|
197
197
|
*
|
|
198
|
+
* A published package owns its own Tamagui config under tests/ and never
|
|
199
|
+
* reaches up into features/ for the app tier's theme (FZ-10712, gated by
|
|
200
|
+
* scripts/verify-packages-direction.mjs), so the default is what to take.
|
|
201
|
+
*
|
|
198
202
|
* @example
|
|
199
203
|
* ```ts
|
|
200
|
-
* //
|
|
204
|
+
* // public/components/vitest.config.mjs
|
|
201
205
|
* import { createVitestConfig } from "@multiplatform.one/config/vitest";
|
|
202
206
|
*
|
|
203
207
|
* export default createVitestConfig({
|
|
204
208
|
* setupFiles: ["./tests/setup.tsx"],
|
|
205
|
-
* tamaguiConfig: "
|
|
209
|
+
* tamaguiConfig: "./tests/tamagui.config.ts",
|
|
206
210
|
* });
|
|
207
211
|
* ```
|
|
208
212
|
*/
|
package/types/vitest.d.ts
CHANGED
|
@@ -75,14 +75,18 @@ export interface CreateVitestConfigOptions {
|
|
|
75
75
|
* handling Tamagui transforms, react-native-web replacement, React deduplication,
|
|
76
76
|
* and consistent coverage/environment settings.
|
|
77
77
|
*
|
|
78
|
+
* A published package owns its own Tamagui config under tests/ and never
|
|
79
|
+
* reaches up into features/ for the app tier's theme (FZ-10712, gated by
|
|
80
|
+
* scripts/verify-packages-direction.mjs), so the default is what to take.
|
|
81
|
+
*
|
|
78
82
|
* @example
|
|
79
83
|
* ```ts
|
|
80
|
-
* //
|
|
84
|
+
* // public/components/vitest.config.mjs
|
|
81
85
|
* import { createVitestConfig } from "@multiplatform.one/config/vitest";
|
|
82
86
|
*
|
|
83
87
|
* export default createVitestConfig({
|
|
84
88
|
* setupFiles: ["./tests/setup.tsx"],
|
|
85
|
-
* tamaguiConfig: "
|
|
89
|
+
* tamaguiConfig: "./tests/tamagui.config.ts",
|
|
86
90
|
* });
|
|
87
91
|
* ```
|
|
88
92
|
*/
|
package/types/vitest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../src/vitest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAmGvC,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAE/B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC;IAE7C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IAEF;;;OAG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