diff --git a/package.json b/package.json index acaeb9c..95f4a9d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ ], "scripts": { "test": "node --test --import ./tests/register-stubs.mjs tests/*.test.js", - "build": "npm run build:iife && npm run build:esm", + "build": "rm -rf dist && npm run build:iife && npm run build:esm", "build:iife": "esbuild src/index.js --bundle --format=iife --global-name=LearnosityWProofreader '--footer:js=LearnosityWProofreader=LearnosityWProofreader.LearnosityWProofreader;' --minify --outfile=dist/wproofreader-learnosity.min.js", "build:esm": "esbuild src/index.js --bundle --format=esm --minify --outfile=dist/wproofreader-learnosity.esm.js", "prepack": "npm run build" diff --git a/src/config.js b/src/config.js index d7e1e4d..247e79e 100644 --- a/src/config.js +++ b/src/config.js @@ -17,9 +17,7 @@ export const SURFACE_GLOBALS = { // explicitly with `surfaces: ['questions', 'items', 'author']`. export const DEFAULT_SURFACES = ['author']; -// Fixed partner tag so WebSpellChecker can attribute traffic to this plugin -// (cf. the CKEditor 5 plugin's `proofreader_ck5`). Not caller-configurable. -export const APP_TYPE = 'wpr_learnosity'; +export const APP_TYPE = 'learnosity_extension'; /* * Split options into the WProofreader block (forwarded to the SDK's init() diff --git a/tests/config.test.js b/tests/config.test.js index dbad23f..93a0963 100644 --- a/tests/config.test.js +++ b/tests/config.test.js @@ -20,7 +20,7 @@ test('serviceId path: Cloud config with grammar/autocorrect/appType defaults', ( assert.equal(config.wproofreader.serviceId, 'svc-123'); assert.equal(config.wproofreader.enableGrammar, true); assert.equal(config.wproofreader.autocorrect, true); - assert.equal(config.wproofreader.appType, 'wpr_learnosity'); + assert.equal(config.wproofreader.appType, 'learnosity_extension'); }); test('self-hosted service options pass through unchanged', () => { @@ -50,12 +50,12 @@ test('enableGrammar and autocorrect can be turned off explicitly', () => { test('appType is set to the fixed partner tag', () => { const config = buildConfig({ wproofreader: { serviceId: 'svc' } }); assert.equal(config.wproofreader.appType, APP_TYPE); - assert.equal(APP_TYPE, 'wpr_learnosity'); + assert.equal(APP_TYPE, 'learnosity_extension'); }); test('appType is not caller-configurable: a supplied value is ignored', () => { const config = buildConfig({ wproofreader: { serviceId: 'svc', appType: 'custom_partner' } }); - assert.equal(config.wproofreader.appType, 'wpr_learnosity'); + assert.equal(config.wproofreader.appType, 'learnosity_extension'); }); test('explicit wproofreader.lang overrides defaultLang', (t) => { diff --git a/tests/connector.test.js b/tests/connector.test.js index 0384d5c..0c035f0 100644 --- a/tests/connector.test.js +++ b/tests/connector.test.js @@ -95,7 +95,7 @@ test('attaches via the SDK with the built wproofreader options incl. appType', a assert.equal(globalThis.__sdkInitCalls.length, 1); const { options } = globalThis.__sdkInitCalls[0]; assert.equal(options.serviceId, 'svc-123'); - assert.equal(options.appType, 'wpr_learnosity'); + assert.equal(options.appType, 'learnosity_extension'); assert.equal(options.enableGrammar, true); assert.equal(options.container, container); });