Socket
Socket
Sign inDemoInstall

@nx/workspace

Package Overview
Dependencies
154
Maintainers
0
Versions
452
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-pr-22179-271588f to 0.0.0-pr-22870-07f19ed

src/generators/new/files-package-based-repo/packages/__dot__gitkeep

31

migrations.json
{
"generators": {
"15-7-0-split-configuration-into-project-json-files": {
"version": "15.7.0-beta.0",
"description": "Split global configuration files (e.g., workspace.json) into individual project.json files.",
"cli": "nx",
"implementation": "./src/migrations/update-15-7-0/split-configuration-into-project-json-files"
},
"update-16-0-0-add-nx-packages": {

@@ -29,14 +23,2 @@ "cli": "nx",

"packageJsonUpdates": {
"15.8.0": {
"version": "15.8.0-beta.2",
"x-prompt": "Do you want to update to TypeScript v4.9?",
"requires": {
"typescript": ">=4.8.2 <4.9.0"
},
"packages": {
"typescript": {
"version": "~4.9.5"
}
}
},
"16.1.0": {

@@ -89,4 +71,17 @@ "version": "16.1.0-beta.0",

}
},
"18.2.0": {
"version": "18.2.0-beta.0",
"x-prompt": "Do you want to update to TypeScript v5.4?",
"requires": {
"typescript": ">=5.3.0 <5.4.0"
},
"packages": {
"typescript": {
"version": "~5.4.2",
"alwaysAddToPackageJson": false
}
}
}
}
}
{
"name": "@nx/workspace",
"version": "0.0.0-pr-22179-271588f",
"version": "0.0.0-pr-22870-07f19ed",
"private": false,

@@ -22,3 +22,3 @@ "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",

],
"main": "./index.js",
"main": "./index",
"typings": "./index.d.ts",

@@ -65,3 +65,3 @@ "author": "Victor Savkin",

"dependencies": {
"@nx/devkit": "0.0.0-pr-22179-271588f",
"@nx/devkit": "0.0.0-pr-22870-07f19ed",
"chalk": "^4.1.0",

@@ -71,4 +71,4 @@ "enquirer": "~2.3.6",

"yargs-parser": "21.1.1",
"nx": "0.0.0-pr-22179-271588f",
"@nrwl/workspace": "0.0.0-pr-22179-271588f"
"nx": "0.0.0-pr-22870-07f19ed",
"@nrwl/workspace": "0.0.0-pr-22870-07f19ed"
},

@@ -75,0 +75,0 @@ "publishConfig": {

@@ -11,7 +11,2 @@ "use strict";

const nxJson = (0, devkit_1.readJson)(tree, 'nx.json');
const nxCloudUsed = nxJson.nxCloudAccessToken ??
Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');
if (!nxCloudUsed) {
throw new Error('This workspace is not connected to Nx Cloud.');
}
if (ci === 'bitbucket-pipelines' && defaultBranchNeedsOriginPrefix(nxJson)) {

@@ -28,5 +23,9 @@ (0, devkit_1.writeJson)(tree, 'nx.json', appendOriginPrefix(nxJson));

const packageManager = (0, devkit_1.detectPackageManager)();
const { exec: packageManagerPrefix, ciInstall: packageManagerInstall } = (0, devkit_1.getPackageManagerCommand)(packageManager);
const nxCloudUrl = (0, nx_cloud_utils_1.getNxCloudUrl)((0, devkit_1.readJson)(tree, 'nx.json'));
const nxCloudHost = new URL(nxCloudUrl).host;
const { exec: packageManagerPrefix, ciInstall: packageManagerInstall, dlx: packageManagerPreInstallPrefix, } = (0, devkit_1.getPackageManagerCommand)(packageManager);
let nxCloudHost = 'nx.app';
try {
const nxCloudUrl = (0, nx_cloud_utils_1.getNxCloudUrl)((0, devkit_1.readJson)(tree, 'nx.json'));
nxCloudHost = new URL(nxCloudUrl).host;
}
catch { }
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');

@@ -44,2 +43,3 @@ const allDependencies = {

packageManagerPrefix,
packageManagerPreInstallPrefix,
mainBranch: (0, default_base_1.deduceDefaultBase)(),

@@ -46,0 +46,0 @@ hasE2E,

@@ -28,2 +28,14 @@ "use strict";

const libsDir = isRootProjectApp ? 'libs' : 'packages';
if (rootProject) {
// If project was created using `nx init` then it might not have project.json.
// Need to create one to avoid name conflicts with root package.json.
if (!tree.exists('project.json')) {
(0, devkit_1.writeJson)(tree, 'project.json', { name: rootProject.name });
}
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
// Avoid name conflicts once we move root project into its own folder.
json.name = `@${rootProject.name}/source`;
return json;
});
}
for (const project of projectsToMove) {

@@ -30,0 +42,0 @@ await (0, move_1.moveGenerator)(tree, {

@@ -18,6 +18,3 @@ "use strict";

'project.json',
'tsconfig.json',
'tsconfig.app.json',
'tsconfig.lib.json',
'tsconfig.spec.json',
/^tsconfig(?!\.base\.json$)((\..+)?\.json$|json$)/,
'.babelrc',

@@ -24,0 +21,0 @@ '.eslintrc.json',

@@ -136,3 +136,3 @@ "use strict";

devkit_1.logger.warn((0, devkit_1.stripIndents) `
In Nx 19, the project name and destination will no longer be derived.
In Nx 20, the project name and destination will no longer be derived.
Please provide the exact new project name and destination in the future.

@@ -139,0 +139,0 @@ Example: nx g ${callingGenerator} --projectName ${options.projectName} --destination ${formats['derived'].destination}` +

@@ -28,2 +28,3 @@ "use strict";

let secondaryEntryPointImportPaths;
let serverEntryPointImportPath;
if (tree.exists(tsConfigPath)) {

@@ -35,2 +36,7 @@ tsConfig = (0, devkit_1.readJson)(tree, tsConfigPath);

!x.startsWith(ensureTrailingSlash(sourceRoot))));
// Next.js libs have a custom path for the server we need to update that as well
// example "paths": { @acme/lib/server : ['libs/lib/src/server.ts'] }
serverEntryPointImportPath = Object.keys(tsConfig.compilerOptions?.paths ?? {}).find((path) => tsConfig.compilerOptions.paths[path].some((x) => x.startsWith(ensureTrailingSlash(sourceRoot)) &&
x.includes('server') &&
path.endsWith('server')));
}

@@ -53,2 +59,10 @@ mainEntryPointImportPath ??= (0, utils_1.normalizePathSlashes)((0, get_import_path_1.getImportPath)(tree, project.root.slice(libsDir.length).replace(/^\/|\\/, '')));

];
if (serverEntryPointImportPath &&
schema.importPath &&
serverEntryPointImportPath.startsWith(mainEntryPointImportPath)) {
projectRefs.push({
from: serverEntryPointImportPath,
to: serverEntryPointImportPath.replace(mainEntryPointImportPath, schema.importPath),
});
}
for (const projectRef of projectRefs) {

@@ -130,3 +144,3 @@ if (schema.updateImportPath && projectRef.to) {

for (const { moduleSpecifier } of importDecls) {
if (tsModule.isStringLiteral(moduleSpecifier)) {
if (moduleSpecifier && tsModule.isStringLiteral(moduleSpecifier)) {
changes.push(...updateModuleSpecifier(moduleSpecifier, from, to));

@@ -133,0 +147,0 @@ }

@@ -101,2 +101,5 @@ "use strict";

return { dependencies: { '@nx/next': versions_1.nxVersion }, dev: {} };
case presets_1.Preset.RemixStandalone:
case presets_1.Preset.RemixMonorepo:
return { dependencies: { '@nx/remix': versions_1.nxVersion }, dev: {} };
case presets_1.Preset.VueMonorepo:

@@ -103,0 +106,0 @@ case presets_1.Preset.VueStandalone:

@@ -85,2 +85,3 @@ "use strict";

options.preset === presets_1.Preset.NextJsStandalone ||
options.preset === presets_1.Preset.RemixStandalone ||
options.preset === presets_1.Preset.TsStandalone

@@ -87,0 +88,0 @@ ? './files-root-app'

@@ -74,3 +74,2 @@ "use strict";

};
normalized.name = (0, devkit_1.names)(options.name).fileName;
if (!options.directory) {

@@ -77,0 +76,0 @@ normalized.directory = normalized.name;

@@ -59,3 +59,3 @@ {

"type": "string",
"enum": ["npm", "yarn", "pnpm"]
"enum": ["npm", "yarn", "pnpm", "bun"]
},

@@ -80,3 +80,3 @@ "framework": {

"type": "string",
"enum": ["cypress", "playwright", "jest", "detox", "none"]
"enum": ["playwright", "cypress", "jest", "detox", "none"]
},

@@ -83,0 +83,0 @@ "ssr": {

@@ -8,3 +8,2 @@ "use strict";

async function presetGenerator(tree, options) {
options = normalizeOptions(options);
const presetTask = await createPreset(tree, options);

@@ -20,8 +19,5 @@ return async () => {

async function createPreset(tree, options) {
console.log('Crate preset');
const nxJson = (0, devkit_1.readNxJson)(tree);
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
nxJson.useInferencePlugins !== false;
console.log('Add plugin', addPlugin);
console.log(options.preset, presets_1.Preset.ReactNative);
if (options.preset === presets_1.Preset.Apps) {

@@ -40,3 +36,3 @@ return;

routing: options.routing,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
bundler: options.bundler,

@@ -58,3 +54,3 @@ ssr: options.ssr,

standalone: options.standaloneApi,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
bundler: options.bundler,

@@ -75,3 +71,3 @@ ssr: options.ssr,

bundler: options.bundler ?? 'webpack',
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
addPlugin,

@@ -91,3 +87,3 @@ });

bundler: options.bundler ?? 'vite',
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
unitTestRunner: options.bundler === 'vite' ? 'vitest' : 'jest',

@@ -97,2 +93,29 @@ addPlugin,

}
else if (options.preset === presets_1.Preset.RemixMonorepo) {
const { applicationGenerator: remixApplicationGenerator } = require('@nx' +
'/remix/generators');
return remixApplicationGenerator(tree, {
name: options.name,
directory: (0, path_1.join)('apps', options.name),
projectNameAndRootFormat: 'as-provided',
linter: options.linter,
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
unitTestRunner: 'vitest',
addPlugin,
});
}
else if (options.preset === presets_1.Preset.RemixStandalone) {
const { applicationGenerator: remixApplicationGenerator } = require('@nx' +
'/remix/generators');
return remixApplicationGenerator(tree, {
name: options.name,
directory: '.',
projectNameAndRootFormat: 'as-provided',
linter: options.linter,
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
rootProject: true,
unitTestRunner: 'vitest',
addPlugin,
});
}
else if (options.preset === presets_1.Preset.VueMonorepo) {

@@ -107,3 +130,3 @@ const { applicationGenerator: vueApplicationGenerator } = require('@nx' +

linter: options.linter,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
addPlugin,

@@ -122,3 +145,3 @@ });

rootProject: true,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
unitTestRunner: 'vitest',

@@ -137,3 +160,3 @@ addPlugin,

linter: options.linter,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
addPlugin,

@@ -152,3 +175,3 @@ });

rootProject: true,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
unitTestRunner: 'vitest',

@@ -169,3 +192,3 @@ addPlugin,

src: options.nextSrcDir,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
addPlugin,

@@ -185,3 +208,3 @@ });

src: options.nextSrcDir,
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
rootProject: true,

@@ -201,3 +224,3 @@ addPlugin,

bundler: 'vite',
e2eTestRunner: options.e2eTestRunner ?? 'cypress',
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
addPlugin,

@@ -230,7 +253,4 @@ });

else if (options.preset === presets_1.Preset.ReactNative) {
console.log('Before require');
const { reactNativeApplicationGenerator } = require('@nx' +
'/react-native');
console.log('Hello', reactNativeApplicationGenerator);
console.log('Active require');
return reactNativeApplicationGenerator(tree, {

@@ -313,5 +333,1 @@ name: options.name,

}
function normalizeOptions(options) {
options.name = (0, devkit_1.names)(options.name).fileName;
return options;
}

@@ -65,3 +65,3 @@ {

"type": "string",
"enum": ["npm", "yarn", "pnpm"]
"enum": ["npm", "yarn", "pnpm", "bun"]
},

@@ -97,3 +97,3 @@ "framework": {

"type": "string",
"enum": ["cypress", "playwright", "jest", "detox", "none"]
"enum": ["playwright", "cypress", "jest", "detox", "none"]
},

@@ -100,0 +100,0 @@ "ssr": {

@@ -41,3 +41,4 @@ "use strict";

const rootConfigPath = (0, jest_config_1.findRootJestConfig)(tree);
if (!tree.exists(rootConfigPath) ||
if (!rootConfigPath ||
!tree.exists(rootConfigPath) ||
!tree.exists((0, path_1.join)(projectConfig.root, 'jest.config.ts')) ||

@@ -44,0 +45,0 @@ isUsingUtilityFunction(tree) ||

export declare enum Preset {
Apps = "apps",
/** @deprecated Use Apps instead
*/
Empty = "empty",
/** @deprecated Use NPM instead
*/
Core = "core",
NPM = "npm",

@@ -17,2 +11,4 @@ TS = "ts",

NextJsStandalone = "nextjs-standalone",
RemixMonorepo = "remix-monorepo",
RemixStandalone = "remix-standalone",
ReactNative = "react-native",

@@ -19,0 +15,0 @@ VueMonorepo = "vue-monorepo",

@@ -7,9 +7,2 @@ "use strict";

Preset["Apps"] = "apps";
// TODO(v19): Remove Empty and Core presets
/** @deprecated Use Apps instead
*/
Preset["Empty"] = "empty";
/** @deprecated Use NPM instead
*/
Preset["Core"] = "core";
Preset["NPM"] = "npm";

@@ -23,2 +16,4 @@ Preset["TS"] = "ts";

Preset["NextJsStandalone"] = "nextjs-standalone";
Preset["RemixMonorepo"] = "remix-monorepo";
Preset["RemixStandalone"] = "remix-standalone";
Preset["ReactNative"] = "react-native";

@@ -25,0 +20,0 @@ Preset["VueMonorepo"] = "vue-monorepo";

export declare const nxVersion: any;
export declare const typescriptVersion = "~5.3.2";
export declare const angularCliVersion = "~17.2.0";
export declare const typescriptVersion = "~5.4.2";
export declare const angularCliVersion = "~18.0.0";

@@ -5,5 +5,5 @@ "use strict";

exports.nxVersion = require('../../package.json').version;
exports.typescriptVersion = '~5.3.2';
exports.typescriptVersion = '~5.4.2';
// TODO: remove when preset generation is reworked and
// deps are not installed from workspace
exports.angularCliVersion = '~17.2.0';
exports.angularCliVersion = '~18.0.0';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc