@dpuse/dpuse-development 0.3.766 → 0.3.780

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.
@@ -1 +1,2 @@
1
+ /** Audit the project's dependencies for known security vulnerabilities. Also runs the npm outdated command. */
1
2
  export declare function auditDependencies(): Promise<void>;
@@ -0,0 +1,2 @@
1
+ /** Builds the package using Vite. Output to '/dist' directory. Builds bundle analysis reports. */
2
+ export declare function buildProject(): Promise<void>;
@@ -1 +1,3 @@
1
+ /** Identifies outdated dependencies using npm outdated and npm-check-updates with option to automatically install
2
+ * latest versions. */
1
3
  export declare function checkDependencies(): Promise<void>;
@@ -0,0 +1,2 @@
1
+ /** Checks the configuration files against the DPUse templates, then lists outdated dependencies. */
2
+ export declare function checkProject(): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  export declare const API_REFERENCE_PATH = "API_REFERENCE.md";
2
+ /** Lists every export of each import path in API_REFERENCE.md. Runs with the README's sections where the project has that file. */
2
3
  export declare function documentAPIReference(): Promise<void>;
3
- export declare function writeAPIReference(stepIcon: string): Promise<void>;
@@ -1,3 +1,4 @@
1
+ export declare const BUNDLE_REPORT_PATH = "bundle-analysis-reports/sonda/index.json";
1
2
  export declare function documentBundleSizes(options?: {
2
3
  moduleLevel?: boolean;
3
4
  }): Promise<void>;
