Skip to content
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

Upgrade JS package generator-grow to use Node.js v20 #111

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions packages/js/generator-grow/generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import Generator from 'yeoman-generator';
import path from 'node:path';

/**
* Internal dependencies
Expand All @@ -13,15 +14,18 @@ export default class GrowGenerator extends Generator {
usage() {
return 'yo grow[:app] [options]';
}
initializing() {
const packageRoot = this.sourceRoot() + '/../';
this.composeWith( {

async initializing() {
const packageRoot = path.resolve( this.sourceRoot(), '../..' );

await this.composeWith( {
Generator: GitHubGenerator,
path: packageRoot + '../github/index.js',
path: path.resolve( packageRoot, 'github/index.js' ),
} );
this.composeWith( {

await this.composeWith( {
Generator: DotFilesGenerator,
path: packageRoot + '../dotfiles/index.js',
path: path.resolve( packageRoot, 'dotfiles/index.js' ),
} );
}
}
6 changes: 3 additions & 3 deletions packages/js/generator-grow/generators/github/github.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* External dependencies
*/
import { default as path, dirname } from 'path';
import { fileURLToPath } from 'url';
import { default as path, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import assert from 'yeoman-assert';
import helpers from 'yeoman-test';

Expand Down Expand Up @@ -39,7 +39,7 @@ describe( ':github', function () {
it( 'Should use (package.json).title as the project title in CONTRIBUTING.md', async function () {
await helpers
.run( githubPath )
.on( 'ready', function ( generator ) {
.onGenerator( function ( generator ) {
generator.fs.write(
'package.json',
'{ "title": "Package Title" }'
Expand Down
28 changes: 0 additions & 28 deletions packages/js/generator-grow/generators/github/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/js/generator-grow/generators/phpcs/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import path from 'path';
import path from 'node:path';
import Generator from 'yeoman-generator';

export default class PhpcsGenerator extends Generator {
Expand Down
Loading
Loading