Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semanticTokens don't seem to generate in nx/monorepo context #984

Closed
1 of 3 tasks
mayteio opened this issue Jul 8, 2023 · 0 comments
Closed
1 of 3 tasks

semanticTokens don't seem to generate in nx/monorepo context #984

mayteio opened this issue Jul 8, 2023 · 0 comments

Comments

@mayteio
Copy link

mayteio commented Jul 8, 2023

Description

I'm using nx to manage my project. I've got it set up so that;

  1. Main Next.js app runs in apps/my-app
  2. tokens, semantic tokens and recipes live in libs/theme and imported into the panda.config.ts via @nx-integrated-monorepo/theme.
  3. panda watches the next.js app/storybook and outputs are sent to libs/styled-system/src/__generated__/* and exported via @nx-integrated-monorepo/styled-system.

This works as expected for recipes and tokens, but not semantic tokens.

Here's my panda.config.ts:

import { defineConfig } from '@pandacss/dev';
import {
  recipes,
  semanticTokens,
  tokens,
  textStyles,
} from '@nx-integrated-monorepo/theme';

export default defineConfig({
  include: ['./app/**/*.{ts,tsx}', '../../libs/**/*.{ts,tsx}'],
  exclude: [],
  theme: {
    semanticTokens, // doesn't work
    extend: {
      recipes,
      textStyles,
      tokens,
      semanticTokens: { // also doesn't work
        colors: {
          heavy: { value: '#FF0000' },
        },
      },
    },
  },
  jsxFramework: 'react',
  outExtension: 'js', // needed for jest
  outdir: '../../libs/styled-system/src/__generated__',
});

This mostly works as expected - I can see tokens I've created via defineTokens in the output CSS, but the semantic tokens are not outputting (regardless of whether I inline them here or define them in the theme lib).

Link to Reproduction

Codesandbox

Steps to reproduce

  1. Go to codesandbox
  2. Run task called "Run storybook"
  3. Check libs/styled-system/src/__generated__tokens/index.css for missing heavy semantic token
  4. Verify in storybook that the token isn't found:
Screenshot 2023-07-08 at 12 35 31 pm

JS Framework

React, TS, next.js, storybook, nx (🥲)

Panda CSS Version

0.5.1

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

@mayteio mayteio changed the title semanticTokens don't seem to generate in nx context (full repro included) semanticTokens don't seem to generate in nx/monorepo context Jul 8, 2023
@chakra-ui chakra-ui locked and limited conversation to collaborators Jul 8, 2023
@segunadebayo segunadebayo converted this issue into discussion #988 Jul 8, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant