release: release version · mjeanroy/rollup-plugin-license@8a7f79c (original) (raw)

``

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

`+

import type {Plugin} from 'rollup';

`

``

26

+

``

27

`+

type FilePath = string;

`

``

28

`+

type FileEncoding = string;

`

``

29

`+

type FactoryFn = () => T;

`

``

30

`+

type Factory = T | FactoryFn;

`

``

31

+

``

32

`+

/**

`

``

33

`+

`

``

34

`+

`

``

35

`+

`

``

36

`+

*/

`

``

37

`+

export interface Person {

`

``

38

`+

/**

`

``

39

`+

`

``

40

`+

*/

`

``

41

`+

readonly name: string;

`

``

42

+

``

43

`+

/**

`

``

44

`+

`

``

45

`+

*/

`

``

46

`+

readonly email: string | null;

`

``

47

+

``

48

`+

/**

`

``

49

`+

`

``

50

`+

*/

`

``

51

`+

readonly url: string | null;

`

``

52

+

``

53

`+

/**

`

``

54

`+

`

``

55

`+

`

``

56

`+

*/

`

``

57

`+

text: () => string;

`

``

58

`+

}

`

``

59

+

``

60

`+

/**

`

``

61

`+

`

``

62

`+

*/

`

``

63

`+

export type CommentStyle = 'regular' | 'ignored' | 'slash' | 'none';

`

``

64

+

``

65

`+

/**

`

``

66

`+

`

``

67

`+

*/

`

``

68

`+

interface BannerContentOptions {

`

``

69

`+

/**

`

``

70

`+

`

``

71

`+

*/

`

``

72

`+

file: FilePath;

`

``

73

+

``

74

`+

/**

`

``

75

`+

`

``

76

`+

`

``

77

`+

*/

`

``

78

`+

encoding?: FileEncoding;

`

``

79

`+

}

`

``

80

+

``

81

`+

/**

`

``

82

`+

`

``

83

`+

`

``

84

`+

`

``

85

`+

*/

`

``

86

`+

type BannerContent = string | BannerContentOptions;

`

``

87

+

``

88

`+

/**

`

``

89

`+

`

``

90

`+

`

``

91

`+

*/

`

``

92

`+

interface BannerContentData {

`

``

93

`+

`

``

94

`+

}

`

``

95

+

``

96

`+

/**

`

``

97

`+

`

``

98

`+

*/

`

``

99

`+

interface BannerOptions {

`

``

100

`+

content: Factory;

`

``

101

`+

commentStyle?: CommentStyle;

`

``

102

`+

data?: Factory;

`

``

103

`+

}

`

``

104

+

``

105

`+

export type Banner = string | BannerOptions;

`

``

106

+

``

107

`+

/**

`

``

108

`+

`

``

109

`+

*/

`

``

110

`+

interface DependencyRepository {

`

``

111

`+

/**

`

``

112

`+

`

``

113

`+

*/

`

``

114

`+

readonly url: string;

`

``

115

+

``

116

`+

/**

`

``

117

`+

`

``

118

`+

*/

`

``

119

`+

readonly type: string;

`

``

120

`+

}

`

``

121

+

``

122

`+

/**

`

``

123

`+

`

``

124

`+

*/

`

``

125

`+

export interface Dependency {

`

``

126

`+

/**

`

``

127

`+

`

``

128

`+

*/

`

``

129

`+

readonly name: string | null;

`

``

130

+

``

131

`+

/**

`

``

132

`+

`

``

133

`+

*/

`

``

134

`+

readonly maintainers: string[];

`

``

135

+

``

136

`+

/**

`

``

137

`+

`

``

138

`+

*/

`

``

139

`+

readonly version: string | null;

`

``

140

+

``

141

`+

/**

`

``

142

`+

`

``

143

`+

*/

`

``

144

`+

readonly description: string | null;

`

``

145

+

``

146

`+

/**

`

``

147

`+

`

``

148

`+

*/

`

``

149

`+

readonly repository: string | DependencyRepository | null;

`

``

150

+

``

151

`+

/**

`

``

152

`+

`

``

153

`+

*/

`

``

154

`+

readonly homepage: string | null;

`

``

155

+

``

156

`+

/**

`

``

157

`+

`

``

158

`+

*/

`

``

159

`+

readonly private: boolean;

`

``

160

+

``

161

`+

/**

`

``

162

`+

`

``

163

`+

*/

`

``

164

`+

readonly license: string | null;

`

``

165

+

``

166

`+

/**

`

``

167

`+

`

``

168

`+

*/

`

``

169

`+

readonly licenseText: string | null;

`

``

170

+

``

171

`+

/**

`

``

172

`+

`

``

173

`+

*/

`

``

174

`+

readonly noticeText: string | null;

`

``

175

+

``

176

`+

/**

`

``

177

`+

`

``

178

`+

*/

`

``

179

`+

readonly author: Person | null;

`

``

180

+

``

181

`+

/**

`

``

182

`+

`

``

183

`+

*/

`

``

184

`+

readonly contributors: Person[];

`

``

185

+

``

186

`+

/**

`

``

187

`+

`

``

188

`+

`

``

189

`+

*/

`

``

190

`+

text: () => string;

`

``

191

`+

}

`

``

192

+

``

193

