@webpieces/dev-config 0.2.75 → 0.2.76
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 +1 -1
- package/plugin.js +24 -7
package/package.json
CHANGED
package/plugin.js
CHANGED
|
@@ -105,21 +105,38 @@ function addArchitectureProject(results, projectFiles, opts, context) {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
function addPerProjectTargets(results, projectFiles, opts, context) {
|
|
108
|
+
// Track processed project roots to avoid duplicates when both files exist
|
|
109
|
+
const processedRoots = new Set();
|
|
108
110
|
for (const projectFile of projectFiles) {
|
|
109
|
-
|
|
111
|
+
const isProjectJson = projectFile.endsWith('project.json');
|
|
112
|
+
const isPackageJson = projectFile.endsWith('package.json');
|
|
113
|
+
if (!isProjectJson && !isPackageJson)
|
|
110
114
|
continue;
|
|
111
115
|
const projectRoot = (0, path_1.dirname)(projectFile);
|
|
116
|
+
// Skip root (workspace manifest, not a project)
|
|
112
117
|
if (projectRoot === '.')
|
|
113
118
|
continue;
|
|
119
|
+
// Skip if we've already processed this project root
|
|
120
|
+
if (processedRoots.has(projectRoot))
|
|
121
|
+
continue;
|
|
122
|
+
// For package.json, skip if project.json also exists in same directory
|
|
123
|
+
// (prefer project.json - it will be processed separately)
|
|
124
|
+
if (isPackageJson) {
|
|
125
|
+
const projectJsonPath = (0, path_1.join)(context.workspaceRoot, projectRoot, 'project.json');
|
|
126
|
+
if ((0, fs_1.existsSync)(projectJsonPath))
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
processedRoots.add(projectRoot);
|
|
114
130
|
const targets = {};
|
|
115
|
-
// Add circular-deps target
|
|
116
|
-
|
|
131
|
+
// Add circular-deps target ONLY for project.json projects
|
|
132
|
+
// (package.json-only projects may not have TypeScript source)
|
|
133
|
+
if (isProjectJson && opts.circularDeps.enabled) {
|
|
117
134
|
if (!isExcluded(projectRoot, opts.circularDeps.excludePatterns)) {
|
|
118
135
|
const targetName = opts.circularDeps.targetName;
|
|
119
136
|
targets[targetName] = createCircularDepsTarget(projectRoot, targetName);
|
|
120
137
|
}
|
|
121
138
|
}
|
|
122
|
-
// Add ci target
|
|
139
|
+
// Add ci target to ALL projects (both project.json and package.json)
|
|
123
140
|
targets['ci'] = createCiTarget();
|
|
124
141
|
if (Object.keys(targets).length === 0)
|
|
125
142
|
continue;
|
|
@@ -135,11 +152,11 @@ function addPerProjectTargets(results, projectFiles, opts, context) {
|
|
|
135
152
|
}
|
|
136
153
|
/**
|
|
137
154
|
* Nx V2 Inference Plugin
|
|
138
|
-
* Matches project.json files to create targets
|
|
155
|
+
* Matches project.json and package.json files to create targets
|
|
139
156
|
*/
|
|
140
157
|
exports.createNodesV2 = [
|
|
141
|
-
// Pattern to match project.json files
|
|
142
|
-
'**/project.json',
|
|
158
|
+
// Pattern to match project.json and package.json files
|
|
159
|
+
'**/{project,package}.json',
|
|
143
160
|
// Inference function
|
|
144
161
|
createNodesFunction,
|
|
145
162
|
];
|