Skip to content

fix: resolve to task instead of run in addon instructions for deno #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silent-timers-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/addons": patch
---

fix: resolve to `task` instead of `run` in addon instructions for `deno`
7 changes: 5 additions & 2 deletions packages/addons/drizzle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import path from 'node:path';
import { common, exports, functions, imports, object, variables } from '@sveltejs/cli-core/js';
import { defineAddon, defineAddonOptions, dedent, type OptionValues } from '@sveltejs/cli-core';
import { parseJson, parseScript } from '@sveltejs/cli-core/parsers';
import { resolveCommand } from 'package-manager-detector/commands';
import { getNodeTypesVersion } from '../common.ts';

const PORTS = {
Expand Down Expand Up @@ -357,16 +358,18 @@ export default defineAddon({
`You will need to set ${highlighter.env('DATABASE_URL')} in your production environment`
];
if (options.docker) {
const { command, args } = resolveCommand(packageManager, 'run', ['db:start'])!;
steps.push(
`Run ${highlighter.command(`${packageManager} run db:start`)} to start the docker container`
`Run ${highlighter.command(`${command} ${args.join(' ')}`)} to start the docker container`
);
} else {
steps.push(
`Check ${highlighter.env('DATABASE_URL')} in ${highlighter.path('.env')} and adjust it to your needs`
);
}
const { command, args } = resolveCommand(packageManager, 'run', ['db:push'])!;
steps.push(
`Run ${highlighter.command(`${packageManager} run db:push`)} to update your database schema`
`Run ${highlighter.command(`${command} ${args.join(' ')}`)} to update your database schema`
);

return steps;
Expand Down
4 changes: 3 additions & 1 deletion packages/addons/lucia/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import * as js from '@sveltejs/cli-core/js';
import type { AstTypes } from '@sveltejs/cli-core/js';
import { parseScript } from '@sveltejs/cli-core/parsers';
import { resolveCommand } from 'package-manager-detector/commands';
import { addToDemoPage } from '../common.ts';

const TABLE_TYPE = {
Expand Down Expand Up @@ -618,8 +619,9 @@ export default defineAddon({
}
},
nextSteps: ({ highlighter, options, packageManager }) => {
const { command, args } = resolveCommand(packageManager, 'run', ['db:push'])!;
const steps = [
`Run ${highlighter.command(`${packageManager} run db:push`)} to update your database schema`
`Run ${highlighter.command(`${command} ${args.join(' ')}`)} to update your database schema`
];
if (options.demo) {
steps.push(`Visit ${highlighter.route('/demo/lucia')} route to view the demo`);
Expand Down
3 changes: 3 additions & 0 deletions packages/addons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"exports": "./index.ts",
"dependencies": {
"@sveltejs/cli-core": "workspace:*"
},
"devDependencies": {
"package-manager-detector": "^0.2.11"
}
}
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading