Giter Club home page Giter Club logo

component-controls's People

Contributors

atanasster avatar dependabot[bot] avatar martin-stoyanov avatar poteirard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

component-controls's Issues

Refresh fileInfo when saving a component

Describe the bug
Refresh fileInfo when saving a component

To Reproduce
Steps to reproduce the behavior:

  1. Add a comment to a component containing a TODO
    The component fileInfo (the sloc object specifically) doesn't update to account for the additional TOD

Expected behavior
FileInfo should be refreshed when saving a component

Absolute imports

My storybook crashed after I started using absolute importa on my app.
My app run fine and test ok too. Butt storybook fails to find absolute imnports

image

working config without absolute imports

module.exports = {
  stories: ['./src/**/*.stories.(tsx|mdx)'],
  addons: [
    '@storybook/addon-viewport/register',
    {
      name: '@component-controls/storybook',
      options: {
        webpack: ['instrument', 'react-docgen-typescript'],
      },
    },
  ],
}

trying to make it work with absolute imports

const path = require('path')

module.exports = {
  stories: ['./src/**/*.stories.(tsx|mdx)'],
  addons: [
    '@storybook/addon-viewport/register',
    {
      name: '@component-controls/storybook',
      options: {
        webpack: ['instrument', 'react-docgen-typescript'],
      },
    },
  ],
  webpackFinal: async (config, { configType }) => {
    // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
    // You can change the configuration based on that.
    // 'PRODUCTION' is used when building the static version of storybook.

    config.resolve = {
      modules: [path.resolve(__dirname, 'src'), 'node_modules'],
    }

    // Return the altered config
    return config
  },
}

page container header rows spacing

Describe the bug
When some todos are in the component file and there is not author on the dates row, the line with stats becomes larger than the dates and this causes misalignment

To Reproduce
Steps to reproduce the behavior:

  1. Go to a component with todos
  2. The story should not have an author

Screen Shot 2021-03-10 at 10 00 24 PM

Can't resolve 'component-controls-bundle

Using craco in a create-react-app project I'm getting the following error

Failed to compile.
./node_modules/@component-controls/base-integration/dist/store.js
Module not found: Can't resolve 'component-controls-bundle' in '/mnt/c/wsl/audience/client/node_modules/@component-controls/base-integration/dist'

My craco config file

const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const path = require('path')
const fs = require('fs')
const CracoLessPlugin = require('craco-less')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')

const sharedFiles = fs.readdirSync(path.resolve(__dirname, '..', 'shared'))

const {
  withComponentControls
} = require('@component-controls/react-router-integration/webpack-build')

const publicFolder = process.env.PUBLIC_PATH || 'public'
const publicPath = path.join(__dirname, publicFolder)
const distFolder = process.env.BUILD_PATH || 'build'
const distPath = path.join(__dirname, distFolder)

process.env.REACT_APP_ENV = process.env.NODE_ENV || 'development'
process.env.PUBLIC_URL = '/'

const config = {
  devServer: {
    contentBase: publicPath,
    historyApiFallback: true,
    open: true,
    hot: true
  },
  plugins: [
    {
      plugin: CracoLessPlugin,
      options: {
        lessLoaderOptions: {
          lessOptions: {
            modifyVars: { '@primary-color': '#97d700' },
            javascriptEnabled: true
          }
        }
      }
    }
  ],
  webpack: {
    plugins: {
      add: [
        new HtmlWebpackPlugin({
          template: 'public/index.html'
        }),
        new webpack.HotModuleReplacementPlugin()
      ]
    },
    configure: (webpackConfig) => {
      if (process.env.RUN_ANALYZER) {
        webpackConfig.plugins.push(new BundleAnalyzerPlugin())
      }

      webpackConfig.devtool = 'inline-source-map'

      // Remove multiple different bn.js in bundle
      webpackConfig.resolve.alias['bn.js'] = path.resolve(
        __dirname,
        'node_modules/bn.js'
      )

      webpackConfig.output = {
        path: distPath,
        publicPath: '/',
        jsonpFunction: 'wpJson'
      }

      webpackConfig.entry = './src/index.js'

      webpackConfig.resolve.extensions = ['.js']

      return webpackConfig
    }
  }
}

module.exports = withComponentControls({
  config,
  options: { configPath: '.config', distFolder: publicFolder }
})

react-colorful v5

Hey @atanasster! Hope you're doing well.

Sorry for bothering, but I have news that might be important for you:

react-colorful v5 was just released and it doesn't require importing CSS-file.
It means that you can remove all CSS code you copied from the original repo.
Just use the CSS-in-JS solution of your choice to override the styles you need.

https://github.com/omgovich/react-colorful/releases

ESM Gatsby v5 errors

Error: [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\donbo\Documents\GitHub\bibwoe.com\node_modules@mdx-js\mdx\index
.js from C:\Users\donbo\Documents\GitHub\bibwoe.com\node_modules@component-controls\instrument\dist\index.js not supporte
d.
Instead change the require of C:\Users\donbo\Documents\GitHub\bibwoe.com\node_modules@mdx-js\mdx\index.js in C:\Users\don
bo\Documents\GitHub\bibwoe.com\node_modules@component-controls\instrument\dist\index.js to a dynamic import() which is av
ailable in all CommonJS modules.

  • index.js:7 Object.
    [bibwoe.com]/[@component-controls]/instrument/dist/index.js:7:11

  • index.js:14 Object.
    [bibwoe.com]/[@component-controls]/config/dist/index.js:14:18

  • index2.js:8 Object.
    [bibwoe.com]/[@component-controls]/webpack-compile/dist/index2.js:8:14

  • index.js:7 Object.
    [bibwoe.com]/[@component-controls]/webpack-compile/dist/index.js:7:13

  • webpack-build.js:13 Object.
    [bibwoe.com]/[@component-controls]/base-integration/dist/webpack-build.js:13:22

  • webpack-build.js:1 Object.
    [bibwoe.com]/[@component-controls]/base-integration/webpack-build.js:1:18

  • gatsby-node.js:8 Object.
    [bibwoe.com]/[@component-controls]/gatsby-theme-stories/dist/gatsby-node.js:8:20

  • gatsby-node.js:1 Object.
    [bibwoe.com]/[@component-controls]/gatsby-theme-stories/gatsby-node.js:1:18

Story function not found {} undefined

Hi! Thanks for the amzing library.

I am having some issues implementing this on a project I currently working on.

image

// .storybook/src/stories/test.stories.tsx

import React from "react";

export default {
  title: "Storybook Controls",
};

export const controlsStory = ({ disabled, text }) => (
  <button disabled={disabled}>
    {text}
  </button>
);

controlsStory.story = {
  controls: {
    disabled: { type: 'boolean', value: false },
    text: { type: 'text', value: 'Hello Storybook' },
  }
}

module.exports = {
  addons: ['@storybook/addon-docs', '@component-controls/storybook'],
}


// .storybook/config.js

import { configure } from '@storybook/react';
// automatically import all files ending in *.stories.tsx
configure(require.context('./src/stories', true, /\.stories\.tsx?$/), module);


// .storybook/main.js
module.exports = {
  addons: ['@storybook/addon-docs', '@component-controls/storybook'],
}



// .storybook/webpack.config.js

module.exports = ({ config }) => {
  config.module.rules.push({
    test: /\.(ts|tsx)$/,
    loader: require.resolve('babel-loader'),
    options: {
      presets: [require.resolve('babel-preset-react-app')],
    },
  });

  config.resolve.extensions.push('.ts', '.tsx');
  return config;
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.