Skip to content

Commit

Permalink
Added tiny-updater, which notifies about updates to the CLI as it e…
Browse files Browse the repository at this point in the history
…xits

Bumped versions
  • Loading branch information
Tommypop2 committed Aug 7, 2023
1 parent 3b4fb72 commit 56fb7c1
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solid-cli/core",
"version": "0.0.6",
"version": "0.0.7",
"description": "A CLI for Solid",
"main": "dist/index.mjs",
"bin": {
Expand All @@ -19,7 +19,8 @@
"detect-package-manager": "^2.0.1",
"execa": "^7.2.0",
"picocolors": "^1.0.0",
"smol-toml": "^1.1.1"
"smol-toml": "^1.1.1",
"tiny-updater": "^3.5.1"
},
"scripts": {
"start": "jiti ./src/index.ts",
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { handleData } from "./command_handlers/start/data";
import { handleRoute } from "./command_handlers/start/route";

import { t, setLocale } from "./translations";
import { version } from "../package.json";
import { name, version } from "../package.json";
import { configInst } from "./config";
import loadCommands from "./plugins/plugins_entry";

import updater from "tiny-updater";
import { createAsync } from "@solid-cli/reactivity";
const possibleActions = () =>
[
{ value: "add", label: t.ACTION_ADD, hint: "solid add ..." },
Expand Down Expand Up @@ -75,6 +76,7 @@ const provideSuggestions = async () => {
const main = async () => {
p.intro(`${color.bgCyan(color.black(" Solid-CLI "))}`);
await configInst.parseConfig();
const needsUpdate = createAsync(async () => await updater({ name, version }));
setLocale(configInst.field("lang"));
const cli = subcommands({
name: "solid",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("Update config", () => {
afterEach(() => {
writes = {};
});
it("Adds unocss correctly to the config", async () => {
it("Adds a plugin properly to the config", async () => {
await handleAdd(["unocss"]);
const newConfig = writes["vite.config.ts"];
const expected = await readFile("./packages/core/tests/assets/sample_unocss_result.txt");
Expand Down
7 changes: 7 additions & 0 deletions packages/core/tests/package_installs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expect, describe, it } from "vitest";

describe("Package Installs", () => {
it("should install packages correctly", () => {
expect(true).toBe(true);
});
});
2 changes: 1 addition & 1 deletion packages/reactivity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solid-cli/reactivity",
"version": "0.0.3",
"version": "0.0.4",
"description": "The minimal, eager reactive system that powers the Solid CLI",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 56fb7c1

Please sign in to comment.