IAPL rename, scripted: preferred names in src, bin, scripts, services, tests; bin files and skill folders moved
Replaced by an explicit list of forms only (ten exported names, runtime env names, project file names and marks, commands, skill names, the log prefix, the brand in prose). Package name, import paths, routes, CSS tokens, data attributes, custom keys, context flags, the cookie and kv keys are not touched. package.json keeps the five old bin names beside the five new ones. The old names stop working in this commit and come back as aliases in the next; docs follow. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
414a4702df
commit
0a4f001797
+7
-7
@@ -8,7 +8,7 @@ import { getPayload } from 'payload'
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import { createSeeder, editedSinceSeed, isLocalDatabase, seedHash } from '../src/exports/seed.js'
|
||||
import { ipalKit } from '../src/plugin.js'
|
||||
import { iapl } from '../src/plugin.js'
|
||||
import { buildTestConfig } from './helpers.js'
|
||||
|
||||
vi.mock('server-only', () => ({}))
|
||||
@@ -126,7 +126,7 @@ describe('createSeeder', () => {
|
||||
},
|
||||
],
|
||||
localization: { defaultLocale: 'pl', fallback: true, locales: ['pl', 'en'] },
|
||||
plugins: [ipalKit({ i18n: { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'PL' }, { code: 'en', label: 'EN' }] }, indexNow: true, pages: { slug: 'pages' }, twoFactor: false })],
|
||||
plugins: [iapl({ i18n: { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'PL' }, { code: 'en', label: 'EN' }] }, indexNow: true, pages: { slug: 'pages' }, twoFactor: false })],
|
||||
secret: 'seed-test-secret',
|
||||
telemetry: false,
|
||||
})
|
||||
@@ -271,12 +271,12 @@ describe('createSeeder', () => {
|
||||
expect(((await payload.findGlobal({ slug: 'look' as never })) as { mode: string }).mode).toBe('dark')
|
||||
})
|
||||
|
||||
test('production guard: update refused on production or a non-local database unless IPAL_SEED_ALLOW_PROD_UPDATE=1', () => {
|
||||
test('production guard: update refused on production or a non-local database unless IAPL_SEED_ALLOW_PROD_UPDATE=1', () => {
|
||||
vi.stubEnv('NODE_ENV', 'production')
|
||||
const only = ['pages:kontakt']
|
||||
expect(() => seeder({ only, update: true })).toThrow(/update refused: NODE_ENV=production[\s\S]*Back up the database/)
|
||||
expect(() => seeder({ only })).not.toThrow() // create-only of listed records is always allowed
|
||||
vi.stubEnv('IPAL_SEED_ALLOW_PROD_UPDATE', '1')
|
||||
vi.stubEnv('IAPL_SEED_ALLOW_PROD_UPDATE', '1')
|
||||
expect(seeder({ only, update: true }).update).toBe(true)
|
||||
expect(lines.join('\n')).toMatch(/Did you back it up/)
|
||||
|
||||
@@ -285,7 +285,7 @@ describe('createSeeder', () => {
|
||||
expect(() => seeder({ only, update: true })).toThrow(/update refused: the database is not local/)
|
||||
expect(() => seeder({ guard: { localHosts: ['db'] }, update: true })).not.toThrow()
|
||||
expect(() => seeder({ guard: false, update: true })).not.toThrow()
|
||||
vi.stubEnv('IPAL_SEED_ALLOW_PROD_UPDATE', '1')
|
||||
vi.stubEnv('IAPL_SEED_ALLOW_PROD_UPDATE', '1')
|
||||
expect(() => seeder({ force: true, only, update: true })).toThrow(/force refused/)
|
||||
})
|
||||
|
||||
@@ -300,7 +300,7 @@ describe('createSeeder', () => {
|
||||
vi.stubEnv('DATABASE_URI', 'postgres://u:p@db:5432/app')
|
||||
expect(() => seeder()).toThrow(/full seed refused: the database is not local/)
|
||||
expect(() => seeder({ guard: { allowFull: true } })).not.toThrow()
|
||||
vi.stubEnv('IPAL_SEED_ALLOW_FULL', '1')
|
||||
vi.stubEnv('IAPL_SEED_ALLOW_FULL', '1')
|
||||
expect(() => seeder()).not.toThrow()
|
||||
expect(() => seeder({ guard: false })).not.toThrow()
|
||||
})
|
||||
@@ -335,7 +335,7 @@ describe('createSeeder', () => {
|
||||
test('seed writes skip IndexNow; a normal save still pings', async () => {
|
||||
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValue(new Response(null, { status: 202 }))
|
||||
vi.stubEnv('NODE_ENV', 'production')
|
||||
vi.stubEnv('IPAL_SEED_ALLOW_PROD_UPDATE', '1')
|
||||
vi.stubEnv('IAPL_SEED_ALLOW_PROD_UPDATE', '1')
|
||||
vi.stubEnv('NEXT_PUBLIC_SERVER_URL', 'https://acme.pl')
|
||||
vi.stubEnv('INDEXNOW_KEY', 'k123')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user