coursecode 0.1.56 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.56",
2
+ "version": "0.1.57",
3
3
  "name": "CourseCode Framework",
4
4
  "description": "Multi-format course authoring and learner runtime framework",
5
5
  "released": "2026-07-11",
@@ -9,7 +9,7 @@
9
9
 
10
10
  import fs from 'fs';
11
11
  import path from 'path';
12
- import archiver from 'archiver';
12
+ import { ZipArchive } from 'archiver';
13
13
  import { fileURLToPath } from 'url';
14
14
  import { generateManifest } from './manifest/manifest-factory.js';
15
15
 
@@ -35,7 +35,7 @@ function withClientCredentials(externalUrl, clientId, token) {
35
35
  function zipDirectory(sourceDir, zipFilePath) {
36
36
  return new Promise((resolve, reject) => {
37
37
  const output = fs.createWriteStream(zipFilePath);
38
- const archive = archiver('zip', { zlib: { level: 9 } });
38
+ const archive = new ZipArchive({ zlib: { level: 9 } });
39
39
 
40
40
  output.on('close', () => resolve(archive.pointer()));
41
41
  archive.on('error', reject);
package/lib/create.js CHANGED
@@ -9,6 +9,16 @@ import { spawn } from 'child_process';
9
9
 
10
10
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
11
  const PACKAGE_ROOT = path.join(__dirname, '..');
12
+ const REQUIRED_PROJECT_DIRECTORIES = [
13
+ {
14
+ path: path.join('course', 'references'),
15
+ placeholder: '# Place source documents here (docx, pptx, pdf)\n# Run `coursecode convert` to convert them to markdown\n'
16
+ },
17
+ {
18
+ path: path.join('course', 'references', 'converted'),
19
+ placeholder: '# Converted markdown files will be placed here\n# These can be used as source material for AI-assisted course creation\n'
20
+ }
21
+ ];
12
22
 
13
23
  export function toProjectDirectoryName(name) {
14
24
  return String(name || '')
@@ -103,6 +113,18 @@ function copyDir(src, dest, options = {}) {
103
113
  }
104
114
  }
105
115
 
116
+ function ensureRequiredProjectDirectories(projectDir) {
117
+ for (const directory of REQUIRED_PROJECT_DIRECTORIES) {
118
+ const directoryPath = path.join(projectDir, directory.path);
119
+ const placeholderPath = path.join(directoryPath, '.gitkeep');
120
+ fs.mkdirSync(directoryPath, { recursive: true });
121
+
122
+ if (!fs.existsSync(placeholderPath)) {
123
+ fs.writeFileSync(placeholderPath, directory.placeholder, 'utf-8');
124
+ }
125
+ }
126
+ }
127
+
106
128
  function mergeProjectControlFile(sourcePath, destinationPath) {
107
129
  const source = fs.readFileSync(sourcePath, 'utf-8').trimEnd();
108
130
  if (!fs.existsSync(destinationPath)) {
@@ -231,6 +253,7 @@ export async function create(name, options = {}) {
231
253
  });
232
254
  mergeProjectControlFile(path.join(templateDir, 'gitignore'), path.join(targetDir, '.gitignore'));
233
255
  mergeProjectControlFile(path.join(templateDir, 'gitattributes'), path.join(targetDir, '.gitattributes'));
256
+ ensureRequiredProjectDirectories(targetDir);
234
257
 
235
258
  // Copy framework
236
259
  const frameworkSrc = path.join(PACKAGE_ROOT, 'framework');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coursecode",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "description": "Multi-format course authoring framework with CLI tools (SCORM 2004, SCORM 1.2, cmi5, LTI 1.3)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -104,7 +104,7 @@
104
104
  "dependencies": {
105
105
  "@modelcontextprotocol/sdk": "^1.29.0",
106
106
  "acorn": "^8.17.0",
107
- "archiver": "^7.0.1",
107
+ "archiver": "^8.0.0",
108
108
  "commander": "^14.0.3",
109
109
  "lz-string": "^1.5.0",
110
110
  "mammoth": "^1.12.0",
@@ -21,7 +21,7 @@
21
21
  "marked-gfm-heading-id": "^4.1.4"
22
22
  },
23
23
  "devDependencies": {
24
- "archiver": "^7.0.1",
24
+ "archiver": "^8.0.0",
25
25
  "eslint": "^9.39.4",
26
26
  "vite": "~8.1.4",
27
27
  "vite-plugin-static-copy": "^4.1.1"