@@ -0,0 +1,2 @@
1
+ /** Regenerates the README's Contributing and License sections. */
2
+ export declare function documentContributingLicense(): Promise<void>;
@@ -1 +1,4 @@
1
+ /** Identify licenses of the project's production and peer dependencies. Updates the table in the Dependency Licenses
2
+ * section of this page and summary files licenses.json and licenseTree.json in th licenses directory of this
3
+ * repository. Also downloads a copy of dependency license to `licenses/downloads'. */
1
4
  export declare function documentDependencies(allowedLicenses?: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ export interface DocumentOptions {
2
+ allowedLicenses?: string;
3
+ moduleLevel?: boolean;
4
+ }
5
+ /** Regenerates every generated section of the README, in the order they appear, then the API reference where the project keeps one. */
6
+ export declare function documentProject({ allowedLicenses, moduleLevel }?: DocumentOptions): Promise<void>;
@@ -0,0 +1,2 @@
1
+ /** Regenerates the README's Quality & Security section: testing, code quality, security analysis, dependencies and OpenSSF. */
2
+ export declare function documentQualitySecurity(): Promise<void>;
@@ -1 +1,2 @@
1
+ /** Uses prettier to enforce formatting style rules. */
1
2
  export declare function formatCode(): Promise<void>;
@@ -1 +1,2 @@
1
+ /** Uses eslint to check the code for potential errors and enforces coding style rules. */
1
2
  export declare function lintCode(): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import { PackageJson } from 'type-fest';
2
+ import { ModuleConfig } from '@dpuse/dpuse-shared/component/module';
3
+ import { ModuleTypeConfig } from '../utilities';
4
+ export declare function publishProject(): Promise<void>;
5
+ export declare function registerModule(stepIcon: string, packageJSON: PackageJson, configJSON: ModuleConfig, moduleTypeConfig: ModuleTypeConfig): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { DocumentOptions } from './documentProject';
2
+ /** Bump version, builds config, builds project, regenerates the README, synchronise with GitHub and publish to npm or Cloudflare. */
3
+ export declare function releaseProject(documentOptions?: DocumentOptions): Promise<void>;
@@ -0,0 +1,2 @@
1
+ /** Synchronise the local repository with the main GitHub repository. */
2
+ export declare function syncProjectWithGitHub(): Promise<void>;
@@ -0,0 +1,3 @@
1
+ export type TestTypeId = 'e2e' | 'unit';
2
+ /** Runs the requested types of test, skipping any type this project has not configured. */
3
+ export declare function testProject(testTypeIds?: TestTypeId[], isCoverageMeasured?: boolean): Promise<void>;
@@ -1,14 +1,11 @@
1
1
  export { auditDependencies } from './actions/auditDependencies';
2
- export { checkConfigFiles } from './actions/checkConfigFiles';
3
- export { checkDependencies } from './actions/checkDependencies';
4
- export { documentBundleSizes } from './actions/documentBundleSizes';
5
- export { documentDependencies } from './actions/documentDependencies';
6
- export { documentGovernance } from './actions/documentGovernance';
7
- export { documentActions } from './actions/documentActions';
8
- export { documentAPIReference } from './actions/documentApiReference';
9
- export { documentOpening } from './actions/documentOpening';
10
- export { documentUsage } from './actions/documentUsage';
2
+ export { buildProject } from './actions/buildProject';
3
+ export { checkProject } from './actions/checkProject';
4
+ export { documentProject } from './actions/documentProject';
11
5
  export { formatCode } from './actions/formatCode';
12
6
  export { lintCode } from './actions/lintCode';
7
+ export { publishProject } from './actions/publishProject';
8
+ export { releaseProject } from './actions/releaseProject';
9
+ export { syncProjectWithGitHub } from './actions/syncProjectWithGitHub';
10
+ export { testProject } from './actions/testProject';
13
11
  export { uploadDirectoryToR2 } from './utilities/cloudflare';
14
- export { buildProject, publishProject, releaseProject, syncProjectWithGitHub, testProject } from './actions/manageProject';
@@ -1,5 +1,6 @@
1
1
  import { PackageJson } from 'type-fest';
2
2
  import { Dirent, ObjectEncodingOptions, Stats } from 'node:fs';
3
+ import { ModuleConfig } from '@dpuse/dpuse-shared/component/module';
3
4
  export interface ModuleTypeConfig {
4
5
  idPrefix: string;
5
6
  typeId: 'app' | 'api' | 'connector' | 'context' | 'cookbook' | 'development' | 'engine' | 'eslint' | 'github' | 'kb' | 'presenter' | 'resources' | 'shared' | 'tool';
@@ -9,12 +10,17 @@ export interface ModuleTypeConfig {
9
10
  export declare const FALLOW_DIRECTORY = "code-health-reports/fallow";
10
11
  export declare const FALLOW_BADGE_PATH = "code-health-reports/fallow/badge.json";
11
12
  export declare const FALLOW_REPORT_PATH = "code-health-reports/fallow/index.md";
13
+ export declare const CONTRIBUTING_LICENSE_END_MARKER = "<!-- CONTRIBUTING_LICENSE_END -->";
14
+ export declare const CONTRIBUTING_LICENSE_START_MARKER = "<!-- CONTRIBUTING_LICENSE_START -->";
15
+ export declare const QUALITY_SECURITY_END_MARKER = "<!-- QUALITY_SECURITY_END -->";
16
+ export declare const QUALITY_SECURITY_START_MARKER = "<!-- QUALITY_SECURITY_START -->";
12
17
  export declare function clearDirectory(label: string | undefined, directoryPath: string): Promise<void>;
13
18
  export declare function getDirectoryEntries(path: string): Promise<string[]>;
14
19
  export declare function getDirectoryEntries(path: string, options: ObjectEncodingOptions): Promise<Dirent[]>;
15
20
  export declare function execCommand(label: string | undefined, command_: string, arguments_: string[], outputFilePath?: string): Promise<void>;
16
21
  export declare function spawnCommand(label: string, command: string, arguments_: string[], isErrorIgnored?: boolean, isShellUsed?: boolean): Promise<void>;
17
22
  export declare function spawnCommandToFile(label: string, command: string, arguments_: string[], outputPath: string, isErrorIgnored?: boolean): Promise<void>;
23
+ export declare function migrateGovernanceSection(): Promise<void>;
18
24
  export declare function readJSONFile<T>(path: string): Promise<T>;
19
25
  export declare function readTextFile(path: string): Promise<string>;
20
26
  export declare function readTextFileOrNull(path: string): Promise<string | null>;
@@ -30,4 +36,6 @@ export declare function resolveOwnerAndRepo(packageJSON: PackageJson, purpose: s
30
36
  repo: string;
31
37
  };
32
38
  export declare function getStatsForPath(path: string): Promise<Stats>;
39
+ export declare function buildModuleConfig(stepIcon: string, packageJSON: PackageJson, moduleTypeConfig: ModuleTypeConfig): Promise<ModuleConfig>;
40
+ export declare function bumpPackageVersion(stepIcon: string, packageJSON: PackageJson, path?: string): Promise<void>;
33
41
  export declare function extractOperationsFromSource<T>(source: string): T[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-development",
3
- "version": "0.3.766",
3
+ "version": "0.3.780",
4
4
  "private": false,
5
5
  "description": "Actions for managing DPUse projects.",
6
6
  "license": "MIT",
@@ -68,21 +68,14 @@
68
68
  },
69
69
  "scripts": {
70
70
  "audit": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.auditDependencies())\"",
71
- "build": "vite build && node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentAPIReference())\" && node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentBundleSizes())\"",
72
- "check": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.checkConfigFiles())\" && node -e \"import('./dist/dpuse-development.es.js').then(m => m.checkDependencies())\"",
73
- "document": "npm run documentOpening && npm run documentUsage && npm run documentDependencies && npm run documentGovernance",
74
- "documentBundleSizes": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentBundleSizes())\"",
75
- "documentDependencies": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentDependencies('Apache-2.0;BSD-3-Clause;MIT'))\"",
76
- "documentGovernance": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentGovernance())\"",
77
- "documentOpening": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentOpening())\"",
78
- "documentUsage": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentUsage())\"",
71
+ "build": "vite build",
72
+ "check": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.checkProject())\"",
73
+ "document": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentProject({ allowedLicenses: 'Apache-2.0;BSD-3-Clause;MIT' }))\"",
79
74
  "format": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.formatCode())\"",
