Giter Club home page Giter Club logo

Comments (9)

 avatar commented on August 16, 2024 1

@ahmadawais ok so it is definitively a strangeness related to my setup.
If i find a replicable reason i will let you know.
Thank you for the support!

from create-guten-block.

ahmadawais avatar ahmadawais commented on August 16, 2024

That's very kind of you to say! 💯

One of the best thing about create-guten-block is how opinionated it is. I am literally thinking of moving it all to Styled Components that's CSS in JS.

But I'll in to support of Stylus and Less, it's a decision, not options philosophy here, and I don't want to make it a tool that can have all the features as it will make things complex for end users.

Can you explain "Be able to add another JS file to compilation"?

Peace! ✌️

from create-guten-block.

maximebj avatar maximebj commented on August 16, 2024

Oh yeah great Idea. I'm just starting with Styled components but it's awesome. I really think in the long term it'll become a standard way of doing CSS in React. It's simple and clean.

For the "another JS" :
For now we have blocks.js compiling into blocks.build.js

But if I want another JS file to compile elsewhere (for other reasons) I'm not sure if I can do it.

For now I have Webpack for Gutenberg but I still keep Gulp to compile JS and CSS for the PHP Side wp the WP admin . May be in the future I'll be able to keep only Webpack (but I understand CGB is not about handling every custom need. For now my mix gulp + webpack is perfect and fits all my needs)

thanks !

from create-guten-block.

slushman avatar slushman commented on August 16, 2024

+1 for moving to styled-components.

from create-guten-block.

ahmadawais avatar ahmadawais commented on August 16, 2024

Oh I have a project that I am going to open source soon which has both Gulp and webpack support. Also, I am open to a PR related to styled-components.

from create-guten-block.

 avatar commented on August 16, 2024

Hi guys, is it possible to add an npm package npm i package-name without ejecting?
At the moment doing it will reset the package.json and node_modules folder loosing all CGB settings and scripts.

from create-guten-block.

ahmadawais avatar ahmadawais commented on August 16, 2024

@SineGrain just install it. Your package.json is yours to do whatever you want with it. Just keep cgb-scripts and it's scripts in there.

from create-guten-block.

 avatar commented on August 16, 2024

@ahmadawais doing npx create-guten-block test-cgb-block-3 the installation script on my machine create the following package.json

{
  "name": "test-cgb-block-3-cgb-guten-block",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "cgb-scripts start",
    "build": "cgb-scripts build",
    "eject": "cgb-scripts eject"
  }
}

If you add a package leaving it as is (eg. npm i throttle-debounce ) npm will reset your node_modules folder.

To add modules i had to add manually cgb-scripts as dependency.

{
  "name": "test-cgb-block-3-cgb-guten-block",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "cgb-scripts start",
    "build": "cgb-scripts build",
    "eject": "cgb-scripts eject"
  },
  "dependencies": {
    "cgb-scripts": "^1.9.8"
  }
}

node v8.12.0
npm v6.4.1

from create-guten-block.

ahmadawais avatar ahmadawais commented on August 16, 2024

@SineGrain I just ran npx create-guten-block tstblck to test it and the block that got created had this package.json file.

{
  "name": "tstblck-cgb-guten-block",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "cgb-scripts start",
    "build": "cgb-scripts build",
    "eject": "cgb-scripts eject"
  },
  "dependencies": {
    "cgb-scripts": "1.9.8"
  }
}

The dependency of cgb-scripts is there.

I then ran npm i throttle-debounce and now the package.json is

{
  "name": "tstblck-cgb-guten-block",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "cgb-scripts start",
    "build": "cgb-scripts build",
    "eject": "cgb-scripts eject"
  },
  "dependencies": {
    "cgb-scripts": "1.9.8",
    "throttle-debounce": "^2.0.1"
  }
}

from create-guten-block.

Related Issues (20)

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.