Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 12 02:20
    y-chen opened #1263
  • Jan 11 17:10
    TCourtneyOwen opened #134
  • Jan 07 17:35
    mshima closed #247
  • Jan 06 19:22
    github-actions[bot] labeled #247
  • Jan 06 19:22
    cgranade opened #247
  • Jan 06 19:22
    github-actions[bot] labeled #246
  • Jan 06 19:21
    cgranade opened #246
  • Jan 04 00:34
    github-actions[bot] closed #1262
  • Jan 03 10:41
    silvenon closed #507
  • Jan 03 10:40
    silvenon reopened #507
  • Dec 29 2020 10:44
    LukeSheard edited #202
  • Dec 29 2020 10:43
    LukeSheard opened #202
  • Dec 28 2020 11:09
    Rajpratik71 opened #241
  • Dec 28 2020 05:45

    dependabot[bot] on github_actions

    (compare)

  • Dec 28 2020 05:45
    dependabot[bot] closed #129
  • Dec 28 2020 05:45
    dependabot[bot] labeled #133
  • Dec 28 2020 05:45
    dependabot[bot] labeled #133
  • Dec 28 2020 05:45
    dependabot[bot] opened #133
  • Dec 28 2020 05:45

    dependabot[bot] on github_actions

    Bump peter-evans/create-pull-re… (compare)

  • Dec 27 2020 16:48
    vinaysharma14 opened #201
