Skip to content

Commit

Permalink
backstage: get rid of @dotcom-tool-kit/options
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Dec 2, 2024
1 parent d1323fa commit 8c9a0c9
Show file tree
Hide file tree
Showing 26 changed files with 31 additions and 371 deletions.
1 change: 0 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"core/create": "4.0.6",
"lib/error": "4.0.0",
"lib/logger": "4.0.0",
"lib/options": "4.0.2",
"plugins/package-json-hook": "5.0.2",
"lib/state": "4.0.0",
"lib/types": "3.6.1",
Expand Down
1 change: 0 additions & 1 deletion core/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@dotcom-tool-kit/conflict": "^1.0.0",
"@dotcom-tool-kit/error": "^4.0.0",
"@dotcom-tool-kit/logger": "^4.0.0",
"@dotcom-tool-kit/options": "^4.0.2",
"@dotcom-tool-kit/plugin": "^1.0.0",
"@dotcom-tool-kit/state": "^4.0.0",
"@dotcom-tool-kit/validated": "^1.0.0",
Expand Down
7 changes: 0 additions & 7 deletions core/cli/src/help.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { loadConfig } from './config'
import { OptionKey, setOptions } from '@dotcom-tool-kit/options'
import { styles as s } from '@dotcom-tool-kit/logger'
import type { Logger } from 'winston'
import YAML from 'yaml'
Expand Down Expand Up @@ -85,12 +84,6 @@ export default async function showHelp(logger: Logger, commands: string[]): Prom
commands = Object.keys(config.commandTasks).sort()
}

for (const pluginOptions of Object.values(config.pluginOptions)) {
if (pluginOptions.forPlugin) {
setOptions(pluginOptions.forPlugin.id as OptionKey, pluginOptions.options)
}
}

logger.info(toolKitIntro)

const definedCommands = commands.filter((command) => config.commandTasks[command])
Expand Down
7 changes: 0 additions & 7 deletions core/cli/src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as path from 'path'
import type { z } from 'zod'
import { ToolKitError } from '@dotcom-tool-kit/error'
import { styles } from '@dotcom-tool-kit/logger'
import { OptionKey, setOptions } from '@dotcom-tool-kit/options'
import groupBy from 'lodash/groupBy'
import type { Logger } from 'winston'
import { loadConfig } from './config'
Expand Down Expand Up @@ -117,12 +116,6 @@ export async function checkInstall(logger: Logger, config: ValidConfig): Promise
export default async function installHooks(logger: Logger): Promise<ValidConfig> {
const config = await loadConfig(logger, { root: process.cwd() })

for (const pluginOptions of Object.values(config.pluginOptions)) {
if (pluginOptions.forPlugin) {
setOptions(pluginOptions.forPlugin.id as OptionKey, pluginOptions.options)
}
}

await runInit(logger, config)

const errors: Error[] = []
Expand Down
9 changes: 1 addition & 8 deletions core/cli/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { Task, TaskConstructor } from '@dotcom-tool-kit/base'
import { Validated, invalid, reduceValidated, valid } from '@dotcom-tool-kit/validated'
import type { Logger } from 'winston'
import { importEntryPoint } from './plugin/entry-point'
import { OptionKey, getOptions, setOptions } from '@dotcom-tool-kit/options'
import { loadConfig } from './config'
import { ToolKitError } from '@dotcom-tool-kit/error'
import { checkInstall } from './install'
import { styles } from '@dotcom-tool-kit/logger'
import { shouldDisableNativeFetch } from './fetch'
import { runInit } from './init'
import { formatInvalidOption } from './messages'
import { type TaskOptions, TaskSchemas } from '@dotcom-tool-kit/schemas'
import { PluginOptions, type TaskOptions, TaskSchemas } from '@dotcom-tool-kit/schemas'
import { OptionsForTask } from '@dotcom-tool-kit/plugin'
import pluralize from 'pluralize'

Expand Down Expand Up @@ -63,12 +62,6 @@ export async function runTasksFromConfig(
commands: string[],
files?: string[]
): Promise<void> {
for (const pluginOptions of Object.values(config.pluginOptions)) {
if (pluginOptions.forPlugin) {
setOptions(pluginOptions.forPlugin.id as OptionKey, pluginOptions.options)
}
}

await runInit(logger, config)
await checkInstall(logger, config)

Expand Down
3 changes: 3 additions & 0 deletions docs/developing-tool-kit.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Developing Tool Kit

> [!WARNING]
> This guide hasn't been updated since Tool Kit v4 was released. Some of this information is outdated.
Tool Kit is a monorepo. The [`plugins`](/plugins) folder contains several different parts published separately to `npm`. [`core/cli`](/core/cli) is the main entry point. It loads plugins listed by an app's [Tool Kit configuration](../readme.md#configuration). These plugins export tasks that are available when running Tool Kit from your app's folder, allowing apps to include different plugins for different use cases.

Tool Kit requires Node v16. To install dependencies for every package in the workspace, run:
Expand Down
1 change: 0 additions & 1 deletion lib/doppler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"dependencies": {
"@dotcom-tool-kit/error": "^4.0.0",
"@dotcom-tool-kit/logger": "^4.0.0",
"@dotcom-tool-kit/options": "^4.0.2",
"tslib": "^2.3.1"
},
"keywords": [],
Expand Down
3 changes: 0 additions & 3 deletions lib/doppler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
{
"path": "../logger"
},
{
"path": "../options"
},
{
"path": "../schemas"
}
Expand Down
2 changes: 0 additions & 2 deletions lib/options/.toolkitrc.yml

This file was deleted.

241 changes: 0 additions & 241 deletions lib/options/CHANGELOG.md

This file was deleted.

31 changes: 0 additions & 31 deletions lib/options/package.json

This file was deleted.

Loading

0 comments on commit 8c9a0c9

Please sign in to comment.