@edpire/sdk 0.6.1 → 0.6.3
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/bin/create.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
const { cpSync, existsSync } = require('node:fs')
|
|
5
|
+
const { resolve } = require('node:path')
|
|
6
|
+
|
|
7
|
+
const TEMPLATES = ['nextjs', 'vite-express']
|
|
8
|
+
const [, , template, dest] = process.argv
|
|
9
|
+
|
|
10
|
+
function usage() {
|
|
11
|
+
console.error('Usage: create-edpire-app <template> <directory>')
|
|
12
|
+
console.error()
|
|
13
|
+
console.error('Templates:')
|
|
14
|
+
TEMPLATES.forEach((t) => console.error(` ${t}`))
|
|
15
|
+
console.error()
|
|
16
|
+
console.error('Example:')
|
|
17
|
+
console.error(' npx --package=@edpire/sdk create-edpire-app nextjs ./my-app')
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!template || !TEMPLATES.includes(template)) {
|
|
21
|
+
console.error(template ? `Unknown template: "${template}"` : 'Template required.')
|
|
22
|
+
console.error()
|
|
23
|
+
usage()
|
|
24
|
+
process.exit(1)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!dest) {
|
|
28
|
+
console.error('Destination directory required.')
|
|
29
|
+
console.error()
|
|
30
|
+
usage()
|
|
31
|
+
process.exit(1)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const src = resolve(__dirname, '..', 'examples', template)
|
|
35
|
+
|
|
36
|
+
if (!existsSync(src)) {
|
|
37
|
+
console.error(`Template source not found: ${src}`)
|
|
38
|
+
console.error('Try reinstalling @edpire/sdk.')
|
|
39
|
+
process.exit(1)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (existsSync(dest)) {
|
|
43
|
+
console.error(`Directory already exists: "${dest}"`)
|
|
44
|
+
console.error('Choose a different destination or remove the existing directory.')
|
|
45
|
+
process.exit(1)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
cpSync(src, dest, { recursive: true })
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.error(`Failed to copy template: ${err.message}`)
|
|
52
|
+
process.exit(1)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log(`✓ Created "${dest}" from the ${template} template.`)
|
|
56
|
+
console.log()
|
|
57
|
+
console.log('Next steps:')
|
|
58
|
+
console.log(` cd ${dest}`)
|
|
59
|
+
console.log(' cp .env.example .env # fill in EDPIRE_API_KEY')
|
|
60
|
+
console.log(' npm install')
|
|
61
|
+
console.log(' npm run dev')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edpire/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Embeddable JS SDK for Edpire assessments",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"homepage": "https://docs.edpire.com/developer/sdk/overview",
|
|
@@ -32,16 +32,21 @@
|
|
|
32
32
|
"types": "./dist/react.d.mts"
|
|
33
33
|
},
|
|
34
34
|
"./client": {
|
|
35
|
+
"types": "./dist/client.d.mts",
|
|
35
36
|
"import": "./dist/client.mjs",
|
|
36
|
-
"
|
|
37
|
+
"default": "./dist/client.mjs"
|
|
37
38
|
},
|
|
38
39
|
"./styles/runtime-utilities.css": "./src/styles/runtime-utilities.css",
|
|
39
40
|
"./styles/shell.css": "./src/styles/shell.css"
|
|
40
41
|
},
|
|
42
|
+
"bin": {
|
|
43
|
+
"create-edpire-app": "bin/create.js"
|
|
44
|
+
},
|
|
41
45
|
"files": [
|
|
42
46
|
"dist",
|
|
43
47
|
"src/styles",
|
|
44
|
-
"examples"
|
|
48
|
+
"examples",
|
|
49
|
+
"bin"
|
|
45
50
|
],
|
|
46
51
|
"dependencies": {
|
|
47
52
|
"@dnd-kit/core": "^6.3.1",
|