Matthew Pirocchi
@mpiroc
Is it a supported use-case to incorporate non-yeoman generators? I want to run rush init, which generates a bunch of files, then update those files from my yeoman generator. But rush init generates files into the real filesystem, not the in-memory filesystem.
My rationale is that if rush is updated to generate different content, my yeoman generator will pick up those changes for free.
Matthew Pirocchi
@mpiroc
hmmm I suppose I could run rush init in a temporary location, read each file and this.fs.write it into the in-memory system
Simon Boudrias
@SBoudrias
@mpiroc if you run rush init first, then the yeoman mem-fs won’t be filled with content. So when your generator starts to edit the files on the disk, it’ll read those written by rush. Not sure if that makes your use case easier or not.
2 replies
Devin Fee
@dfee
hi, i'm trying to install yeoman LOCALLY, and getting a warning that Unable to find the npm root, something went wrong. and then Found potential issues on your machine :(. is there a particular reason for this?
Marcelo Shima
@mshima
Devin Fee
@dfee
should i instead open an issue in yeoman/doctor?
Marcelo Shima
@mshima
👍
I thought it was an environment error because I am playing with rpm root on environment but it shouldn’t be used by default.
Just tested and indeed it’s not environment fault.
Devin Fee
@dfee
@mshima alright, i didn't know if yeoman didn't support local installs (for some weird reason).
Paul Bijan Coch
@paulbijacho_twitter
Heey everyone, if someone of you might be interested in a more visual approach of developing code with the help of reusable templates: I and my team have spent the last nine months with the development of https://app.generato.com/#/.
We wanted to have a visual approach to design projects,. write Templates in a text form and have the possibility to regenerate everything with the help of protected „own-code“ areas. We'd be so happy to get your feedback on this. Please try it out and hit me up on Intercom in the app itself, via email: paul.coch@generato.com, or simply right here. I'd love to hear what you have to say about it, what you like, what you don't like and how we can approve this to a better developer experience.
Lynn14m
@Lynn14m
Hey everyone! I created a Yeoman generator and used the steps on the ‘Discovering Generators’ page to get the generator to be added to the website. For the generator, instead of using the naming convention of generator-your-unique-name, I named it using a scoped package name convention (I looked through you GitHub repository and saw that you added scoped package name support in your v2.4.0 release). However, my generator still isn’t showing up on the Yeoman website. Is there anything special/extra that I need to do for Yeoman to pick up my generator?
Maxime ROBIN
@Waxo
hello everyone, I'm tryiong to figure out if I can use yeoman using only yarn and no NPM for developping and usage, is there any way to achieve that, i think i've reached the end of internet
Maxime ROBIN
@Waxo
nvm i'm stupid it works, i didn't named my files and folder properly my bad, read the docs is the good way
allacherkes
@allacherkes
Hi everyone. I have 'generator-a' which calls for 'generator-b' inside with command composeWith(). Now I want prompts of 'generator-b' to be displayed before prompts of 'generator-a'. Is it possible? What is the best way to achieve this? Thanks.
Minu Francis
@francisminu
Hi All
I am trying to incorporate yeoman in my oclif based CLI and I added the below lines as mentioned in the official documentation:
const env = createEnv()
env.register(require.resolve('../generators/component1'), oclif:component1);
//await super.generate('component1');
env.run('oclif:component1', (err: any, stdout: any, stderr: any) => {
console.log(err);
});
But I seem to be getting this error:
TypeError: Class extends value #<Object> is not a constructor or null
at Object.<anonymous> (C:/Project/SynapseModernization/2020/cli/src/generators/component1.ts:5:42)) 439:23)
at Module.m._compile (C:/Project/SynapseModernization/2020/cli/node_modules/ts-node/src/index.ts:cli/node_modules/ts-node/src/index.ts:442:12)439:23) -environment/lib/store.js:47:27)
at Object.require.extensions.(anonymous function) [as .ts] (C:/Project/SynapseModernization/2020/js:71:39)cli/node_modules/ts-node/src/index.ts:442:12)
at Object.get [as oclif:component1] (C:/Project/SynapseModernization/2020/cli/node_modules/yeoman-environment/lib/store.js:47:27)
at Store.get (C:/Project/SynapseModernization/2020/cli/node_modules/yeoman-environment/lib/store.js:71:39)
at Environment.get (C:/Project/SynapseModernization/2020/cli/node_modules/yeoman-environment/lib/environment.js:540:48)
at Environment.create (C:/Project/SynapseModernization/2020/cli/node_modules/yeoman-environment/lib/environment.js:613:37)
at instantiateAndRun (C:/Project/SynapseModernization/2020/cli/node_modules/yeoman-environment/lib/environment.js:729:30)
at Environment.run (C:/Project/SynapseModernization/2020/cli/node_modules/yeoman-environment/lib/environment.js:758:12)
at CsGenerator.run (C:/Project/SynapseModernization/2020/cli/src/commands/component1.ts:18:9)
at CsGenerator._run (C:/Project/SynapseModernization/2020/cli/node_modules/@oclif/command/lib/command.js:35:31)
Any inputs are greatly appreciated
Minu Francis
@francisminu
And it occurs at env.run call
Covarians
@Covarians
Hello,
I would like to know if there is a process to re-scaffold a project (generated with and old version of a generator) with the latest version of the same generator in order to benefit from its latest improvement and also the latest version of the dependencies ? Timpically I am using the yo-office-generator and it comes now with a leaner project structure and dist directory plus some other linter improvements.
Bryan Stopp
@bstopp

Hey folks - question: i'm trying to use the yeoman-test createGenerator helper method. But i get:

TypeError: console.Console is not a constructor

    at new TerminalAdapter (/work/spaces/generator-test/node_modules/yeoman-environment/lib/adapter.js:24:39)

I tried to base my logic off of the tests here: https://github.com/yeoman/yeoman-test/blob/bb820da630d9d7ee8d9e7898848e896427e25675/test/helpers.js#L41-L70 but while that works when i run locally, my generator tests don't work.. Any thoughts?

