Skip to content

Commit

Permalink
Merge pull request #24549 from mshima/rename-js
Browse files Browse the repository at this point in the history
[internal] normalize extensions to js/ts
  • Loading branch information
DanielFran authored Dec 12, 2023
2 parents 02e0986 + 3bb16bf commit 9eb9eea
Show file tree
Hide file tree
Showing 1,165 changed files with 57,111 additions and 57,123 deletions.
2 changes: 1 addition & 1 deletion .blueprint/code-workspace/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type JHipsterCommandDefinition } from '../../generators/base/api.mjs';
import { type JHipsterCommandDefinition } from '../../generators/base/api.js';

const command: JHipsterCommandDefinition = {
arguments: {},
Expand Down
4 changes: 2 additions & 2 deletions .blueprint/code-workspace/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from 'path';
import * as _ from 'lodash-es';
import BaseGenerator from '../../generators/base/index.mjs';
import { getPackageRoot } from '../../lib/index.mjs';
import BaseGenerator from '../../generators/base/index.js';
import { getPackageRoot } from '../../lib/index.js';
import command from './command.mjs';
import { defaultSamplesFolder, promptSamplesFolder, samplesFolderConfig } from '../support.mjs';

Expand Down
2 changes: 1 addition & 1 deletion .blueprint/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'path';
import { getPackageRoot } from '../lib/index.mjs';
import { getPackageRoot } from '../lib/index.js';

const packageRoot = getPackageRoot();
export const defaultSamplesFolder = join(packageRoot, '../jhipster-samples');
Expand Down
4 changes: 2 additions & 2 deletions .blueprint/from-issue/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JHipsterCommandDefinition } from '../../generators/base/api.mjs';
import { GENERATOR_APP, GENERATOR_WORKSPACES } from '../../generators/generator-list.mjs';
import { JHipsterCommandDefinition } from '../../generators/base/api.js';
import { GENERATOR_APP, GENERATOR_WORKSPACES } from '../../generators/generator-list.js';

const command: JHipsterCommandDefinition = {
arguments: {
Expand Down
6 changes: 3 additions & 3 deletions .blueprint/from-issue/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Octokit } from 'octokit';
import { setOutput } from '@actions/core';
import BaseGenerator from '../../generators/base/index.mjs';
import BaseGenerator from '../../generators/base/index.js';
import command from './command.mjs';
import { promptSamplesFolder } from '../support.mjs';
import { join } from 'path';
import { GENERATOR_APP, GENERATOR_JDL } from '../../generators/generator-list.mjs';
import { GENERATOR_JHIPSTER } from '../../generators/generator-constants.mjs';
import { GENERATOR_APP, GENERATOR_JDL } from '../../generators/generator-list.js';
import { GENERATOR_JHIPSTER } from '../../generators/generator-constants.js';
import { CLI_NAME } from '../../cli/utils.mjs';
import EnvironmentBuilder from '../../cli/environment-builder.mjs';

Expand Down
4 changes: 2 additions & 2 deletions .blueprint/generate-sample/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JHipsterCommandDefinition } from '../../generators/base/api.mjs';
import { GENERATOR_APP, GENERATOR_WORKSPACES } from '../../generators/generator-list.mjs';
import { JHipsterCommandDefinition } from '../../generators/base/api.js';
import { GENERATOR_APP, GENERATOR_WORKSPACES } from '../../generators/generator-list.js';