80
- "health": "npm run test:coverage && fallow --coverage coverage/coverage-final.json",
81
75
  "lint": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.lintCode())\"",
82
- "release": "npm run sync && gh release create \"v$(npm pkg get version | tr -d '\"')\" --target \"$(git rev-parse HEAD)\" --generate-notes --latest",
76
+ "release": "npm run build && npm run document && npm run sync && gh release create \"v$(npm pkg get version | tr -d '\"')\" --target \"$(git rev-parse HEAD)\" --generate-notes --latest",
83
77
  "sync": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.syncProjectWithGitHub())\"",
84
- "test": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.testProject())\"",
85
- "test:coverage": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.testProject(['unit'], true))\""
78
+ "test": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.testProject())\""
86
79
  },
87
80
  "peerDependencies": {
88
81
  "typescript": "^6.0.3"
@@ -1 +0,0 @@
1
- export declare function documentGovernance(): Promise<void>;
@@ -1,8 +0,0 @@
1
- export type TestTypeId = 'e2e' | 'unit';
2
- /** Build a project. */
3
- export declare function buildProject(): Promise<void>;
4
- export declare function publishProject(): Promise<void>;
5
- export declare function releaseProject(): Promise<void>;
6
- export declare function syncProjectWithGitHub(): Promise<void>;
7
- /** Runs the requested types of test, skipping any type this project has not configured. Runs the requested types of test, skipping any type this project has not configured. Runs the requested types of test, skipping any type this project has not configured. Runs the requested types of test, skipping any type this project has not configured. Runs the requested types of test, skipping any type this project has not configured. Runs the requested types of test, skipping any type this project has not configured. Runs the requested types of test, skipping any type this project has not configured. Runs the requested types of test, skipping any type this project has not configured. */
8
- export declare function testProject(testTypeIds?: TestTypeId[], isCoverageMeasured?: boolean): Promise<void>;