CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

adobe/aem-eds-personalization

Section-based personalization for AEM Edge Delivery Services (DA) pages: Section Metadata rows let rules (geo, device, visitor, URL/UTM param, page state, custom audiences), a decision engine (v1 API, OF1), an A/B split or Adobe Target (inline or popup) pick the EDS fragment a section shows, with the authored content as default. Consent first, measurement events per decision, a client runtime plus an optional Cloudflare edge worker, a simulator and Playwright checks.

0.83x
Quality

88%

Does it follow best practices?

Impact

83%

0.83x

1 of 3 eval scenarios. Add 2 more for a full score.

SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

runtime-style.test.mjsskills/personalize/scripts/test/

/*
 * The runtime is copied into sites that lint with airbnb-base (the
 * boilerplate's `npm run lint`). This catches the rules the runtime has
 * tripped before; the acceptance run lints a real site with the full config.
 */

import assert from 'node:assert/strict';
import { readdirSync, readFileSync } from 'node:fs';
import { join, relative } from 'node:path';
import { describe, it } from 'node:test';
import { RUNTIME_DIR } from '../lib.mjs';

const files = readdirSync(RUNTIME_DIR, { recursive: true })
  .filter((name) => String(name).endsWith('.js'))
  .map((name) => join(RUNTIME_DIR, String(name)));

// airbnb max-len: 100, lines with strings, template literals, URLs or
// regular expressions exempt.
const exempt = (line) => /['"`]|:\/\/|\/[^/*\s].*\/[dgimsuy]*[.,;)]/.test(line);

describe('runtime style', () => {
  it('finds the runtime files', () => assert.ok(files.length > 10));

  it('keeps lines within 100 characters', () => {
    const long = files.flatMap((file) => readFileSync(file, 'utf8').split('\n')
      .map((line, index) => [line, index])
      .filter(([line]) => line.length > 100 && !exempt(line))
      .map(([line, index]) => `${relative(RUNTIME_DIR, file)}:${index + 1} (${line.length})`));
    assert.deepEqual(long, []);
  });

  it('uses no for...of loops (airbnb no-restricted-syntax)', () => {
    const loops = files.flatMap((file) => readFileSync(file, 'utf8').split('\n')
      .map((line, index) => [line, index])
      .filter(([line]) => /\bfor\s*\((const|let|var)\s+[^;]*\s(of|in)\s/.test(line))
      .map(([, index]) => `${relative(RUNTIME_DIR, file)}:${index + 1}`));
    assert.deepEqual(loops, []);
  });
});

skills

personalize

scripts

test

conformance.test.mjs

context.test.mjs

contract.test.mjs

detect-project.test.mjs

edge.test.mjs

helpers.mjs

html.test.mjs

install-edge.test.mjs

install-runtime.test.mjs

lib.test.mjs

mock-decision-api.test.mjs

outcomes.test.mjs

pilot.test.mjs

provider-api.test.mjs

rules.test.mjs

runtime-style.test.mjs

section-spec.test.mjs

sections.test.mjs

simulate.test.mjs

sources.test.mjs

validate-placeholders.test.mjs

verify-preview.test.mjs

detect-project.mjs

install-edge.mjs

install-runtime.mjs

lib.mjs

mock-decision-api.mjs

schema.mjs

simulate.mjs

validate-placeholders.mjs

verify-preview.mjs

SKILL.md

README.md

tile.json