Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nestjs/nest-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 10.3.2
Choose a base ref
...
head repository: nestjs/nest-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d37735f7f5a0ddd01d81b87af4278af8c78bae5b
Choose a head ref

Commits on Feb 9, 2024

  1. Copy the full SHA
    9f1715e View commit details

Commits on Feb 13, 2024

  1. Copy the full SHA
    fd678fb View commit details
  2. Copy the full SHA
    8320db1 View commit details
  3. Copy the full SHA
    faa36bc View commit details

Commits on Feb 14, 2024

  1. Copy the full SHA
    eee2d26 View commit details

Commits on Feb 15, 2024

  1. Copy the full SHA
    fd81264 View commit details
  2. Copy the full SHA
    875e082 View commit details
  3. Copy the full SHA
    83543a7 View commit details

Commits on Feb 18, 2024

  1. Copy the full SHA
    df3486f View commit details

Commits on Feb 19, 2024

  1. Copy the full SHA
    1a29c0d View commit details
  2. Copy the full SHA
    6dca186 View commit details
  3. Copy the full SHA
    99a4f0b View commit details

Commits on Feb 23, 2024

  1. Copy the full SHA
    aca4ad2 View commit details

Commits on Mar 2, 2024

  1. Copy the full SHA
    89bb1bf View commit details
  2. Copy the full SHA
    ba09b98 View commit details
  3. Copy the full SHA
    b909249 View commit details
  4. Copy the full SHA
    b9bf65a View commit details
  5. Copy the full SHA
    ef4001c View commit details

Commits on Mar 4, 2024

  1. Copy the full SHA
    bfc5e36 View commit details

Commits on Mar 5, 2024

  1. Copy the full SHA
    1766db6 View commit details

Commits on Mar 6, 2024

  1. Copy the full SHA
    adb8db4 View commit details
  2. Copy the full SHA
    393b85e View commit details

Commits on Mar 8, 2024

  1. Copy the full SHA
    2af3018 View commit details

Commits on Mar 11, 2024

  1. Copy the full SHA
    458db84 View commit details

Commits on Mar 12, 2024

  1. Copy the full SHA
    3d25b95 View commit details
  2. Copy the full SHA
    f1184e7 View commit details

Commits on Mar 13, 2024

  1. Copy the full SHA
    b6014a8 View commit details
  2. Copy the full SHA
    08cf5ea View commit details

Commits on Mar 14, 2024

  1. Copy the full SHA
    704cf1d View commit details

Commits on Mar 15, 2024

  1. Copy the full SHA
    0b4d12e View commit details
  2. Copy the full SHA
    66133f8 View commit details

Commits on Mar 18, 2024

  1. Copy the full SHA
    aa29686 View commit details

Commits on Mar 19, 2024

  1. refactor: fix typo

    apeltop committed Mar 19, 2024
    Copy the full SHA
    a1ef593 View commit details
  2. Copy the full SHA
    5a9f9c5 View commit details
  3. Copy the full SHA
    d6587f1 View commit details
  4. Merge pull request #2549 from apeltop/fix-typo

    refactor: fix typo
    kamilmysliwiec authored Mar 19, 2024
    Copy the full SHA
    217d9e4 View commit details
  5. Copy the full SHA
    185169a View commit details

Commits on Mar 24, 2024

  1. fix(assets): Fix assets copying on Windows

    Fix issue where Nest CLI fails to copy assets files on Windows due to path format
    CustomEntity committed Mar 24, 2024
    Copy the full SHA
    2421a59 View commit details
  2. fix(assets): Refactor

    Refactoring few mistakes
    CustomEntity committed Mar 24, 2024
    Copy the full SHA
    68508b2 View commit details

Commits on Mar 25, 2024

  1. Copy the full SHA
    79dc187 View commit details

Commits on Mar 26, 2024

  1. Copy the full SHA
    e5d6019 View commit details

Commits on Mar 29, 2024

  1. Copy the full SHA
    589ef7f View commit details

Commits on Mar 30, 2024

  1. Copy the full SHA
    0369b15 View commit details

Commits on Apr 1, 2024

  1. Copy the full SHA
    ed65bdb View commit details
  2. Copy the full SHA
    58cb0ac View commit details

Commits on Apr 2, 2024

  1. Copy the full SHA
    910d033 View commit details

Commits on Apr 3, 2024

  1. Copy the full SHA
    d99f01b View commit details

Commits on Apr 4, 2024

  1. Copy the full SHA
    3d6a3b0 View commit details
  2. Copy the full SHA
    67a6fa1 View commit details

