-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackageJson.ts
More file actions
35 lines (31 loc) · 828 Bytes
/
packageJson.ts
File metadata and controls
35 lines (31 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { PackageJsonManifest } from '../manifest/index.js'
import {
type ProjectOptions,
type ProjectPublishOptions,
Project
} from './project.js'
export interface PackageJsonProjectOptions extends Omit<ProjectOptions, 'manifest'> {
/**
* Path to the package.json file
*/
path?: string
}
/**
* A package.json based project.
*/
export class PackageJsonProject extends Project {
/**
* Creates a package.json based project.
* @param options
*/
constructor(options: PackageJsonProjectOptions = {}) {
const { path = PackageJsonManifest.Filename } = options
super({
...options,
manifest: new PackageJsonManifest(path)
})
}
override publish(_options?: ProjectPublishOptions): Promise<void> {
throw new Error('Publishing a package.json project is not supported')
}
}