@nx/vite 17.2.0-beta.12 → 17.2.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vite",
|
|
3
|
-
"version": "17.2.0-beta.
|
|
3
|
+
"version": "17.2.0-beta.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for building and testing applications using Vite",
|
|
6
6
|
"repository": {
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"migrations": "./migrations.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nx/devkit": "17.2.0-beta.
|
|
32
|
+
"@nx/devkit": "17.2.0-beta.14",
|
|
33
33
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
34
34
|
"@swc/helpers": "~0.5.0",
|
|
35
35
|
"enquirer": "~2.3.6",
|
|
36
|
-
"@nx/js": "17.2.0-beta.
|
|
36
|
+
"@nx/js": "17.2.0-beta.14",
|
|
37
37
|
"tsconfig-paths": "^4.1.2",
|
|
38
|
-
"@nrwl/vite": "17.2.0-beta.
|
|
38
|
+
"@nrwl/vite": "17.2.0-beta.14"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"vite": "^5.0.0",
|
|
@@ -16,6 +16,7 @@ _export(exports, {
|
|
|
16
16
|
const _js = require("@nx/js");
|
|
17
17
|
const _path = require("path");
|
|
18
18
|
const _buildablelibsutils = require("@nx/js/src/utils/buildable-libs-utils");
|
|
19
|
+
const _optionsutils = require("./options-utils");
|
|
19
20
|
async function validateTypes(opts) {
|
|
20
21
|
const result = await (0, _js.runTypeCheck)({
|
|
21
22
|
workspaceRoot: opts.workspaceRoot,
|
|
@@ -29,15 +30,17 @@ async function validateTypes(opts) {
|
|
|
29
30
|
}
|
|
30
31
|
function createBuildableTsConfig(projectRoot, options, context) {
|
|
31
32
|
var _options, _buildLibsFromSource;
|
|
32
|
-
const tsConfig = (0,
|
|
33
|
+
const tsConfig = (0, _optionsutils.getProjectTsConfigPath)(projectRoot);
|
|
33
34
|
var _;
|
|
34
35
|
(_ = (_options = options)[_buildLibsFromSource = 'buildLibsFromSource']) != null ? _ : _options[_buildLibsFromSource] = true;
|
|
35
36
|
if (!options['buildLibsFromSource']) {
|
|
36
37
|
const { dependencies } = (0, _buildablelibsutils.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, // When using incremental building and the serve target is called
|
|
37
38
|
// we need to get the deps for the 'build' target instead.
|
|
38
39
|
context.targetName === 'serve' ? 'build' : context.targetName, context.configurationName);
|
|
39
|
-
//
|
|
40
|
-
|
|
40
|
+
// This tsconfig is used via the Vite ts paths plugin.
|
|
41
|
+
// It can be also used by other user-defined Vite plugins (e.g. for creating type declaration files).
|
|
42
|
+
const tmpTsConfigPath = (0, _buildablelibsutils.createTmpTsConfig)(tsConfig, context.root, projectRoot, dependencies);
|
|
43
|
+
process.env.NX_TSCONFIG_PATH = tmpTsConfigPath;
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/vite/src/utils/executor-utils.ts"],"sourcesContent":["import { printDiagnostics, runTypeCheck } from '@nx/js';\nimport { join
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/vite/src/utils/executor-utils.ts"],"sourcesContent":["import { printDiagnostics, runTypeCheck } from '@nx/js';\nimport { join } from 'path';\nimport { ViteBuildExecutorOptions } from '../executors/build/schema';\nimport { ExecutorContext } from '@nx/devkit';\nimport { ViteDevServerExecutorOptions } from '../executors/dev-server/schema';\nimport {\n calculateProjectBuildableDependencies,\n createTmpTsConfig,\n} from '@nx/js/src/utils/buildable-libs-utils';\nimport { getProjectTsConfigPath } from './options-utils';\n\nexport async function validateTypes(opts: {\n workspaceRoot: string;\n projectRoot: string;\n tsconfig: string;\n}): Promise<void> {\n const result = await runTypeCheck({\n workspaceRoot: opts.workspaceRoot,\n tsConfigPath: join(opts.workspaceRoot, opts.tsconfig),\n mode: 'noEmit',\n });\n\n await printDiagnostics(result.errors, result.warnings);\n\n if (result.errors.length > 0) {\n throw new Error('Found type errors. See above.');\n }\n}\n\nexport function createBuildableTsConfig(\n projectRoot: string,\n options: ViteBuildExecutorOptions | ViteDevServerExecutorOptions,\n context: ExecutorContext\n) {\n const tsConfig = getProjectTsConfigPath(projectRoot);\n options['buildLibsFromSource'] ??= true;\n\n if (!options['buildLibsFromSource']) {\n const { dependencies } = calculateProjectBuildableDependencies(\n context.taskGraph,\n context.projectGraph,\n context.root,\n context.projectName,\n // When using incremental building and the serve target is called\n // we need to get the deps for the 'build' target instead.\n context.targetName === 'serve' ? 'build' : context.targetName,\n context.configurationName\n );\n // This tsconfig is used via the Vite ts paths plugin.\n // It can be also used by other user-defined Vite plugins (e.g. for creating type declaration files).\n const tmpTsConfigPath = createTmpTsConfig(\n tsConfig,\n context.root,\n projectRoot,\n dependencies\n );\n process.env.NX_TSCONFIG_PATH = tmpTsConfigPath;\n }\n}\n"],"names":["validateTypes","createBuildableTsConfig","opts","result","runTypeCheck","workspaceRoot","tsConfigPath","join","tsconfig","mode","printDiagnostics","errors","warnings","length","Error","projectRoot","options","context","tsConfig","getProjectTsConfigPath","dependencies","calculateProjectBuildableDependencies","taskGraph","projectGraph","root","projectName","targetName","configurationName","tmpTsConfigPath","createTmpTsConfig","process","env","NX_TSCONFIG_PATH"],"mappings":";;;;;;;;IAWsBA,aAAa;eAAbA;;IAkBNC,uBAAuB;eAAvBA;;;oBA7B+B;sBAC1B;oCAOd;8BACgC;AAEhC,eAAeD,cAAcE,IAInC;IACC,MAAMC,SAAS,MAAMC,IAAAA,gBAAY,EAAC;QAChCC,eAAeH,KAAKG,aAAa;QACjCC,cAAcC,IAAAA,UAAI,EAACL,KAAKG,aAAa,EAAEH,KAAKM,QAAQ;QACpDC,MAAM;IACR;IAEA,MAAMC,IAAAA,oBAAgB,EAACP,OAAOQ,MAAM,EAAER,OAAOS,QAAQ;IAErD,IAAIT,OAAOQ,MAAM,CAACE,MAAM,GAAG,GAAG;QAC5B,MAAM,IAAIC,MAAM;IAClB;AACF;AAEO,SAASb,wBACdc,WAAmB,EACnBC,OAAgE,EAChEC,OAAwB;QAGxBD,UAAQ;IADR,MAAME,WAAWC,IAAAA,oCAAsB,EAACJ;;IACxCC,MAAAA,WAAAA,QAAO,CAAC,uBAAA,sBAAsB,gBAA9BA,QAAO,CAAC,qBAAsB,GAAK;IAEnC,IAAI,CAACA,OAAO,CAAC,sBAAsB,EAAE;QACnC,MAAM,EAAEI,YAAY,EAAE,GAAGC,IAAAA,yDAAqC,EAC5DJ,QAAQK,SAAS,EACjBL,QAAQM,YAAY,EACpBN,QAAQO,IAAI,EACZP,QAAQQ,WAAW,EACnB,iEAAiE;QACjE,0DAA0D;QAC1DR,QAAQS,UAAU,KAAK,UAAU,UAAUT,QAAQS,UAAU,EAC7DT,QAAQU,iBAAiB;QAE3B,sDAAsD;QACtD,qGAAqG;QACrG,MAAMC,kBAAkBC,IAAAA,qCAAiB,EACvCX,UACAD,QAAQO,IAAI,EACZT,aACAK;QAEFU,QAAQC,GAAG,CAACC,gBAAgB,GAAGJ;IACjC;AACF"}
|