@vue-skuilder/cli 0.1.7 → 0.1.8-1
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.
- package/README.md +122 -8
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +34 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pack.d.ts +10 -0
- package/dist/commands/pack.d.ts.map +1 -1
- package/dist/commands/pack.js +1 -1
- package/dist/commands/pack.js.map +1 -1
- package/dist/commands/studio.d.ts.map +1 -1
- package/dist/commands/studio.js +641 -106
- package/dist/commands/studio.js.map +1 -1
- package/dist/commands/unpack.d.ts +12 -0
- package/dist/commands/unpack.d.ts.map +1 -1
- package/dist/commands/unpack.js +1 -1
- package/dist/commands/unpack.js.map +1 -1
- package/dist/express-assets/app.d.ts +6 -0
- package/dist/express-assets/app.d.ts.map +1 -0
- package/dist/express-assets/app.js +209 -0
- package/dist/express-assets/app.js.map +1 -0
- package/dist/express-assets/assets/classroomDesignDoc.js +24 -0
- package/dist/express-assets/assets/courseValidateDocUpdate.js +56 -0
- package/dist/express-assets/assets/get-tagsDesignDoc.json +9 -0
- package/dist/express-assets/attachment-preprocessing/index.d.ts +11 -0
- package/dist/express-assets/attachment-preprocessing/index.d.ts.map +1 -0
- package/dist/express-assets/attachment-preprocessing/index.js +204 -0
- package/dist/express-assets/attachment-preprocessing/index.js.map +1 -0
- package/dist/express-assets/attachment-preprocessing/normalize.d.ts +7 -0
- package/dist/express-assets/attachment-preprocessing/normalize.d.ts.map +1 -0
- package/dist/express-assets/attachment-preprocessing/normalize.js +90 -0
- package/dist/express-assets/attachment-preprocessing/normalize.js.map +1 -0
- package/dist/express-assets/client-requests/classroom-requests.d.ts +26 -0
- package/dist/express-assets/client-requests/classroom-requests.d.ts.map +1 -0
- package/dist/express-assets/client-requests/classroom-requests.js +171 -0
- package/dist/express-assets/client-requests/classroom-requests.js.map +1 -0
- package/dist/express-assets/client-requests/course-requests.d.ts +10 -0
- package/dist/express-assets/client-requests/course-requests.d.ts.map +1 -0
- package/dist/express-assets/client-requests/course-requests.js +135 -0
- package/dist/express-assets/client-requests/course-requests.js.map +1 -0
- package/dist/express-assets/client-requests/pack-requests.d.ts +19 -0
- package/dist/express-assets/client-requests/pack-requests.d.ts.map +1 -0
- package/dist/express-assets/client-requests/pack-requests.js +130 -0
- package/dist/express-assets/client-requests/pack-requests.js.map +1 -0
- package/dist/express-assets/client.d.ts +31 -0
- package/dist/express-assets/client.d.ts.map +1 -0
- package/dist/express-assets/client.js +70 -0
- package/dist/express-assets/client.js.map +1 -0
- package/dist/express-assets/couchdb/authentication.d.ts +4 -0
- package/dist/express-assets/couchdb/authentication.d.ts.map +1 -0
- package/dist/express-assets/couchdb/authentication.js +69 -0
- package/dist/express-assets/couchdb/authentication.js.map +1 -0
- package/dist/express-assets/couchdb/index.d.ts +18 -0
- package/dist/express-assets/couchdb/index.d.ts.map +1 -0
- package/dist/express-assets/couchdb/index.js +52 -0
- package/dist/express-assets/couchdb/index.js.map +1 -0
- package/dist/express-assets/design-docs.d.ts +63 -0
- package/dist/express-assets/design-docs.d.ts.map +1 -0
- package/dist/express-assets/design-docs.js +90 -0
- package/dist/express-assets/design-docs.js.map +1 -0
- package/dist/express-assets/logger.d.ts +3 -0
- package/dist/express-assets/logger.d.ts.map +1 -0
- package/dist/express-assets/logger.js +62 -0
- package/dist/express-assets/logger.js.map +1 -0
- package/dist/express-assets/routes/logs.d.ts +3 -0
- package/dist/express-assets/routes/logs.d.ts.map +1 -0
- package/dist/express-assets/routes/logs.js +274 -0
- package/dist/express-assets/routes/logs.js.map +1 -0
- package/dist/express-assets/utils/env.d.ts +11 -0
- package/dist/express-assets/utils/env.d.ts.map +1 -0
- package/dist/express-assets/utils/env.js +39 -0
- package/dist/express-assets/utils/env.js.map +1 -0
- package/dist/express-assets/utils/processQueue.d.ts +39 -0
- package/dist/express-assets/utils/processQueue.d.ts.map +1 -0
- package/dist/express-assets/utils/processQueue.js +175 -0
- package/dist/express-assets/utils/processQueue.js.map +1 -0
- package/dist/studio-ui-src/App.vue +132 -0
- package/dist/studio-ui-src/api/index.ts +30 -0
- package/dist/studio-ui-src/components/StudioFlush.vue +108 -0
- package/dist/studio-ui-src/config/development.ts +98 -0
- package/dist/studio-ui-src/index.html +13 -0
- package/dist/studio-ui-src/main.ts +186 -0
- package/dist/studio-ui-src/package.json +35 -0
- package/dist/studio-ui-src/router/index.ts +32 -0
- package/dist/studio-ui-src/stores/useAuthStore.ts +3 -0
- package/dist/studio-ui-src/tsconfig.json +28 -0
- package/dist/studio-ui-src/utils/courseConfigRegistration.ts +297 -0
- package/dist/studio-ui-src/views/BrowseView.vue +82 -0
- package/dist/studio-ui-src/views/BulkImportView.vue +89 -0
- package/dist/studio-ui-src/views/CourseEditorView.vue +62 -0
- package/dist/studio-ui-src/views/CreateCardView.vue +144 -0
- package/dist/studio-ui-src/vite.config.base.js +103 -0
- package/dist/studio-ui-src/vite.config.ts +26 -0
- package/dist/templates/.skuilder/README.md +29 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/ExpressManager.d.ts +28 -0
- package/dist/utils/ExpressManager.d.ts.map +1 -0
- package/dist/utils/ExpressManager.js +166 -0
- package/dist/utils/ExpressManager.js.map +1 -0
- package/dist/utils/NodeFileSystemAdapter.d.ts +6 -0
- package/dist/utils/NodeFileSystemAdapter.d.ts.map +1 -1
- package/dist/utils/NodeFileSystemAdapter.js +29 -1
- package/dist/utils/NodeFileSystemAdapter.js.map +1 -1
- package/dist/utils/error-reporting.d.ts +54 -0
- package/dist/utils/error-reporting.d.ts.map +1 -0
- package/dist/utils/error-reporting.js +143 -0
- package/dist/utils/error-reporting.js.map +1 -0
- package/dist/utils/pack-courses.d.ts.map +1 -1
- package/dist/utils/pack-courses.js +10 -27
- package/dist/utils/pack-courses.js.map +1 -1
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +24 -0
- package/dist/utils/prompts.js.map +1 -1
- package/dist/utils/questions-hash.d.ts +22 -0
- package/dist/utils/questions-hash.d.ts.map +1 -0
- package/dist/utils/questions-hash.js +96 -0
- package/dist/utils/questions-hash.js.map +1 -0
- package/dist/utils/template.d.ts +1 -1
- package/dist/utils/template.d.ts.map +1 -1
- package/dist/utils/template.js +209 -27
- package/dist/utils/template.js.map +1 -1
- package/eslint.config.mjs +1 -1
- package/package.json +30 -11
- package/src/cli.ts +3 -1
- package/src/commands/init.ts +48 -3
- package/src/commands/pack.ts +1 -1
- package/src/commands/studio.ts +851 -122
- package/src/commands/unpack.ts +1 -1
- package/src/types.ts +5 -0
- package/src/utils/ExpressManager.ts +210 -0
- package/src/utils/NodeFileSystemAdapter.ts +46 -2
- package/src/utils/error-reporting.ts +192 -0
- package/src/utils/pack-courses.ts +11 -36
- package/src/utils/prompts.ts +34 -0
- package/src/utils/questions-hash.ts +109 -0
- package/src/utils/template.ts +243 -29
- package/templates/.skuilder/README.md +29 -0
- package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js +0 -2
- package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js.map +0 -1
- package/dist/studio-ui-assets/assets/BrowseView-CM4HBO4j.css +0 -1
- package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js +0 -2
- package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js.map +0 -1
- package/dist/studio-ui-assets/assets/BulkImportView-g4wQUfPA.css +0 -1
- package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js +0 -2
- package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js.map +0 -1
- package/dist/studio-ui-assets/assets/CourseEditorView-WuPNLVKp.css +0 -1
- package/dist/studio-ui-assets/assets/CreateCardView-CyNOKCkm.css +0 -1
- package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js +0 -2
- package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js.map +0 -1
- package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js +0 -330
- package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js.map +0 -1
- package/dist/studio-ui-assets/assets/index--zY88pg6.css +0 -14
- package/dist/studio-ui-assets/assets/index-BnAv1C72.js +0 -287
- package/dist/studio-ui-assets/assets/index-BnAv1C72.js.map +0 -1
- package/dist/studio-ui-assets/assets/index-DHMXQY3-.js +0 -192
- package/dist/studio-ui-assets/assets/index-DHMXQY3-.js.map +0 -1
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-B7mPwVP_.ttf +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-CSr8KVlo.eot +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-PXm3-2wK.woff +0 -0
- package/dist/studio-ui-assets/assets/vue-DZcMATiC.js +0 -28
- package/dist/studio-ui-assets/assets/vue-DZcMATiC.js.map +0 -1
- package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js +0 -6
- package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js.map +0 -1
- package/dist/studio-ui-assets/index.html +0 -16
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.8-1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"description": "CLI scaffolding tool for vue-skuilder projects",
|
|
9
9
|
"bin": {
|
|
@@ -18,13 +18,16 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "rm -rf dist && npm run build:
|
|
22
|
-
"build:
|
|
23
|
-
"embed:studio-ui": "mkdir -p dist/studio-ui-
|
|
21
|
+
"build": "rm -rf dist && npm run build:express && tsc && npm run embed:studio-ui-src && npm run embed:express && npm run embed:templates",
|
|
22
|
+
"build:express": "cd ../express && npm run build",
|
|
23
|
+
"embed:studio-ui-src": "mkdir -p dist/studio-ui-src && cp -r ../studio-ui/src/* dist/studio-ui-src/ && cp ../studio-ui/package.json dist/studio-ui-src/ && cp ../studio-ui/vite.config.ts dist/studio-ui-src/ && cp ../studio-ui/tsconfig.json dist/studio-ui-src/ && cp ../studio-ui/index.html dist/studio-ui-src/ && cp ../../vite.config.base.js dist/studio-ui-src/ && sed -i 's|../../vite.config.base.js|./vite.config.base.js|' dist/studio-ui-src/vite.config.ts && sed -i 's|resolve(__dirname, \\.\\., \\.\\.)|resolve(__dirname)|' dist/studio-ui-src/vite.config.ts && sed -i 's|/src/main.ts|./main.ts|' dist/studio-ui-src/index.html",
|
|
24
|
+
"embed:express": "mkdir -p dist/express-assets && cp -r ../express/dist/* dist/express-assets/ && cp -r ../express/assets dist/express-assets/",
|
|
25
|
+
"embed:templates": "mkdir -p dist/templates && cp -r templates/.skuilder dist/templates/",
|
|
24
26
|
"dev": "tsc --watch",
|
|
25
27
|
"lint": "npx eslint .",
|
|
26
28
|
"lint:fix": "npx eslint . --fix",
|
|
27
|
-
"lint:check": "npx eslint . --max-warnings 0"
|
|
29
|
+
"lint:check": "npx eslint . --max-warnings 0",
|
|
30
|
+
"try:init": "node dist/cli.js init testproject --dangerously-clobber --no-interactive --data-layer static --import-course-data --import-server-url http://localhost:5984 --import-username admin --import-password password --import-course-ids 2aeb8315ef78f3e89ca386992d00825b && cd testproject && npm i && npm install --save-dev @vue-skuilder/cli@file:.. && npm install @vue-skuilder/db@file:../../db @vue-skuilder/courseware@file:../../courseware @vue-skuilder/common-ui@file:../../common-ui"
|
|
28
31
|
},
|
|
29
32
|
"keywords": [
|
|
30
33
|
"cli",
|
|
@@ -35,23 +38,39 @@
|
|
|
35
38
|
"course"
|
|
36
39
|
],
|
|
37
40
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@vue-skuilder/
|
|
41
|
+
"@mdi/font": "^7.3.67",
|
|
42
|
+
"@vue-skuilder/common": "0.1.8-1",
|
|
43
|
+
"@vue-skuilder/common-ui": "0.1.8-1",
|
|
44
|
+
"@vue-skuilder/courseware": "0.1.8-1",
|
|
45
|
+
"@vue-skuilder/db": "0.1.8-1",
|
|
46
|
+
"@vue-skuilder/edit-ui": "0.1.8-1",
|
|
47
|
+
"@vue-skuilder/standalone-ui": "^0.1.8-1",
|
|
40
48
|
"chalk": "^5.3.0",
|
|
41
49
|
"commander": "^11.0.0",
|
|
42
50
|
"fs-extra": "^11.2.0",
|
|
43
51
|
"inquirer": "^9.2.0",
|
|
44
|
-
"
|
|
52
|
+
"pinia": "^2.3.0",
|
|
53
|
+
"pouchdb": "^9.0.0",
|
|
54
|
+
"serve-static": "^1.15.0",
|
|
55
|
+
"vue": "^3.5.13",
|
|
56
|
+
"vue-router": "^4.2.0",
|
|
57
|
+
"vuetify": "^3.7.0"
|
|
45
58
|
},
|
|
46
59
|
"devDependencies": {
|
|
47
60
|
"@types/fs-extra": "^11.0.0",
|
|
48
61
|
"@types/inquirer": "^9.0.0",
|
|
49
62
|
"@types/node": "^20.0.0",
|
|
50
|
-
"@
|
|
51
|
-
"
|
|
63
|
+
"@types/serve-static": "^1.15.0",
|
|
64
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
65
|
+
"@vue-skuilder/express": "0.1.8-1",
|
|
66
|
+
"@vue-skuilder/studio-ui": "0.1.8-1",
|
|
67
|
+
"typescript": "~5.7.2",
|
|
68
|
+
"vite": "^6.0.9",
|
|
69
|
+
"vue-tsc": "^1.8.0"
|
|
52
70
|
},
|
|
53
71
|
"engines": {
|
|
54
72
|
"node": ">=18.0.0"
|
|
55
73
|
},
|
|
56
|
-
"packageManager": "yarn@4.6.0"
|
|
74
|
+
"packageManager": "yarn@4.6.0",
|
|
75
|
+
"stableVersion": "0.1.7"
|
|
57
76
|
}
|
package/src/cli.ts
CHANGED
|
@@ -16,12 +16,14 @@ const __dirname = dirname(__filename);
|
|
|
16
16
|
const packagePath = join(__dirname, '..', 'package.json');
|
|
17
17
|
const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
18
18
|
|
|
19
|
+
export const VERSION: string = packageJson.version;
|
|
20
|
+
|
|
19
21
|
const program = new Command();
|
|
20
22
|
|
|
21
23
|
program
|
|
22
24
|
.name('skuilder')
|
|
23
25
|
.description('CLI tool for scaffolding Skuilder course applications')
|
|
24
|
-
.version(
|
|
26
|
+
.version(VERSION);
|
|
25
27
|
|
|
26
28
|
// Add commands
|
|
27
29
|
program.addCommand(createInitCommand());
|
package/src/commands/init.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import { existsSync, readFileSync } from 'fs';
|
|
3
|
+
import { existsSync, readFileSync, rmSync } from 'fs';
|
|
4
4
|
import path, { dirname, join } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { CliOptions, PREDEFINED_THEMES } from '../types.js';
|
|
@@ -24,6 +24,12 @@ export function createInitCommand(): Command {
|
|
|
24
24
|
.option('--no-interactive', 'skip interactive prompts')
|
|
25
25
|
.option('--couchdb-url <url>', 'CouchDB server URL (for dynamic data layer)')
|
|
26
26
|
.option('--course-id <id>', 'course ID to import (for dynamic data layer)')
|
|
27
|
+
.option('--import-course-data', 'import course data from CouchDB (for static data layer)')
|
|
28
|
+
.option('--import-server-url <url>', 'CouchDB server URL for course import (for static data layer)')
|
|
29
|
+
.option('--import-username <username>', 'username for course import server')
|
|
30
|
+
.option('--import-password <password>', 'password for course import server')
|
|
31
|
+
.option('--import-course-ids <ids>', 'comma-separated course IDs to import')
|
|
32
|
+
.option('--dangerously-clobber', 'overwrite existing directory')
|
|
27
33
|
.action(initCommand);
|
|
28
34
|
}
|
|
29
35
|
|
|
@@ -33,6 +39,12 @@ interface InitOptions {
|
|
|
33
39
|
interactive: boolean;
|
|
34
40
|
couchdbUrl?: string;
|
|
35
41
|
courseId?: string;
|
|
42
|
+
importCourseData?: boolean;
|
|
43
|
+
importServerUrl?: string;
|
|
44
|
+
importUsername?: string;
|
|
45
|
+
importPassword?: string;
|
|
46
|
+
importCourseIds?: string;
|
|
47
|
+
dangerouslyClobber?: boolean;
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
async function initCommand(projectName: string, options: InitOptions): Promise<void> {
|
|
@@ -45,6 +57,29 @@ async function initCommand(projectName: string, options: InitOptions): Promise<v
|
|
|
45
57
|
process.exit(1);
|
|
46
58
|
}
|
|
47
59
|
|
|
60
|
+
// Validate that import-* options require --import-course-data flag
|
|
61
|
+
const importOptions = [
|
|
62
|
+
{ flag: '--import-server-url', value: options.importServerUrl },
|
|
63
|
+
{ flag: '--import-username', value: options.importUsername },
|
|
64
|
+
{ flag: '--import-password', value: options.importPassword },
|
|
65
|
+
{ flag: '--import-course-ids', value: options.importCourseIds }
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const usedImportOptions = importOptions.filter(opt => opt.value !== undefined);
|
|
69
|
+
|
|
70
|
+
if (usedImportOptions.length > 0 && !options.importCourseData) {
|
|
71
|
+
console.error(
|
|
72
|
+
chalk.red('❌ Import options require the --import-course-data flag.')
|
|
73
|
+
);
|
|
74
|
+
console.error(
|
|
75
|
+
chalk.yellow(`Used options: ${usedImportOptions.map(opt => opt.flag).join(', ')}`)
|
|
76
|
+
);
|
|
77
|
+
console.error(
|
|
78
|
+
chalk.yellow('Add --import-course-data to enable course data import.')
|
|
79
|
+
);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
|
|
48
83
|
// Validate theme option
|
|
49
84
|
const validThemes = Object.keys(PREDEFINED_THEMES);
|
|
50
85
|
if (!validThemes.includes(options.theme)) {
|
|
@@ -60,8 +95,13 @@ async function initCommand(projectName: string, options: InitOptions): Promise<v
|
|
|
60
95
|
// Check if directory already exists
|
|
61
96
|
const projectPath = path.resolve(process.cwd(), projectName);
|
|
62
97
|
if (existsSync(projectPath)) {
|
|
63
|
-
|
|
64
|
-
|
|
98
|
+
if (options.dangerouslyClobber) {
|
|
99
|
+
console.log(chalk.yellow(`--dangerously-clobber specified, removing existing directory: ${projectPath}`));
|
|
100
|
+
rmSync(projectPath, { recursive: true, force: true });
|
|
101
|
+
} else {
|
|
102
|
+
console.error(chalk.red(`❌ Directory "${projectName}" already exists.`));
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
65
105
|
}
|
|
66
106
|
|
|
67
107
|
// Get CLI version for dependency transformation
|
|
@@ -76,6 +116,11 @@ async function initCommand(projectName: string, options: InitOptions): Promise<v
|
|
|
76
116
|
interactive: options.interactive,
|
|
77
117
|
couchdbUrl: options.couchdbUrl,
|
|
78
118
|
courseId: options.courseId,
|
|
119
|
+
importCourseData: options.importCourseData,
|
|
120
|
+
importServerUrl: options.importServerUrl,
|
|
121
|
+
importUsername: options.importUsername,
|
|
122
|
+
importPassword: options.importPassword,
|
|
123
|
+
importCourseIds: options.importCourseIds,
|
|
79
124
|
};
|
|
80
125
|
|
|
81
126
|
// Gather project configuration
|
package/src/commands/pack.ts
CHANGED
|
@@ -27,7 +27,7 @@ interface PackOptions {
|
|
|
27
27
|
noAttachments: boolean;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async function packCourse(courseId: string, options: PackOptions) {
|
|
30
|
+
export async function packCourse(courseId: string, options: PackOptions) {
|
|
31
31
|
try {
|
|
32
32
|
console.log(chalk.cyan(`🔧 Packing course: ${courseId}`));
|
|
33
33
|
|