@nyuccl/smile 0.2.0-beta.32 → 0.2.0-beta.34
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/dist/module.json +1 -1
- package/dist/module.mjs +10 -2
- package/dist/runtime/core/config.d.ts +81 -37
- package/dist/runtime/core/config.js +18 -13
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -19,6 +19,14 @@ const module$1 = defineNuxtModule({
|
|
|
19
19
|
_nuxt.options.ssr = false;
|
|
20
20
|
_nuxt.options.build.transpile.push(runtimeDir);
|
|
21
21
|
_nuxt.options.nitro = _nuxt.options.nitro || {};
|
|
22
|
+
_nuxt.options.nitro.watchOptions = _nuxt.options.nitro.watchOptions || {};
|
|
23
|
+
_nuxt.options.nitro.watchOptions.ignored = _nuxt.options.nitro.watchOptions.ignored || [];
|
|
24
|
+
if (Array.isArray(_nuxt.options.nitro.watchOptions.ignored)) {
|
|
25
|
+
_nuxt.options.nitro.watchOptions.ignored.push("**/.data/**");
|
|
26
|
+
}
|
|
27
|
+
_nuxt.options.watch = _nuxt.options.watch || {};
|
|
28
|
+
_nuxt.options.watch.exclude = _nuxt.options.watch.exclude || [];
|
|
29
|
+
_nuxt.options.watch.exclude.push(".data/**");
|
|
22
30
|
_nuxt.options.nitro.publicAssets = _nuxt.options.nitro.publicAssets || [];
|
|
23
31
|
_nuxt.options.nitro.publicAssets.push({
|
|
24
32
|
dir: resolver.resolve("./runtime/public"),
|
|
@@ -35,8 +43,8 @@ const module$1 = defineNuxtModule({
|
|
|
35
43
|
};
|
|
36
44
|
_nuxt.options.runtimeConfig.public = _nuxt.options.runtimeConfig.public || {};
|
|
37
45
|
_nuxt.options.runtimeConfig.public.smile = {
|
|
38
|
-
codeName: process.env.VITE_CODE_NAME || "",
|
|
39
|
-
projectRef: process.env.VITE_PROJECT_REF || ""
|
|
46
|
+
codeName: process.env.VITE_CODE_NAME || "unnamed-experiment",
|
|
47
|
+
projectRef: process.env.VITE_PROJECT_REF || "local-experiment-main"
|
|
40
48
|
};
|
|
41
49
|
_nuxt.options.alias["#smile-dev"] = resolver.resolve("./runtime/components/dev");
|
|
42
50
|
_nuxt.options.alias["#smile-composables"] = resolver.resolve("./runtime/composables");
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let mode: any;
|
|
3
|
-
let smileVersion: any;
|
|
4
|
-
let projectName: any;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let codeNameURL: any;
|
|
8
|
-
let localStorageKey: string;
|
|
9
|
-
let devLocalStorageKey: string;
|
|
10
|
-
namespace github {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let lastCommitMsg: any;
|
|
15
|
-
|
|
16
|
-
let commitURL: string;
|
|
2
|
+
export let mode: any;
|
|
3
|
+
export let smileVersion: any;
|
|
4
|
+
export let projectName: any;
|
|
5
|
+
export { projectRef };
|
|
6
|
+
export { codeName };
|
|
7
|
+
export let codeNameURL: any;
|
|
8
|
+
export let localStorageKey: string;
|
|
9
|
+
export let devLocalStorageKey: string;
|
|
10
|
+
export namespace github {
|
|
11
|
+
export { repoName };
|
|
12
|
+
export { owner };
|
|
13
|
+
export { branch };
|
|
14
|
+
export let lastCommitMsg: any;
|
|
15
|
+
export { hash as lastCommitHash };
|
|
16
|
+
export let commitURL: string;
|
|
17
17
|
}
|
|
18
|
-
let allowRepeats: boolean;
|
|
19
|
-
let autoSave: any;
|
|
20
|
-
let maxWrites: any;
|
|
21
|
-
let minWriteInterval: any;
|
|
22
|
-
let maxSteps: any;
|
|
23
|
-
let randomSeed: any;
|
|
24
|
-
let deployURL: any;
|
|
25
|
-
let labURL: any;
|
|
26
|
-
let brandLogoFn: any;
|
|
27
|
-
let advertisementImageFn: string;
|
|
28
|
-
let advertisementImageInvertDark: boolean;
|
|
29
|
-
let colorMode: any;
|
|
30
|
-
let responsiveUI: boolean;
|
|
31
|
-
let googleAnalyticsID: any;
|
|
32
|
-
let windowsizerRequest: object;
|
|
33
|
-
let windowsizerAggressive: boolean;
|
|
34
|
-
let anonymousMode: boolean;
|
|
35
|
-
let unpaidStudy: boolean;
|
|
36
|
-
namespace sona {
|
|
18
|
+
export let allowRepeats: boolean;
|
|
19
|
+
export let autoSave: any;
|
|
20
|
+
export let maxWrites: any;
|
|
21
|
+
export let minWriteInterval: any;
|
|
22
|
+
export let maxSteps: any;
|
|
23
|
+
export let randomSeed: any;
|
|
24
|
+
export let deployURL: any;
|
|
25
|
+
export let labURL: any;
|
|
26
|
+
export let brandLogoFn: any;
|
|
27
|
+
export let advertisementImageFn: string;
|
|
28
|
+
export let advertisementImageInvertDark: boolean;
|
|
29
|
+
export let colorMode: any;
|
|
30
|
+
export let responsiveUI: boolean;
|
|
31
|
+
export let googleAnalyticsID: any;
|
|
32
|
+
export let windowsizerRequest: object;
|
|
33
|
+
export let windowsizerAggressive: boolean;
|
|
34
|
+
export let anonymousMode: boolean;
|
|
35
|
+
export let unpaidStudy: boolean;
|
|
36
|
+
export namespace sona {
|
|
37
37
|
let url: any;
|
|
38
38
|
let experimentId: any;
|
|
39
39
|
let creditToken: any;
|
|
40
40
|
}
|
|
41
|
-
namespace sonaPaid {
|
|
41
|
+
export namespace sonaPaid {
|
|
42
42
|
let url_1: any;
|
|
43
43
|
export { url_1 as url };
|
|
44
44
|
let experimentId_1: any;
|
|
@@ -46,10 +46,10 @@ declare namespace _default {
|
|
|
46
46
|
let creditToken_1: any;
|
|
47
47
|
export { creditToken_1 as creditToken };
|
|
48
48
|
}
|
|
49
|
-
namespace spark {
|
|
49
|
+
export namespace spark {
|
|
50
50
|
let completionUrl: string;
|
|
51
51
|
}
|
|
52
|
-
namespace firebaseConfig {
|
|
52
|
+
export namespace firebaseConfig {
|
|
53
53
|
let apiKey: any;
|
|
54
54
|
let authDomain: any;
|
|
55
55
|
let projectId: any;
|
|
@@ -166,3 +166,47 @@ export type Config = {
|
|
|
166
166
|
appId: string;
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
|
+
declare const projectRef: any;
|
|
170
|
+
/**
|
|
171
|
+
* Global configuration object for the Smile application
|
|
172
|
+
* @typedef {object} Config
|
|
173
|
+
* @property {string} mode - Application mode ('development', 'production', 'testing')
|
|
174
|
+
* @property {string} projectName - Name of the project
|
|
175
|
+
* @property {string} projectRef - Project reference derived from deploy base path
|
|
176
|
+
* @property {string} codeName - Project code name
|
|
177
|
+
* @property {string} codeNameURL - Deploy URL for code name
|
|
178
|
+
* @property {string} localStorageKey - Key for storing data in localStorage
|
|
179
|
+
* @property {string} devLocalStorageKey - Key for storing dev data in localStorage
|
|
180
|
+
* @property {object} github - GitHub repository information
|
|
181
|
+
* @property {string} github.repoName - Repository name
|
|
182
|
+
* @property {string} github.owner - Repository owner
|
|
183
|
+
* @property {string} github.branch - Current branch name
|
|
184
|
+
* @property {string} github.lastCommitMsg - Last commit message
|
|
185
|
+
* @property {string} github.lastCommitHash - Last commit hash
|
|
186
|
+
* @property {string} github.commitURL - URL to last commit
|
|
187
|
+
* @property {boolean} allowRepeats - Whether to allow repeat participants
|
|
188
|
+
* @property {boolean} autoSave - Whether to auto-save data
|
|
189
|
+
* @property {number} maxWrites - Maximum number of writes allowed
|
|
190
|
+
* @property {number} minWriteInterval - Minimum interval between writes
|
|
191
|
+
* @property {number} maxSteps - Maximum rows in stepper tables
|
|
192
|
+
* @property {string} randomSeed - Seed for random number generation
|
|
193
|
+
* @property {string} deployURL - URL where app is deployed
|
|
194
|
+
* @property {string} labURL - URL of the lab website
|
|
195
|
+
* @property {string} brandLogoFn - Function name for brand logo
|
|
196
|
+
* @property {string} googleAnalyticsID - Google Analytics tracking ID
|
|
197
|
+
* @property {object} windowsizerRequest - Requested window dimensions
|
|
198
|
+
* @property {boolean} windowsizerAggressive - Whether to force window sizing
|
|
199
|
+
* @property {boolean} anonymousMode - Whether to enable anonymous mode
|
|
200
|
+
* @property {object} firebaseConfig - Firebase configuration object
|
|
201
|
+
* @property {string} firebaseConfig.apiKey - Firebase API key
|
|
202
|
+
* @property {string} firebaseConfig.authDomain - Firebase auth domain
|
|
203
|
+
* @property {string} firebaseConfig.projectId - Firebase project ID
|
|
204
|
+
* @property {string} firebaseConfig.storageBucket - Firebase storage bucket
|
|
205
|
+
* @property {string} firebaseConfig.messagingSenderId - Firebase messaging sender ID
|
|
206
|
+
* @property {string} firebaseConfig.appId - Firebase app ID
|
|
207
|
+
*/
|
|
208
|
+
declare const codeName: any;
|
|
209
|
+
declare const repoName: any;
|
|
210
|
+
declare const owner: any;
|
|
211
|
+
declare const branch: any;
|
|
212
|
+
declare const hash: any;
|
|
@@ -58,24 +58,29 @@ function parseWidthHeight(value) {
|
|
|
58
58
|
* @property {string} firebaseConfig.messagingSenderId - Firebase messaging sender ID
|
|
59
59
|
* @property {string} firebaseConfig.appId - Firebase app ID
|
|
60
60
|
*/
|
|
61
|
+
const codeName = import.meta.env.VITE_CODE_NAME || 'unnamed-experiment'
|
|
62
|
+
const projectRef = (import.meta.env.VITE_DEPLOY_BASE_PATH || '/local/experiment/main/').slice(1, -1).replace(/\//g, '-')
|
|
63
|
+
const owner = import.meta.env.VITE_GIT_OWNER || 'local'
|
|
64
|
+
const repoName = import.meta.env.VITE_GIT_REPO_NAME || 'experiment'
|
|
65
|
+
const branch = import.meta.env.VITE_GIT_BRANCH_NAME || 'main'
|
|
66
|
+
const hash = import.meta.env.VITE_GIT_HASH || '0000000'
|
|
67
|
+
|
|
61
68
|
export default {
|
|
62
69
|
mode: import.meta.env.MODE,
|
|
63
70
|
smileVersion: import.meta.env.VITE_SMILE_VERSION,
|
|
64
|
-
projectName: import.meta.env.VITE_PROJECT_NAME
|
|
65
|
-
projectRef
|
|
66
|
-
codeName
|
|
71
|
+
projectName: import.meta.env.VITE_PROJECT_NAME || 'experiment',
|
|
72
|
+
projectRef,
|
|
73
|
+
codeName,
|
|
67
74
|
codeNameURL: import.meta.env.VITE_CODE_NAME_DEPLOY_URL,
|
|
68
|
-
localStorageKey: `smilestore-${
|
|
69
|
-
devLocalStorageKey: `smilestore-${
|
|
75
|
+
localStorageKey: `smilestore-${codeName}`,
|
|
76
|
+
devLocalStorageKey: `smilestore-${codeName}_dev`,
|
|
70
77
|
github: {
|
|
71
|
-
repoName
|
|
72
|
-
owner
|
|
73
|
-
branch
|
|
74
|
-
lastCommitMsg: import.meta.env.VITE_GIT_LAST_MSG,
|
|
75
|
-
lastCommitHash:
|
|
76
|
-
commitURL: `https://github.com/${
|
|
77
|
-
import.meta.env.VITE_GIT_HASH
|
|
78
|
-
}`,
|
|
78
|
+
repoName,
|
|
79
|
+
owner,
|
|
80
|
+
branch,
|
|
81
|
+
lastCommitMsg: import.meta.env.VITE_GIT_LAST_MSG || '(no commits yet)',
|
|
82
|
+
lastCommitHash: hash,
|
|
83
|
+
commitURL: `https://github.com/${owner}/${repoName}/commit/${hash}`,
|
|
79
84
|
},
|
|
80
85
|
// browser_exclude: import.meta.env.VITE_BROWSER_EXCLUDE,
|
|
81
86
|
allowRepeats: import.meta.env.VITE_ALLOW_REPEATS === 'true',
|