const command: JHipsterCommandDefinition = {
arguments: {
Expand Down
4 changes: 2 additions & 2 deletions .blueprint/generate-sample/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { extname } from 'path';
import { transform } from '@yeoman/transform';
import BaseGenerator from '../../generators/base/index.mjs';
import BaseGenerator from '../../generators/base/index.js';
import command from './command.mjs';
import { generateSample } from './support/generate-sample.js';
import { promptSamplesFolder } from '../support.mjs';
import { GENERATOR_APP, GENERATOR_JDL } from '../../generators/generator-list.mjs';
import { GENERATOR_APP, GENERATOR_JDL } from '../../generators/generator-list.js';

export default class extends BaseGenerator {
sampleName;
Expand Down
2 changes: 1 addition & 1 deletion .blueprint/support.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CoreGenerator from '../generators/base-core/index.mjs';
import CoreGenerator from '../generators/base-core/index.js';
import { defaultSamplesFolder } from './constants.js';

export const samplesFolderConfig = 'samplesFolder';
Expand Down
2 changes: 1 addition & 1 deletion .blueprint/update-vscode/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type JHipsterCommandDefinition } from '../../generators/base/api.mjs';
import { type JHipsterCommandDefinition } from '../../generators/base/api.js';

const command: JHipsterCommandDefinition = {
arguments: {},
Expand Down
4 changes: 2 additions & 2 deletions .blueprint/update-vscode/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from 'path';
import BaseGenerator from '../../generators/base/index.mjs';
import { getPackageRoot } from '../../lib/index.mjs';
import BaseGenerator from '../../generators/base/index.js';
import { getPackageRoot } from '../../lib/index.js';
import command from './command.mjs';
import { getWorkflowSamples } from '../generate-sample/support/get-workflow-samples.js';

Expand Down
7 changes: 1 addition & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-this-alias": "off"
}
},
{
"files": ["**/*.mjs"],
"rules": {
"@typescript-eslint/no-this-alias": "off",
"import/no-unresolved": "off"
}
},
Expand Down
4 changes: 2 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Internally, JHipster uses [Yeoman](https://yeoman.io) as the core. JHipster is t
## Lifecycle

- [CLI entry point](https://github.com/jhipster/generator-jhipster/blob/main/cli/jhipster.cjs)
- [Basic environment validation](https://github.com/jhipster/generator-jhipster/blob/main/cli/cli.mjs)
- [Cli arguments parsing and Environment bootstrap](https://github.com/jhipster/generator-jhipster/blob/main/cli/program.mjs)
- [Basic environment validation](https://github.com/jhipster/generator-jhipster/blob/main/cli/cli.js)
- [Cli arguments parsing and Environment bootstrap](https://github.com/jhipster/generator-jhipster/blob/main/cli/program.js)
- Lookup for generators and blueprints
- Build CLI options and arguments definition
- Parse options and arguments
Expand Down
2 changes: 1 addition & 1 deletion cli/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { existsSync } from 'fs';
import semver from 'semver';
import chalk from 'chalk';

import { packageJson } from '../lib/index.mjs';
import { packageJson } from '../lib/index.js';
import { runJHipster } from './program.mjs';
import { done, logger } from './utils.mjs';

Expand Down
4 changes: 2 additions & 2 deletions cli/cli.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect, mock, resetAllMocks, fn } from 'esmocha';
import { execaCommandSync } from 'execa';
import { BaseEnvironment } from '@yeoman/types';
import { coerce } from 'semver';
import { defaultHelpers as helpers, createBlueprintFiles } from '../test/support/index.mjs';
import { defaultHelpers as helpers, createBlueprintFiles } from '../test/support/index.js';

import { getCommand as actualGetCommonand } from './utils.mjs';
import { createProgram } from './program.mjs';
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('cli', () => {
beforeEach(async () => {
getCommand.mockImplementation(actualGetCommonand);

const BaseGenerator = (await import('../generators/base/index.mjs')).default;
const BaseGenerator = (await import('../generators/base/index.js')).default;
env = await helpers.createTestEnv();
generator = new (helpers.createDummyGenerator(BaseGenerator))({ env, sharedData: {} });
generator._options = {
Expand Down
2 changes: 1 addition & 1 deletion cli/download.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import path from 'path';
import { inspect } from 'util';

import { logger } from './utils.mjs';
import { packageJson } from '../lib/index.mjs';
import { packageJson } from '../lib/index.js';

const downloadFile = (url: string, filename: string): Promise<string> => {
return new Promise((resolve, reject) => {
Expand Down
4 changes: 2 additions & 2 deletions cli/environment-builder.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import Environment from 'yeoman-environment';
import { QueuedAdapter } from '@yeoman/adapter';

import { CLI_NAME, logger } from './utils.mjs';
import { createJHipsterLogger, packageNameToNamespace } from '../generators/base/support/index.mjs';
import { parseBlueprintInfo, loadBlueprintsFromConfiguration, mergeBlueprints } from '../generators/base/internal/index.mjs';
import { createJHipsterLogger, packageNameToNamespace } from '../generators/base/support/index.js';
import { parseBlueprintInfo, loadBlueprintsFromConfiguration, mergeBlueprints } from '../generators/base/internal/index.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
2 changes: 1 addition & 1 deletion cli/environment-builder.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import fs from 'fs';
import { expect } from 'chai';
import sinon from 'sinon';
import { jestExpect } from 'esmocha';
import { defaultHelpers as helpers, createBlueprintFiles } from '../test/support/index.mjs';
import { defaultHelpers as helpers, createBlueprintFiles } from '../test/support/index.js';

import EnvironmentBuilder from './environment-builder.mjs';

Expand Down
2 changes: 1 addition & 1 deletion cli/jhipster-command.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import chalk from 'chalk';
import { Command, Option } from 'commander';
import lodash from 'lodash';
import { convertConfigToOption } from '../lib/internal/index.mjs';
import { convertConfigToOption } from '../lib/internal/index.js';

const { kebabCase } = lodash;

Expand Down
2 changes: 1 addition & 1 deletion cli/logo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/
import chalk from 'chalk';
import { packageJson } from '../lib/index.mjs';
import { packageJson } from '../lib/index.js';

export default `${chalk.green(' ██╗')}${chalk.red(' ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗')}
${chalk.green(' ██║')}${chalk.red(' ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗')}
Expand Down
6 changes: 3 additions & 3 deletions cli/program.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import EnvironmentBuilder from './environment-builder.mjs';
import SUB_GENERATORS from './commands.mjs';
import JHipsterCommand from './jhipster-command.mjs';
import { CLI_NAME, logger, getCommand, done } from './utils.mjs';
import { packageJson } from '../lib/index.mjs';
import { packageNameToNamespace } from '../generators/base/support/index.mjs';
import command from '../generators/base/command.mjs';
import { packageJson } from '../lib/index.js';
import { packageNameToNamespace } from '../generators/base/support/index.js';
import command from '../generators/base/command.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
2 changes: 1 addition & 1 deletion cli/program.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { expect } from 'chai';

import { createProgram } from './program.mjs';
import { defaultHelpers as helpers } from '../test/support/index.mjs';
import { defaultHelpers as helpers } from '../test/support/index.js';

describe('cli - program', () => {
beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion cli/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* eslint-disable no-console */
import chalk from 'chalk';

import { createJHipsterLogger, CLI_LOGGER } from '../generators/base/support/index.mjs';
import { createJHipsterLogger, CLI_LOGGER } from '../generators/base/support/index.js';

export const CLI_NAME = 'jhipster';
export const GENERATOR_NAME = 'generator-jhipster';
Expand Down
Loading

0 comments on commit 9eb9eea

Please sign in to comment.