LitoMore
@LitoMore
@bstopp You can step into the yeoman-environment in node_modules, then print the options.console out.
The source code is here: https://github.com/yeoman/environment/blob/master/lib/adapter.js#L24
Bryan Stopp
@bstopp
Yeh - turns out the issue is with Jest. The global console variable/module that Jest creates doesn’t have the specie constructor that the Yeoman Environment expects. Hence the error. Amazingly enough someone committed a fix to Jest yesterday-ish and should make the next release. Heh.
LitoMore
@LitoMore
Hhh, interesting.
Bryan Stopp
@bstopp
LitoMore
@LitoMore
👍
Bryan Stopp
@bstopp
Craziest thing. Took a while for my coworker to help me find. Thanks tho! 😆
LitoMore
@LitoMore
np ✌️
Bryan Stopp
@bstopp
We are guessing if we moved to Mocha itd work no prob. But i started down the Jest path so dont want to rewrite w/o good reason
LitoMore
@LitoMore
I would be willing to move to AVA https://github.com/avajs/ava .
Bryan Stopp
@bstopp
🤦‍♂️ im just getting the hang of Jest! 🤣
LitoMore
@LitoMore
Both good, just choose your love.
Bryan Stopp
@bstopp
There's no way to determine whether or not an option was set as a default value vs actually passed on the CLI - is there?
Bryan Stopp
@bstopp
When you run composeWith is it aware of other generators running, such that, the same generator won't be executed twice? So i have generator A, and generator B, and both call composeWith('Generator Z') with the same target output folder, it only runs Generator Z once?
mjfneto
@mjfneto
How does one get to use ES6 module import/export syntax with yeoman?
cristiano
@csalmeida

Hello all, I have started to use yeoman to generate a project and had little issues so far aside from testing. Writing tests is something I'm still learning about but the issue I'm having I just can't seem to make sense of a solution or find more relevant information online or on the docs, I wonder if someone could help me since I'm really curious to know what can be done to solve it and would be a great lesson for me.

How to test this generator properly

The generator makes one or more requests to download a few .zip files, extracts them and copies them to a directory. This can take a variable amount of time and when I write a test to assert file presence what ends up happening is that the assertions occur while the files are still being downloaded.

The code of my generator is open source and can be found here: https://github.com/csalmeida/generator-hozokit/blob/generate-hozokit/generators/app/index.js

This is the test I attempted to write (tried a few more things but all of them have similar results).

'use strict';
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');

describe('generator-hozokit:app', () => {
  beforeAll(() => {
    return helpers
      .run(path.join(__dirname, '../generators/app'))
      .withPrompts({ projectName: 'Hozokit Test', installWordpress: false })
      .then(function() {
        // Checks that Hozokit was successfully extracted and present.
        assert.file(['../hozokit-test/wp-content/themes/hozokit-test', '../hozokit-test/wp-content/themes/hozokit-test/index.php', '../hozokit-test/wp-content/themes/hozokit-test/templates/base.twig']);

        // Checks that Wordpres has not been installed.
        assert.noFile(['wp-login.php', 'index.php', 'wp-includes']);

        // Checks that no zip files remain on the system.
        assert.noFile(['*.zip',]);
      });
  });
});

It also seems that the examples in the docs are written in Mocha but the generator ships with Jest?

Any help from someone experienced in this would be deeply appreciated! 🙏

pjmattingly
@pjmattingly
Hi, I finally installed yeoman, but I get these warning / issues from the npm install:

npm install --global yo
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see axios/axios#3410

added 728 packages, and audited 729 packages in 35s

34 packages are looking for funding
run npm fund for details

4 high severity vulnerabilities

(Sorry about the formatting, I haven't done this before)
Is there a fix for addressing the depreciated packages? I don't want to use yeoman with those vulnerabilities.
Chris Granade
@cgranade
@pjmattingly Looking at axios/axios#3410, it seems like they only pushed the fix in v0.21.1 two days ago?
pjmattingly
@pjmattingly
@cgranade Hi Chris, thanks for responding. I'm glad to see they're working on a fix. Is there anything I can do in the mean-time to work with it, before the fix is published?
I want to be sure I'm doing my due diligence, since I'm working on a project for my University as a graduate project.
y-chen
@y-chen
Hello, is it possibile to wait for this.fs.copy to finish before running other code? I want to replace some placeholder in the files but they still don't exist when my code runs.