Commits on Apr 6, 2024

  1. Copy the full SHA
    0b661a0 View commit details
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:
build:
working_directory: ~/nest
docker:
- image: cimg/node:21.6
- image: cimg/node:22.3
steps:
- checkout
- run:
@@ -43,7 +43,7 @@ jobs:
unit_tests:
working_directory: ~/nest
docker:
- image: cimg/node:21.6
- image: cimg/node:22.3
steps:
- checkout
- *restore-cache
9 changes: 2 additions & 7 deletions actions/build.action.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import { getWebpackConfigPath } from '../lib/compiler/helpers/get-webpack-config
import { TsConfigProvider } from '../lib/compiler/helpers/tsconfig-provider';
import { PluginsLoader } from '../lib/compiler/plugins/plugins-loader';
import { TypeScriptBinaryLoader } from '../lib/compiler/typescript-loader';
import { WorkspaceUtils } from '../lib/compiler/workspace-utils';
import { deleteOutDirIfEnabled } from '../lib/compiler/helpers/delete-out-dir';
import {
Configuration,
ConfigurationLoader,
@@ -34,7 +34,6 @@ export class BuildAction extends AbstractAction {
this.fileSystemReader,
);
protected readonly assetsManager = new AssetsManager();
protected readonly workspaceUtils = new WorkspaceUtils();

public async handle(commandInputs: Input[], commandOptions: Input[]) {
try {
@@ -101,11 +100,7 @@ export class BuildAction extends AbstractAction {
? { type: 'webpack' }
: getBuilder(configuration, commandOptions, appName);

await this.workspaceUtils.deleteOutDirIfEnabled(
configuration,
appName,
outDir,
);
await deleteOutDirIfEnabled(configuration, appName, outDir);
this.assetsManager.copyAssets(
configuration,
appName,
31 changes: 15 additions & 16 deletions lib/compiler/assets-manager.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as chokidar from 'chokidar';
import { statSync } from 'fs';
import { copyFileSync, mkdirSync, rmSync, statSync } from 'fs';
import { sync } from 'glob';
import { dirname, join, sep } from 'path';
import * as shell from 'shelljs';
import {
ActionOnFile,
Asset,
@@ -60,18 +59,18 @@ export class AssetsManager {
sourceRoot = join(process.cwd(), sourceRoot);

const filesToCopy = assets.map<AssetEntry>((item) => {
if (typeof item === 'string') {
return {
glob: join(sourceRoot, item),
outDir,
};
}
let includePath = typeof item === 'string' ? item : item.include!;
let excludePath = typeof item !== 'string' && item.exclude ? item.exclude : undefined;

includePath = join(sourceRoot, includePath).replace(/\\/g, '/');
excludePath = excludePath ? join(sourceRoot, excludePath).replace(/\\/g, '/') : undefined;

return {
outDir: item.outDir || outDir,
glob: join(sourceRoot, item.include!),
exclude: item.exclude ? join(sourceRoot, item.exclude) : undefined,
flat: item.flat, // deprecated field
watchAssets: item.watchAssets,
outDir: typeof item !== 'string' ? item.outDir || outDir : outDir,
glob: includePath,
exclude: excludePath,
flat: typeof item !== 'string' ? item.flat : undefined, // deprecated field
watchAssets: typeof item !== 'string' ? item.watchAssets : undefined,
};
});

@@ -137,11 +136,11 @@ export class AssetsManager {

// Copy to output dir if file is changed or added
if (action === 'change') {
shell.mkdir('-p', dirname(dest));
shell.cp(path, dest);
mkdirSync(dirname(dest), { recursive: true });
copyFileSync(path, dest);
} else if (action === 'unlink') {
// Remove from output dir if file is deleted
shell.rm(dest);
rmSync(dest, { force: true });
}
}
}
19 changes: 19 additions & 0 deletions lib/compiler/helpers/delete-out-dir.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { rm } from 'fs/promises';
import { Configuration } from '../../configuration';
import { getValueOrDefault } from './get-value-or-default';

export async function deleteOutDirIfEnabled(
configuration: Required<Configuration>,
appName: string,
dirPath: string,
) {
const isDeleteEnabled = getValueOrDefault<boolean>(
configuration,
'compilerOptions.deleteOutDir',
appName,
);
if (!isDeleteEnabled) {
return;
}
await rm(dirPath, { recursive: true, force: true });
}
21 changes: 0 additions & 21 deletions lib/compiler/workspace-utils.ts

This file was deleted.

8 changes: 4 additions & 4 deletions lib/configuration/nest-configuration.loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reader, ReaderFileLackPersmissionsError } from '../readers';
import { Reader, ReaderFileLackPermissionsError } from '../readers';
import { Configuration } from './configuration';
import { ConfigurationLoader } from './configuration.loader';
import { defaultConfiguration } from './defaults';
@@ -33,9 +33,9 @@ export class NestConfigurationLoader implements ConfigurationLoader {
]);

if (contentOrError) {
const isMissingPersmissionsError =
contentOrError instanceof ReaderFileLackPersmissionsError;
if (isMissingPersmissionsError) {
const isMissingPermissionsError =
contentOrError instanceof ReaderFileLackPermissionsError;
if (isMissingPermissionsError) {
console.error(contentOrError.message);
process.exit(1);
}
6 changes: 3 additions & 3 deletions lib/readers/file-system.reader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as path from 'path';
import { Reader, ReaderFileLackPersmissionsError } from './reader';
import { Reader, ReaderFileLackPermissionsError } from './reader';

export class FileSystemReader implements Reader {
constructor(private readonly directory: string) {}
@@ -15,7 +15,7 @@ export class FileSystemReader implements Reader {

public readAnyOf(
filenames: string[],
): string | undefined | ReaderFileLackPersmissionsError {
): string | undefined | ReaderFileLackPermissionsError {
let firstFilePathFoundButWithInsufficientPermissions: string | undefined;

for (let id = 0; id < filenames.length; id++) {
@@ -41,7 +41,7 @@ export class FileSystemReader implements Reader {
}

if (firstFilePathFoundButWithInsufficientPermissions) {
return new ReaderFileLackPersmissionsError(
return new ReaderFileLackPermissionsError(
firstFilePathFoundButWithInsufficientPermissions,
readErr.code,
);
4 changes: 2 additions & 2 deletions lib/readers/reader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class ReaderFileLackPersmissionsError extends Error {
export class ReaderFileLackPermissionsError extends Error {
constructor(
public readonly filePath: string,
public readonly fsErrorCode: string,
@@ -12,5 +12,5 @@ export interface Reader {
read(name: string): string;
readAnyOf(
filenames: string[],
): string | undefined | ReaderFileLackPersmissionsError;
): string | undefined | ReaderFileLackPermissionsError;
}
Loading