Skip to content
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monux-cli",
"version": "2.0.8",
"version": "2.0.9",
"license": "MIT",
"main": "index.js",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions src/commands/add/add-wordpress/add-wordpress.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class AddWordpressCommand extends AddCommand<AddWordpressConfiguration> {

override async run(): Promise<void> {
const config: AddWordpressConfiguration = await this.getConfig();
// TODO: make calculated variables based on subDomain and port.
await EnvUtilities.addStaticVariable({
key: DefaultEnvKeys.domain(config.name),
required: true,
Expand Down
5 changes: 3 additions & 2 deletions src/commands/init/init.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ async function createCspellWords(): Promise<void> {
*/
async function createEslintConfig(): Promise<void> {
await FsUtilities.createFile(ESLINT_CONFIG_FILE_NAME, [
'import { configs } from \'eslint-config-service-soft\';',
`import { configs } from '${NpmPackage.ESLINT_CONFIG_SERVICE_SOFT}';`,
'',
'// eslint-disable-next-line jsdoc/require-description',
'/** @type {import(\'eslint\').Linter.Config} */',
'export default [...config];'
'export default [...configs];'
]);
}

Expand Down
1 change: 1 addition & 0 deletions src/commands/run/run.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export async function runRun(...args: string[]): Promise<void> {
const commands: string = args.slice(1).join(' ');
if (!nativeCommand) {
await NpmUtilities.run(projectName, commands);
return;
}

const project: WorkspaceProject = await WorkspaceUtilities.findProjectOrFail(projectName);
Expand Down
2 changes: 2 additions & 0 deletions src/db/db.utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export abstract class DbUtilities {
required: true,
type: 'string'
});
// TODO: make calculated variable either "localhost" for dev or "serviceName" for local/prod.
await EnvUtilities.addStaticVariable({
key: HOST_ENV_VARIABLE,
value: 'localhost',
Expand Down Expand Up @@ -367,6 +368,7 @@ export abstract class DbUtilities {
required: true,
type: 'string'
});
// TODO: make calculated variable either "localhost" for dev or "serviceName" for local/prod.
await EnvUtilities.addStaticVariable({
key: HOST_ENV_VARIABLE,
value: 'localhost',
Expand Down
1 change: 1 addition & 0 deletions src/env/env-utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ describe('EnvUtilities', () => {

const environmentLines: string[] = await FsUtilities.readFileLines(mockConstants.ANGULAR_ENVIRONMENT);
expect(environmentLines).toEqual([
'/* eslint-disable cspell/spellchecker */',
'import { Environment } from \'./environment.model\';',
'',
'export const environment: Environment = {',
Expand Down
3 changes: 2 additions & 1 deletion src/env/env.utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export abstract class EnvUtilities {
*/
static async setupProjectEnvironment(projectPath: string, disableCommentRule: boolean): Promise<void> {
await FsUtilities.createFile(
getPath(projectPath, 'src', 'environment', 'environment.model.ts'),
getPath(projectPath, 'src', 'environment', ENVIRONMENT_MODEL_TS_FILE_NAME),
[
// eslint-disable-next-line stylistic/max-len
(disableCommentRule ? '/* eslint-disable jsdoc/require-jsdoc */\n' : '') + 'import { GlobalEnvironment } from \'../../../../global-environment.model\';',
Expand Down Expand Up @@ -181,6 +181,7 @@ export abstract class EnvUtilities {
await FsUtilities.createFile(
getPath(projectPath, 'src', 'environment', ENVIRONMENT_TS_FILE_NAME),
[
'/* eslint-disable cspell/spellchecker */',
'import { Environment } from \'./environment.model\';',
'',
`export const environment: Environment = {${variables.map(v => this.stringifyEnvKeyValue(v)).join(',')}\n};`
Expand Down
4 changes: 3 additions & 1 deletion src/eslint/eslint-utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ describe('EslintUtilities', () => {
await EslintUtilities.setupProjectEslint(mockConstants.ANGULAR_APP_DIR, true);
const lines: string[] = await FsUtilities.readFileLines(mockConstants.ANGULAR_ESLINT_CONFIG_MJS);
expect(lines).toEqual([
'import { cspellOptions } from \'eslint-config-service-soft\';',
'import baseConfig from \'../../eslint.config.mjs\';',
'',
'// eslint-disable-next-line jsdoc/require-description',
'/** @type {import(\'eslint\').Linter.Config} */',
'export default [',
' ...baseConfig,',
Expand All @@ -31,12 +33,12 @@ describe('EslintUtilities', () => {
' }',
' },',
' {',
' files: [\'**/*.ts\', \'**/*.handlebars\', \'**/*.html\', \'**/*.js\', \'**/*.mjs\', \'**/*.cjs\', \'**/*.json\'],',
' rules: {',
' \'jsdoc/require-jsdoc\': \'off\',',
' \'cspell/spellchecker\': [',
' \'warn\',',
' {',
' ...cspellOptions,',
' customWordListFile: \'../../cspell.words.txt\'',
' }',
' ]',
Expand Down
6 changes: 4 additions & 2 deletions src/eslint/eslint.utilities.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { ESLINT_CONFIG_FILE_NAME, PACKAGE_JSON_FILE_NAME } from '../constants';
import { FsUtilities } from '../encapsulation';
import { NpmUtilities } from '../npm';
import { NpmPackage, NpmUtilities } from '../npm';
import { getPath } from '../utilities';

/**
Expand Down Expand Up @@ -32,8 +32,10 @@ export abstract class EslintUtilities {
await FsUtilities.createFile(
getPath(root, ESLINT_CONFIG_FILE_NAME),
[
`import { cspellOptions } from '${NpmPackage.ESLINT_CONFIG_SERVICE_SOFT}';`,
`import baseConfig from '${baseEslintConfigPath}';`,
'',
'// eslint-disable-next-line jsdoc/require-description',
'/** @type {import(\'eslint\').Linter.Config} */',
'export default [',
'\t...baseConfig,',
Expand All @@ -46,11 +48,11 @@ export abstract class EslintUtilities {
'\t\t}',
'\t},',
'\t{',
'\t\tfiles: [\'**/*.ts\', \'**/*.handlebars\', \'**/*.html\', \'**/*.js\', \'**/*.mjs\', \'**/*.cjs\', \'**/*.json\'],',
'\t\trules: {' + (disableCommentRule ? '\n\t\t\t\'jsdoc/require-jsdoc\': \'off\',' : ''),
'\t\t\t\'cspell/spellchecker\': [',
'\t\t\t\t\'warn\',',
'\t\t\t\t{',
'\t\t\t\t\t...cspellOptions,',
'\t\t\t\t\tcustomWordListFile: \'../../cspell.words.txt\'',
'\t\t\t\t}',
'\t\t\t]',
Expand Down