@bscotch/project
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -29,2 +29,4 @@ import { PackageName } from '@bscotch/config'; | ||
} | ||
// Ensure that Typescript is listed | ||
await project.updateDependencyListing('typescript', 'devDependencies', options); | ||
const protectedByConfig = project.packageJson.get('trebuchet')?.keep; | ||
@@ -36,2 +38,3 @@ const protectFromPruning = [ | ||
...(protectedByConfig?.devDependencies || []), | ||
'typescript', | ||
]; | ||
@@ -38,0 +41,0 @@ await project.packageJson.pruneDependencies({ |
@@ -0,1 +1,2 @@ | ||
import { DependencyVersion } from '@bscotch/config'; | ||
import { Pathy } from '@bscotch/pathy'; | ||
@@ -30,12 +31,14 @@ import '@bscotch/utility'; | ||
}); | ||
console.log('Copying extracted files...'); | ||
await copyExtractableFiles(extractingRelativeFiles, sourceProject, newProjectDir, options); | ||
console.log('Updating index.ts barrel file...'); | ||
await updateEntrypointBarrelFile(sourceProject, newProjectDir, options); | ||
console.log('Populating package.json...'); | ||
if (!options.dryRun) { | ||
await updatePackageJsons(newProjectDir, sourceProject, options); | ||
await updatePackageJsons(newProjectDir, sourceProject); | ||
} | ||
else { | ||
console.log('Populate package.json in new project.'); | ||
} | ||
console.log('Discovering exported tokens...'); | ||
const exportedTokens = await remapSourceProjectImports(sourceProject, extractingFiles, options); | ||
// Delete the copies still in this project | ||
console.log('Deleting extracted files f rom source\n', extractingFiles.map((f) => f.absolute)); | ||
if (!options.dryRun) { | ||
@@ -45,5 +48,2 @@ const deleteWaits = extractingFiles.map((f) => f.delete()); | ||
} | ||
else { | ||
console.log('Delete extracted files f rom source\n', extractingFiles.map((f) => f.absolute)); | ||
} | ||
return { newProjectDir, exportedTokens }; | ||
@@ -195,3 +195,3 @@ } | ||
} | ||
async function updatePackageJsons(newProjectDir, sourceProject, options) { | ||
async function updatePackageJsons(newProjectDir, sourceProject) { | ||
const projectConstructor = sourceProject.constructor; | ||
@@ -203,5 +203,8 @@ const newProject = new projectConstructor({ | ||
await newProject.updateDependencyListings(); | ||
await sourceProject.centralizedPackageJson?.install(newProject.packageJson); | ||
await sourceProject.centralizedPackageJson?.addDependency(newProject.packageJson, { | ||
version: DependencyVersion.fromLocalPath(newProject.dir.relativeFrom(sourceProject.centralizedPackageJson.dir)), | ||
}); | ||
// await sourceProject.centralizedPackageJson?.install(newProject.packageJson); | ||
await newProject.updateDependencyListings(); | ||
await sourceProject.packageJson.addDependency(options.name, { | ||
await sourceProject.packageJson.addDependency(newProject.name, { | ||
version: newProject.packageJson.version, | ||
@@ -208,0 +211,0 @@ }); |
@@ -43,3 +43,3 @@ import { merge } from '@bscotch/utility'; | ||
}, | ||
required: ['dir', 'name'], | ||
required: ['dir'], | ||
}; | ||
@@ -46,0 +46,0 @@ export const projectExtractSchema = merge(projectCreateSchema, { |
{ | ||
"name": "@bscotch/project", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"type": "module", | ||
@@ -19,5 +19,5 @@ "exports": { | ||
"dependencies": { | ||
"@bscotch/config": "^0.5.0", | ||
"@bscotch/pathy": "^2.0.0", | ||
"@bscotch/utility": "^6.1.0", | ||
"@bscotch/config": "^0.5.1", | ||
"@bscotch/pathy": "^2.1.0", | ||
"@bscotch/utility": "^6.1.1", | ||
"@bscotch/validation": "^0.2.0", | ||
@@ -34,3 +34,4 @@ "chalk": "^5.0.1", | ||
"devDependencies": { | ||
"type-fest": "^2.13.0" | ||
"type-fest": "^2.16.0", | ||
"typescript": "^4.8.0-beta" | ||
}, | ||
@@ -37,0 +38,0 @@ "publishConfig": { |
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
138844
2233
2
Updated@bscotch/config@^0.5.1
Updated@bscotch/pathy@^2.1.0
Updated@bscotch/utility@^6.1.1