@nx/vite 17.3.0-beta.6 → 17.3.0-beta.8
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.3.0-beta.
|
|
3
|
+
"version": "17.3.0-beta.8",
|
|
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.3.0-beta.
|
|
32
|
+
"@nx/devkit": "17.3.0-beta.8",
|
|
33
33
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
34
34
|
"@swc/helpers": "~0.5.0",
|
|
35
35
|
"enquirer": "~2.3.6",
|
|
36
|
-
"@nx/js": "17.3.0-beta.
|
|
36
|
+
"@nx/js": "17.3.0-beta.8",
|
|
37
37
|
"tsconfig-paths": "^4.1.2",
|
|
38
|
-
"@nrwl/vite": "17.3.0-beta.
|
|
38
|
+
"@nrwl/vite": "17.3.0-beta.8"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"vite": "^5.0.0",
|
|
@@ -17,6 +17,8 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _devkit = require("@nx/devkit");
|
|
20
|
+
const _updatepackagescripts = require("@nx/devkit/src/utils/update-package-scripts");
|
|
21
|
+
const _plugin = require("../../plugins/plugin");
|
|
20
22
|
const _utils = require("./lib/utils");
|
|
21
23
|
function updateNxJsonSettings(tree) {
|
|
22
24
|
var _nxJson_namedInputs, _nxJson_plugins;
|
|
@@ -53,6 +55,9 @@ async function initGenerator(tree, schema) {
|
|
|
53
55
|
tasks.push((0, _utils.moveToDevDependencies)(tree));
|
|
54
56
|
tasks.push((0, _utils.checkDependenciesInstalled)(tree, schema));
|
|
55
57
|
}
|
|
58
|
+
if (schema.updatePackageScripts) {
|
|
59
|
+
await (0, _updatepackagescripts.updatePackageScripts)(tree, _plugin.createNodes);
|
|
60
|
+
}
|
|
56
61
|
if (!schema.skipFormat) {
|
|
57
62
|
await (0, _devkit.formatFiles)(tree);
|
|
58
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/vite/src/generators/init/init.ts"],"sourcesContent":["import {\n formatFiles,\n GeneratorCallback,\n readNxJson,\n runTasksInSerial,\n Tree,\n updateNxJson,\n} from '@nx/devkit';\n\nimport { InitGeneratorSchema } from './schema';\nimport {\n addPlugin,\n checkDependenciesInstalled,\n moveToDevDependencies,\n} from './lib/utils';\n\nexport function updateNxJsonSettings(tree: Tree) {\n const nxJson = readNxJson(tree);\n\n const productionFileSet = nxJson.namedInputs?.production;\n if (productionFileSet) {\n productionFileSet.push(\n '!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)',\n '!{projectRoot}/tsconfig.spec.json'\n );\n\n nxJson.namedInputs.production = Array.from(new Set(productionFileSet));\n }\n\n const hasPlugin = nxJson.plugins?.some((p) =>\n typeof p === 'string'\n ? p === '@nx/vite/plugin'\n : p.plugin === '@nx/vite/plugin'\n );\n\n if (!hasPlugin) {\n nxJson.targetDefaults ??= {};\n nxJson.targetDefaults['@nx/vite:test'] ??= {};\n nxJson.targetDefaults['@nx/vite:test'].cache ??= true;\n nxJson.targetDefaults['@nx/vite:test'].inputs ??= [\n 'default',\n productionFileSet ? '^production' : '^default',\n ];\n }\n\n updateNxJson(tree, nxJson);\n}\n\nexport async function initGenerator(tree: Tree, schema: InitGeneratorSchema) {\n if (process.env.NX_PCV3 === 'true') {\n addPlugin(tree);\n }\n\n updateNxJsonSettings(tree);\n\n const tasks: GeneratorCallback[] = [];\n if (!schema.skipPackageJson) {\n tasks.push(moveToDevDependencies(tree));\n tasks.push(checkDependenciesInstalled(tree, schema));\n }\n\n if (!schema.skipFormat) {\n await formatFiles(tree);\n }\n\n return runTasksInSerial(...tasks);\n}\n\nexport default initGenerator;\n"],"names":["updateNxJsonSettings","initGenerator","tree","nxJson","readNxJson","productionFileSet","namedInputs","production","push","Array","from","Set","hasPlugin","plugins","some","p","plugin","targetDefaults","cache","inputs","updateNxJson","schema","process","env","NX_PCV3","addPlugin","tasks","skipPackageJson","moveToDevDependencies","checkDependenciesInstalled","skipFormat","formatFiles","runTasksInSerial"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/vite/src/generators/init/init.ts"],"sourcesContent":["import {\n formatFiles,\n GeneratorCallback,\n readNxJson,\n runTasksInSerial,\n Tree,\n updateNxJson,\n} from '@nx/devkit';\nimport { updatePackageScripts } from '@nx/devkit/src/utils/update-package-scripts';\n\nimport { createNodes } from '../../plugins/plugin';\nimport { InitGeneratorSchema } from './schema';\nimport {\n addPlugin,\n checkDependenciesInstalled,\n moveToDevDependencies,\n} from './lib/utils';\n\nexport function updateNxJsonSettings(tree: Tree) {\n const nxJson = readNxJson(tree);\n\n const productionFileSet = nxJson.namedInputs?.production;\n if (productionFileSet) {\n productionFileSet.push(\n '!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)',\n '!{projectRoot}/tsconfig.spec.json'\n );\n\n nxJson.namedInputs.production = Array.from(new Set(productionFileSet));\n }\n\n const hasPlugin = nxJson.plugins?.some((p) =>\n typeof p === 'string'\n ? p === '@nx/vite/plugin'\n : p.plugin === '@nx/vite/plugin'\n );\n\n if (!hasPlugin) {\n nxJson.targetDefaults ??= {};\n nxJson.targetDefaults['@nx/vite:test'] ??= {};\n nxJson.targetDefaults['@nx/vite:test'].cache ??= true;\n nxJson.targetDefaults['@nx/vite:test'].inputs ??= [\n 'default',\n productionFileSet ? '^production' : '^default',\n ];\n }\n\n updateNxJson(tree, nxJson);\n}\n\nexport async function initGenerator(tree: Tree, schema: InitGeneratorSchema) {\n if (process.env.NX_PCV3 === 'true') {\n addPlugin(tree);\n }\n\n updateNxJsonSettings(tree);\n\n const tasks: GeneratorCallback[] = [];\n if (!schema.skipPackageJson) {\n tasks.push(moveToDevDependencies(tree));\n tasks.push(checkDependenciesInstalled(tree, schema));\n }\n\n if (schema.updatePackageScripts) {\n await updatePackageScripts(tree, createNodes);\n }\n\n if (!schema.skipFormat) {\n await formatFiles(tree);\n }\n\n return runTasksInSerial(...tasks);\n}\n\nexport default initGenerator;\n"],"names":["updateNxJsonSettings","initGenerator","tree","nxJson","readNxJson","productionFileSet","namedInputs","production","push","Array","from","Set","hasPlugin","plugins","some","p","plugin","targetDefaults","cache","inputs","updateNxJson","schema","process","env","NX_PCV3","addPlugin","tasks","skipPackageJson","moveToDevDependencies","checkDependenciesInstalled","updatePackageScripts","createNodes","skipFormat","formatFiles","runTasksInSerial"],"mappings":";;;;;;;;IAkBgBA,oBAAoB;eAApBA;;IAgCMC,aAAa;eAAbA;;IAwBtB,OAA6B;eAA7B;;;wBAnEO;sCAC8B;wBAET;uBAMrB;AAEA,SAASD,qBAAqBE,IAAU;QAGnBC,qBAURA;IAZlB,MAAMA,SAASC,IAAAA,kBAAU,EAACF;IAE1B,MAAMG,qBAAoBF,sBAAAA,OAAOG,WAAW,qBAAlBH,oBAAoBI,UAAU;IACxD,IAAIF,mBAAmB;QACrBA,kBAAkBG,IAAI,CACpB,yDACA;QAGFL,OAAOG,WAAW,CAACC,UAAU,GAAGE,MAAMC,IAAI,CAAC,IAAIC,IAAIN;IACrD;IAEA,MAAMO,aAAYT,kBAAAA,OAAOU,OAAO,qBAAdV,gBAAgBW,IAAI,CAAC,CAACC,IACtC,OAAOA,MAAM,WACTA,MAAM,oBACNA,EAAEC,MAAM,KAAK;IAGnB,IAAI,CAACJ,WAAW;YACdT,SACAA,wBAAsB,aACtBA,mCACAA;;QAHAA,oBAAAA,UAAAA,QAAOc,4CAAPd,QAAOc,iBAAmB,CAAC;;QAC3Bd,MAAAA,yBAAAA,OAAOc,cAAc,CAAA,CAAC,cAAA,gBAAgB,gBAAtCd,sBAAqB,CAAC,YAAgB,GAAK,CAAC;;QAC5CA,WAAAA,oCAAAA,OAAOc,cAAc,CAAC,gBAAgB,EAACC,0BAAvCf,kCAAuCe,QAAU;;QACjDf,YAAAA,qCAAAA,OAAOc,cAAc,CAAC,gBAAgB,EAACE,4BAAvChB,mCAAuCgB,SAAW;YAChD;YACAd,oBAAoB,gBAAgB;SACrC;IACH;IAEAe,IAAAA,oBAAY,EAAClB,MAAMC;AACrB;AAEO,eAAeF,cAAcC,IAAU,EAAEmB,MAA2B;IACzE,IAAIC,QAAQC,GAAG,CAACC,OAAO,KAAK,QAAQ;QAClCC,IAAAA,gBAAS,EAACvB;IACZ;IAEAF,qBAAqBE;IAErB,MAAMwB,QAA6B,EAAE;IACrC,IAAI,CAACL,OAAOM,eAAe,EAAE;QAC3BD,MAAMlB,IAAI,CAACoB,IAAAA,4BAAqB,EAAC1B;QACjCwB,MAAMlB,IAAI,CAACqB,IAAAA,iCAA0B,EAAC3B,MAAMmB;IAC9C;IAEA,IAAIA,OAAOS,oBAAoB,EAAE;QAC/B,MAAMA,IAAAA,0CAAoB,EAAC5B,MAAM6B,mBAAW;IAC9C;IAEA,IAAI,CAACV,OAAOW,UAAU,EAAE;QACtB,MAAMC,IAAAA,mBAAW,EAAC/B;IACpB;IAEA,OAAOgC,IAAAA,wBAAgB,KAAIR;AAC7B;MAEA,WAAezB"}
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
"x-priority": "internal",
|
|
21
21
|
"description": "Keep existing dependencies versions",
|
|
22
22
|
"default": false
|
|
23
|
+
},
|
|
24
|
+
"updatePackageScripts": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"x-priority": "internal",
|
|
27
|
+
"description": "Update `package.json` scripts with inferred targets",
|
|
28
|
+
"default": false
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
}
|