-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fc7709
commit 26e3aef
Showing
10 changed files
with
134 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,47 @@ | ||
import stylex from "@stylexjs/stylex"; | ||
import { Flex } from "@urban-ui/flex"; | ||
import { spacing } from "@urban-ui/theme/spacing.stylex"; | ||
import stylex from '@stylexjs/stylex' | ||
import { Flex } from '@urban-ui/flex' | ||
import { spacing } from '@urban-ui/theme/spacing.stylex' | ||
|
||
const styles = stylex.create({ | ||
block: { | ||
backgroundColor: "hotpink", | ||
width: spacing.xl, | ||
height: spacing.xl, | ||
}, | ||
}); | ||
block: { | ||
backgroundColor: 'hotpink', | ||
width: spacing.xl, | ||
height: spacing.xl, | ||
}, | ||
}) | ||
|
||
function Block() { | ||
return <div {...stylex.props(styles.block)} />; | ||
return <div {...stylex.props(styles.block)} /> | ||
} | ||
|
||
export default function FlexPage() { | ||
return ( | ||
<> | ||
<h1>Flex</h1> | ||
<Flex orientation="v" gap="xl"> | ||
<div>gap: sm</div> | ||
<Flex gap="sm"> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
</Flex> | ||
<div>gap: md</div> | ||
<Flex gap="md"> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
</Flex> | ||
</Flex> | ||
</> | ||
); | ||
return ( | ||
<> | ||
<h1>Flex</h1> | ||
<Flex orientation="v" gap="sm"> | ||
<div>gap: sm</div> | ||
<Flex gap="sm"> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
</Flex> | ||
<div>gap: md</div> | ||
<Flex gap="md"> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
</Flex> | ||
<div>gap: lg</div> | ||
<Flex gap="lg"> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
<Block /> | ||
</Flex> | ||
</Flex> | ||
<div style={{ paddingBottom: 24 }} /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"input": "./src/app", | ||
// "input": "./dist", | ||
// "input": "./disttest", | ||
"output": "./generated/stylex", | ||
// "modules_EXPERIMENTAL": ["@stylexjs/open-props", "@urban-ui/theme"], | ||
// "modules_EXPERIMENTAL": ["@stylexjs/open-props"], | ||
// "babelPresets": [ | ||
// ["@babel/preset-typescript", { "allExtensions": true, "isTSX": true }], | ||
// "@babel/preset-react" | ||
// ], | ||
"styleXBundleName": "stylex_bundle.css", | ||
"watch": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"presets": ["next/babel"], | ||
"plugins": [[ | ||
"@stylexjs/babel-plugin", { | ||
"dev": true, | ||
"stylexSheetName": "<>", | ||
"useCSSLayers": true, | ||
"unstable_moduleResolution": { | ||
"type": "commonJS", | ||
"rootDir": "../../" | ||
} | ||
} | ||
]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,51 @@ | ||
import cp from 'node:child_process' | ||
import path from 'node:path' | ||
import util from 'node:util' | ||
import type { Config } from '@urban-ui/arc' | ||
import { getTsConfig } from '@urban-ui/arc/ts' | ||
|
||
// const spawn = util.promisify(cp.spawn) | ||
|
||
const tsconfig = await getTsConfig() | ||
|
||
const config: Config = { | ||
include: [tsconfig.compilerOptions?.rootDir ?? 'src', '!**/*.test.ts*'], | ||
outDir: 'dist', | ||
rootDir: tsconfig.compilerOptions?.rootDir ?? 'src', | ||
events: { | ||
complete: async () => { | ||
console.log('🎉') | ||
await spawn('del', ['disttest2']) | ||
console.log(process.cwd(), __dirname) | ||
await spawn('stylex', [ | ||
'--config', | ||
path.join(__dirname, 'stylex.config.jsonc'), | ||
]) | ||
// await new Promise((res) => { | ||
// const pipe = cp.spawn('stylex', ['-i', 'disttest', '-o', 'disttest2'], { | ||
// stdio: [0, 1, 2], | ||
// }) | ||
// pipe.on('data', (chunk) => { | ||
// console.log(chunk) | ||
// }) | ||
// pipe.on('close', () => { | ||
// console.log('👩🎤') | ||
// res(null) | ||
// }) | ||
// }) | ||
console.log('❤️') | ||
}, | ||
}, | ||
} | ||
|
||
export default config | ||
|
||
function spawn(cmd: string, params: Array<string>) { | ||
return new Promise((res) => { | ||
const pipe = cp.spawn(cmd, params, { | ||
stdio: [0, 1, 2], | ||
}) | ||
pipe.on('data', console.log) | ||
pipe.on('close', res) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"input": "./src", | ||
// "input": "./dist", | ||
// "input": "./disttest", | ||
"output": "./disttest2", | ||
// "modules_EXPERIMENTAL": ["@stylexjs/open-props"], | ||
"babelPresets": [ | ||
["@babel/preset-typescript", { "allExtensions": true, "isTSX": true }], | ||
"@babel/preset-react" | ||
], | ||
"styleXBundleName": "stylex_bundle.css", | ||
"watch": false | ||
} |