diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a1dbc7..d755fd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- **First-run guidance:** `coursecode create` now tells you to open the project in your AI tool and describe the course. Projects created through the plugin skip that step because the AI tool is already running. +- **README:** Quick Start leads with the Claude Code and Codex plugin, then the `npx` path. +- **New project tooling:** New projects use ESLint 10, and `create` no longer prints npm's audit and funding notices. +- **Package homepage:** The npm `homepage` points to coursecodeframework.com. + +### Fixed +- **Commands that failed without a global install:** The commands `create` prints now use `npx coursecode`, so they work after `npx coursecode create`. +- **New course metadata:** New projects start at version `1.0.0` instead of `2.0.0` and no longer carry the template author's name. Their first package is named `_v1.0.0_.zip`. +- **`narration` help:** The command description lists all five text-to-speech providers instead of only ElevenLabs. + ## [0.4.3] - 2026-10-29 ### Added diff --git a/README.md b/README.md index 02ac03f..845f62c 100644 --- a/README.md +++ b/README.md @@ -33,27 +33,29 @@ Framework documentation lives at [coursecodeframework.com/docs](https://courseco --- -## Installation +## Quick Start -### Required +### With the plugin (recommended) -[Node.js](https://nodejs.org/) 22.15 or later. You can run every command through `npx coursecode`, or install the CLI globally for the shorter `coursecode` command: +The Claude Code and Codex plugin guides your AI tool from a new project to an LMS package, and it works before a project exists. It is not yet in the Claude Code or Codex plugin directories, so install it from this repository: ```bash -npm install -g coursecode -``` +# Claude Code +claude plugin marketplace add course-code-framework/coursecode +claude plugin install coursecode@coursecode -Learner courses support Chrome 111+, Edge 111+, Firefox 114+, and Safari 16.4+. SCORM compatibility describes LMS communication and packaging; it does not imply Internet Explorer support. +# Codex +codex plugin marketplace add course-code-framework/coursecode +codex plugin add coursecode@coursecode +``` -### Recommended +Then start your AI tool in an empty folder and describe the course you want. -- A code or text editor, such as [VS Code](https://code.visualstudio.com/), [Cursor](https://cursor.com/), or similar -- An AI coding tool with MCP support, such as [Claude Code](https://claude.com/claude-code), [Codex](https://developers.openai.com/codex), [Cursor](https://cursor.com/), or VS Code with GitHub Copilot -- [GitHub Desktop](https://desktop.github.com/) for version control +The plugin needs [Node.js](https://nodejs.org/) 22.15 or later but no global `coursecode` install. If Node.js is missing, its `setup` skill offers to install it. The plugin bundles the MCP server below and six skills: setup, new-course, outline, build-slides, review, and publish. See [plugin/README.md](plugin/README.md). ---- +### With npx -## Quick Start +With [Node.js](https://nodejs.org/) 22.15 or later installed, create a project: ```bash npx coursecode create my-course @@ -76,21 +78,21 @@ Start with the [User Guide](framework/docs/USER_GUIDE.md) for a complete walkthr --- -## Claude Code and Codex Plugin +## Requirements -The plugin adds guided skills for each stage, from a new project to an LMS package, and works before a project exists. Start your AI tool in an empty folder and describe the course you want. It is not yet in the Claude Code or Codex plugin directories, so install it from this repository: +[Node.js](https://nodejs.org/) 22.15 or later. You can run every command through `npx coursecode`, or install the CLI globally for the shorter `coursecode` command used in the rest of this guide: ```bash -# Claude Code -claude plugin marketplace add course-code-framework/coursecode -claude plugin install coursecode@coursecode - -# Codex -codex plugin marketplace add course-code-framework/coursecode -codex plugin add coursecode@coursecode +npm install -g coursecode ``` -The plugin bundles the MCP server below and six skills: setup, new-course, outline, build-slides, review, and publish. It needs Node.js but no global `coursecode` install. See [plugin/README.md](plugin/README.md). +Learner courses support Chrome 111+, Edge 111+, Firefox 114+, and Safari 16.4+. SCORM compatibility describes LMS communication and packaging; it does not imply Internet Explorer support. + +Also recommended: + +- A code or text editor, such as [VS Code](https://code.visualstudio.com/), [Cursor](https://cursor.com/), or similar +- An AI coding tool with MCP support, such as [Claude Code](https://claude.com/claude-code), [Codex](https://developers.openai.com/codex), [Cursor](https://cursor.com/), or VS Code with GitHub Copilot +- [GitHub Desktop](https://desktop.github.com/) for version control --- diff --git a/bin/cli.js b/bin/cli.js index bcabbb0..7a949ad 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -184,7 +184,7 @@ program // Narration command program .command('narration') - .description('Generate audio narration from text using ElevenLabs') + .description('Generate audio narration from text using ElevenLabs, OpenAI, Azure, Google Cloud, or Deepgram') .option('-f, --force', 'Regenerate all narration (ignore cache)') .option('-s, --slide ', 'Generate narration for a specific slide only') .option('--dry-run', 'Preview what would be generated') diff --git a/framework/scripts/tts-providers/index.js b/framework/scripts/tts-providers/index.js index 75a1a98..093de8a 100644 --- a/framework/scripts/tts-providers/index.js +++ b/framework/scripts/tts-providers/index.js @@ -9,7 +9,7 @@ * 3. Default to deepgram * * Environment Variables: - * TTS_PROVIDER - Explicit provider selection: elevenlabs, openai, azure + * TTS_PROVIDER - Explicit provider selection: elevenlabs, openai, azure, google, deepgram */ import { ElevenLabsProvider } from './elevenlabs-provider.js'; diff --git a/lib/create.js b/lib/create.js index f22111e..2e13d89 100644 --- a/lib/create.js +++ b/lib/create.js @@ -13,7 +13,7 @@ const PACKAGE_ROOT = path.join(__dirname, '..'); const REQUIRED_PROJECT_DIRECTORIES = [ { path: path.join('course', 'references'), - placeholder: '# Place source documents here (docx, pptx, pdf)\n# Run `coursecode convert` to convert them to markdown\n' + placeholder: '# Place source documents here (docx, pptx, pdf)\n# Run `npx coursecode convert` to convert them to markdown\n' }, { path: path.join('course', 'references', 'converted'), @@ -169,7 +169,8 @@ function npmInstall(cwd) { return new Promise((resolve, reject) => { const npmCli = process.env.COURSECODE_NPM_CLI; const command = npmCli ? process.execPath : 'npm'; - const args = npmCli ? [npmCli, 'install'] : ['install']; + const installArgs = ['install', '--no-audit', '--no-fund']; + const args = npmCli ? [npmCli, ...installArgs] : installArgs; const child = spawn(command, args, { cwd, stdio: 'inherit', @@ -187,6 +188,19 @@ function npmInstall(cwd) { }); } +/** + * Next steps after create. Commands use npx because the project's own CLI + * works whether or not coursecode is installed globally. + */ +export function formatNextSteps({ directoryName, currentDirectory = false, plugin = false }) { + const changeDirectory = currentDirectory ? '' : `cd ${directoryName}\n `; + const preview = `To preview your course:\n\n ${plugin ? changeDirectory : ''}npx coursecode preview\n\n Then open http://localhost:4173\n`; + + if (plugin) return `\n ${preview}`; + + return `\n Open the project in your AI tool and describe the course you want:\n\n ${changeDirectory}claude # or codex, or open the folder in Cursor or VS Code\n\n ${preview}`; +} + /** * Initialize git repository */ @@ -350,8 +364,8 @@ export async function create(name, options = {}) { Next steps: - Edit course-config.js with your course metadata - - Create slides with: coursecode new slide - - Create assessments with: coursecode new assessment + - Create slides with: npx coursecode new slide + - Create assessments with: npx coursecode new assessment `); } else { console.log(` @@ -365,8 +379,8 @@ export async function create(name, options = {}) { The project includes example slides (prefixed with "example-") that demonstrate framework features. When ready to build your own course: - - Run: coursecode clean - - Or create a blank project: coursecode create --blank + - Run: npx coursecode clean + - Or create a blank project: npx coursecode create --blank `); } @@ -384,11 +398,10 @@ export async function create(name, options = {}) { child.on('error', () => { console.warn(' ⚠️ Failed to start preview server. Run manually:'); - console.log(` cd ${directoryName} && coursecode preview\n`); + console.log(` cd ${directoryName} && npx coursecode preview\n`); }); } else { - const changeDirectory = currentDirectory ? '' : `cd ${directoryName}\n `; - console.log(`\n To preview your course:\n\n ${changeDirectory}coursecode preview\n\n Then open http://localhost:4173\n`); + console.log(formatNextSteps({ directoryName, currentDirectory, plugin: options.plugin === true })); } return { diff --git a/package.json b/package.json index 4bb7e36..4e6da73 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "bugs": { "url": "https://github.com/course-code-framework/coursecode/issues" }, - "homepage": "https://github.com/course-code-framework/coursecode/blob/main/framework/docs/USER_GUIDE.md", + "homepage": "https://coursecodeframework.com", "engines": { "node": ">=22.15.0" }, diff --git a/template/course/course-config.js b/template/course/course-config.js index 9ab06d1..de7a92c 100644 --- a/template/course/course-config.js +++ b/template/course/course-config.js @@ -135,8 +135,7 @@ export const courseConfig = { metadata: { title: 'CourseCode', description: 'CourseCode template for course development', - version: '2.0.0', - author: 'Seth Vincent', + version: '1.0.0', language: 'en' }, layout: 'article', diff --git a/template/package.json b/template/package.json index 6486db5..bf70506 100644 --- a/template/package.json +++ b/template/package.json @@ -22,7 +22,7 @@ }, "devDependencies": { "archiver": "^8.0.0", - "eslint": "^9.39.4", + "eslint": "^10.13.0", "globals": "^17.7.0", "vite": "~8.1.6", "vite-plugin-static-copy": "^4.1.1" diff --git a/tests/create.test.js b/tests/create.test.js index 712098a..cce08d5 100644 --- a/tests/create.test.js +++ b/tests/create.test.js @@ -1,9 +1,10 @@ -import { describe, it, expect, beforeEach, afterEach } from 'vitest'; +import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import fs from 'fs'; import os from 'os'; import path from 'path'; import { create, + formatNextSteps, stampCourseTitle, toCurrentDirectoryCourseTitle, toCurrentDirectoryPackageName, @@ -67,7 +68,50 @@ export const courseConfig = { }); }); +describe('formatNextSteps', () => { + it('sends new projects to an AI tool and keeps the preview command', () => { + const message = formatNextSteps({ directoryName: 'my-course' }); + + expect(message).toContain('cd my-course\n claude'); + expect(message).toContain('Cursor or VS Code'); + expect(message).toContain('npx coursecode preview'); + }); + + it('skips the AI tool step when the plugin created the project', () => { + const message = formatNextSteps({ directoryName: 'my-course', currentDirectory: true, plugin: true }); + + expect(message).not.toContain('claude'); + expect(message).not.toContain('cd my-course'); + expect(message).toContain('npx coursecode preview'); + }); +}); + describe('create', () => { + it.each([ + ['example', {}], + ['blank', { blank: true }] + ])('prints commands that work without a global install for %s projects', async (_label, options) => { + const log = vi.spyOn(console, 'log').mockImplementation(() => {}); + + try { + await create('Npx Course', { install: false, ...options }); + const output = log.mock.calls.flat().join('\n'); + + expect(output).toContain('npx coursecode'); + expect(output).not.toMatch(/(? { + await create('Version Course', { install: false }); + + const config = fs.readFileSync(path.join(tempDir, 'version-course', 'course', 'course-config.js'), 'utf-8'); + expect(config).toContain("version: '1.0.0'"); + expect(config).not.toMatch(/^\s*author:/m); + }); + it('creates a directory-safe project and stamps the human course title', async () => { const result = await create('CourseCode Demo', { install: false });