diff --git a/examples/scratchpad/index.js b/examples/scratchpad/index.js new file mode 100644 index 0000000..e69de29 diff --git a/examples/scratchpad/index.test.js b/examples/scratchpad/index.test.js new file mode 100644 index 0000000..37a949f --- /dev/null +++ b/examples/scratchpad/index.test.js @@ -0,0 +1,5 @@ +import { test, expect } from 'vitest'; + +test('a super simple test', () => { + expect(true).toBe(true); +}); diff --git a/packages/utility-belt/package.json b/examples/scratchpad/package.json similarity index 71% rename from packages/utility-belt/package.json rename to examples/scratchpad/package.json index fe4971b..ba33efb 100644 --- a/packages/utility-belt/package.json +++ b/examples/scratchpad/package.json @@ -1,11 +1,11 @@ { - "name": "utility-belt", + "name": "scratchpad", "version": "1.0.0", - "description": "Some little utilities", "main": "index.js", "type": "module", "scripts": { - "types": "tsc --emitDeclarationOnly --allowJs --declaration --skipLibCheck index.js" + "start": "vitest --ui", + "test": "vitest" }, "repository": { "type": "git", @@ -18,6 +18,8 @@ }, "homepage": "https://github.com/stevekinney/testing-javascript#readme", "devDependencies": { - "typescript": "^5.6.2" + "@vitest/ui": "^2.1.1", + "vite": "^5.4.5", + "vitest": "^2.1.1" } } diff --git a/package-lock.json b/package-lock.json index db8703f..00a07da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,9 @@ "examples/accident-counter", "packages/css-configuration", "packages/utility-belt", - "examples/yearbook" + "examples/yearbook", + "packages/scratchpad", + "examples/scratchpad" ], "devDependencies": { "prettier": "^3.3.3", @@ -124,6 +126,11 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "examples/scratchpad": { + "version": "1.0.0", + "license": "ISC", + "devDependencies": {} + }, "examples/task-list": { "version": "1.0.0", "license": "MIT", @@ -2814,10 +2821,6 @@ "node": ">= 8" } }, - "node_modules/css-configuration": { - "resolved": "packages/css-configuration", - "link": true - }, "node_modules/css.escape": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", @@ -5283,6 +5286,10 @@ "loose-envify": "^1.1.0" } }, + "node_modules/scratchpad": { + "resolved": "examples/scratchpad", + "link": true + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -6011,20 +6018,6 @@ "node": ">= 0.6" } }, - "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", @@ -6104,10 +6097,6 @@ "dev": true, "license": "MIT" }, - "node_modules/utility-belt": { - "resolved": "packages/utility-belt", - "link": true - }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -6640,6 +6629,7 @@ }, "packages/css-configuration": { "version": "1.0.0", + "extraneous": true, "license": "MIT", "devDependencies": { "autoprefixer": "^10.4.20", @@ -6648,6 +6638,12 @@ "vite": "^5.4.6" } }, + "packages/scratchpad": { + "version": "1.0.0", + "extraneous": true, + "license": "ISC", + "devDependencies": {} + }, "packages/utilities": { "name": "utility-belt", "version": "1.0.0", @@ -6659,6 +6655,7 @@ }, "packages/utility-belt": { "version": "1.0.0", + "extraneous": true, "license": "MIT", "devDependencies": { "typescript": "^5.6.2" diff --git a/package.json b/package.json index b0e3cf9..fe6f403 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,9 @@ "examples/accident-counter", "packages/css-configuration", "packages/utility-belt", - "examples/yearbook" + "examples/yearbook", + "packages/scratchpad", + "examples/scratchpad" ], "devDependencies": { "prettier": "^3.3.3", diff --git a/packages/css-configuration/index.d.ts b/packages/css-configuration/index.d.ts deleted file mode 100644 index 56bbdb9..0000000 --- a/packages/css-configuration/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * @type import('vite').UserConfig['css'] - */ -export const css: import('vite').UserConfig['css']; diff --git a/packages/css-configuration/index.js b/packages/css-configuration/index.js deleted file mode 100644 index 832ea97..0000000 --- a/packages/css-configuration/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import nesting from 'tailwindcss/nesting/index.js'; -import tailwindcss from 'tailwindcss'; -import autoprefixer from 'autoprefixer'; - -/** - * @type import('vite').UserConfig['css'] - */ -export const css = { - postcss: { - plugins: [ - tailwindcss({ - content: ['./**/*.{html,js,jsx,ts,tsx}'], - theme: { - extend: { - container: { - center: true, - padding: '1rem', - }, - colors: { - primary: { - 50: '#f3faeb', - 100: '#e5f3d4', - 200: '#cde8ae', - 300: '#acd87e', - 400: '#8ec655', - 500: '#6ca635', - 600: '#558828', - 700: '#426823', - 800: '#375420', - 900: '#30481f', - 950: '#17270c', - }, - }, - }, - }, - plugins: [], - }), - nesting, - autoprefixer, - ], - }, -}; diff --git a/packages/css-configuration/package.json b/packages/css-configuration/package.json deleted file mode 100644 index 131fa15..0000000 --- a/packages/css-configuration/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "css-configuration", - "version": "1.0.0", - "description": "Some CSS settings for Vite/PostCSS that includes Tailwind", - "main": "index.js", - "type": "module", - "scripts": { - "types": "tsc --emitDeclarationOnly --allowJs --declaration --skipLibCheck index.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/stevekinney/testing-javascript.git" - }, - "author": "Steve Kinney ", - "license": "MIT", - "bugs": { - "url": "https://github.com/stevekinney/testing-javascript/issues" - }, - "homepage": "https://github.com/stevekinney/testing-javascript#readme", - "devDependencies": { - "autoprefixer": "^10.4.20", - "tailwindcss": "^3.4.12", - "typescript": "^5.6.2", - "vite": "^5.4.6" - } -} diff --git a/packages/utility-belt/index.d.ts b/packages/utility-belt/index.d.ts deleted file mode 100644 index 2271bf0..0000000 --- a/packages/utility-belt/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type RequireOnly = Partial & - Required>; -export declare const isError: (error: unknown) => error is Error; -export declare const getErrorMessage: ( - error: unknown, - defaultMessage: string, -) => string; diff --git a/packages/utility-belt/index.js b/packages/utility-belt/index.js deleted file mode 100644 index 07f50f6..0000000 --- a/packages/utility-belt/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * @param {unknown} error The error object to check. - * @returns {error is Error} - */ -export const isError = (error) => error instanceof Error; - -/** - * Get the error message from an error object or return a default message. - * @param {unknown} error The error object to check. - * @param {string} defaultMessage The default message to return if the error is not an instance of Error. - * @returns {string} The error message or the default message. - */ -export const getErrorMessage = (error, defaultMessage) => { - return isError(error) ? error.message : defaultMessage; -};