`+

/**

`

``

194

`+

`

``

195

`+

*/

`

``

196

`+

type SpdxId = string;

`

``

197

+

``

198

`+

/**

`

``

199

`+

`

``

200

`+

*/

`

``

201

`+

type ThirdPartyDependencyValidatorFn = (Dependency: Dependency) => boolean;

`

``

202

+

``

203

`+

type ThirdPartyValidator = SpdxId | ThirdPartyDependencyValidatorFn;

`

``

204

+

``

205

`+

interface ThirdPartyAllowOptions {

`

``

206

`+

/**

`

``

207

`+

`

``

208

`+

*/

`

``

209

`+

test: ThirdPartyValidator;

`

``

210

+

``

211

`+

/**

`

``

212

`+

`

``

213

`+

`

``

214

`+

*/

`

``

215

`+

failOnUnlicensed?: boolean;

`

``

216

+

``

217

`+

/**

`

``

218

`+

`

``

219

`+

`

``

220

`+

*/

`

``

221

`+

failOnViolation?: boolean;

`

``

222

`+

}

`

``

223

+

``

224

`+

/**

`

``

225

`+

`

``

226

`+

`

``

227

`+

*/

`

``

228

`+

type ThirdPartyOutputGeneratorFn = (dependencies: Dependency[]) => void;

`

``

229

+

``

230

`+

/**

`

``

231

`+

`

``

232

`+

*/

`

``

233

`+

type ThirdPartyOutputTemplate = string;

`

``

234

+

``

235

`+

/**

`

``

236

`+

`

``

237

`+

*/

`

``

238

`+

type ThirdPartyOutputTemplateFn = (dependencies: Dependency[]) => void;

`

``

239

+

``

240

`+

/**

`

``

241

`+

`

``

242

`+

*/

`

``

243

`+

interface ThirdPartyOutputOptions {

`

``

244

`+

/**

`

``

245

`+

`

``

246

`+

*/

`

``

247

`+

file: FilePath;

`

``

248

+

``

249

`+

/**

`

``

250

`+

`

``

251

`+

*/

`

``

252

`+

encoding?: FileEncoding;

`

``

253

+

``

254

`+

/**

`

``

255

`+

`

``

256

`+

`

``

257

`+

`

``

258

`+

`

``

259

`+

`

``

260

`` +

``

``

261

`+

`

``

262

`+

`

``

263

`+

`

``

264

`+

`

``

265

`` +

``

``

266

`+

`

``

267

`+

`

``

268

`+

`

``

269

`` +

``

``

270

`+

*/

`

``

271

`+

template?: ThirdPartyOutputTemplate | ThirdPartyOutputTemplateFn;

`

``

272

`+

}

`

``

273

+

``

274

`+

type ThirdPartyOutput = FilePath | ThirdPartyOutputGeneratorFn | ThirdPartyOutputOptions;

`

``

275

+

``

276

`+

interface ThirdPartyOptions {

`

``

277

`+

/**

`

``

278

`+

`

``

279

`+

*/

`

``

280

`+

output: ThirdPartyOutput | ThirdPartyOutput[];

`

``

281

+

``

282

`+

/**

`

``

283

`` +

``

``

284

`+

`

``

285

`+

*/

`

``

286

`+

includePrivate?: boolean;

`

``

287

+

``

288

`+

/**

`

``

289

`+

`

``

290

`+

`

``

291

`+

`

``

292

`+

*/

`

``

293

`+

includeSelf?: boolean;

`

``

294

+

``

295

`+

/**

`

``

296

`+

`

``

297

`+

`

``

298

`+

`

``

299

`+

`

``

300

`+

`

``

301

`+

`

``

302

`+

`

``

303

`+

`

``

304

`+

`

``

305

`+

`

``

306

`+

`

``

307

`+

`

``

308

`+

`

``

309

`+

*/

`

``

310

`+

allow?: ThirdPartyValidator | ThirdPartyAllowOptions;

`

``

311

+

``

312

`+

/**

`

``

313

`+

`

``

314

`+

`

``

315

`` +

``

``

316

`+

*/

`

``

317

`+

multipleVersions?: boolean;

`

``

318

`+

}

`

``

319

+

``

320

`+

export type ThirdParty = ThirdPartyOutputGeneratorFn | ThirdPartyOptions;

`

``

321

+

``

322

`+

export interface Options {

`

``

323

`+

sourcemap?: boolean | string;

`

``

324

+

``

325

`+

/**

`

``

326

`+

`

``

327

`+

`

``

328

`+

*/

`

``

329

`+

debug?: boolean;

`

``

330

+

``

331

`+

/**

`

``

332

`+

`

``

333

`+

`

``

334

`+

*/

`

``

335

`+

cwd?: string;

`

``

336

+

``

337

`+

/**

`

``

338

`+

`

``

339

`+

*/

`

``

340

`+

banner?: Factory;

`

``

341

+

``

342

`+

/**

`

``

343

`+

`

``

344

`+

`

``

345

`+

`

``

346

`+

*/

`

``

347

`+

thirdParty?: ThirdParty;

`

``

348

`+

}

`

``

349

+

``

350

`+

declare function rollupPluginLicense(options: Options): Plugin;

`

``

351

+

``

352

`+

export default rollupPluginLicense;

`