fix(admin_basic,core,ecommerce,plugins,basic): stale dist 전수 재빌드 + 소스맵 게이트 audit 룰 신설

공개 — admin_basic 1.0.4 가 이전 소스로 빌드된 stale dist 를 릴리즈에
실어 주문 상세 합계행에 표현식 원문이 노출되던 회귀를 1.0.5 재빌드로 재수록.

- admin_basic 1.0.5: --production 재빌드 + 서빙 번들 회귀 E2E(red→green) + 시나리오 매니페스트
- 전수 점검: sourcemap 잔존 9확장+코어 3번들 --production 재빌드, untracked .map 3개 삭제
 (+1 bump: gdpr 1.0.3 / tosspayments 1.0.2 / verification_kginicis 1.0.3 /
 verification_nhnkcp 1.0.1 / basic 1.1.1 — 미공개 워킹 5건은 CHANGELOG 누적)
- 리터럴 대조 전수: 기능 drift 는 admin_basic 단독 확정(타 대상 차집합 0), 릴리즈 패리티 7/7 일치
- board/page 사문 build 스크립트 제거 (vite.config 부재 — module:build --all 실패 요인)
- audit 룰 신설: extension-dist-sourcemap-reference(error),
 extension-dist-source-literal-sync(warn) + coverage/룰 테스트/규정 문서 정정
This commit is contained in:
HeuJung committed 2026-08-12 14:31:26 +09:00
1 parent 2de257491f
commit 0bcd42ac04
60 files changed
+303 -134

No files matched your search

@@ -5,9 +5,6 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"test": "vitest",
"test:run": "vitest run",
"test:e2e": "playwright test --config=tests/Playwright/playwright.config.ts",
@@ -13,6 +13,7 @@
- 관리자 엑셀 다운로드 관리의 다운로드 이력 모달에서, 이력 항목이 아직 선택되지 않은 순간에 파일 정보·상태 배지가 비정상적으로 처리되던 문제를 보완했습니다. 항목을 선택한 뒤의 표시는 종전과 동일합니다.
- 같은 모달의 "다운로드 기록" 목록이 항상 비어 보이던 문제를 수정했습니다. 이제 누가 언제 몇 번째로 내려받았는지 기록이 표시됩니다.
- 같은 모달의 "처리중"·"실패"·"만료" 상태 배지에서 아이콘이 표시되지 않던 문제를 수정했습니다.
- 빌드 산출물이 존재하지 않는 소스맵 파일을 참조해 브라우저 개발자 도구 사용 시 불필요한 404 요청이 발생하던 문제를 수정했습니다.
## [1.1.0] - 2026-08-10
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"identifier": "sirsoft-ecommerce",
"version": "1.1.0",
"version": "1.1.1",
"components": {
"basic": [],
"composite": [],
@@ -1,2 +1 @@
var SirsoftEcommerce=function(Ae){"use strict";const Lt={KRW:0,JPY:0},xt={KRW:"₩",USD:"$",JPY:"¥",CNY:"元",EUR:"€",GBP:"£"},Pt={KRW:1e3,JPY:100};function At(r){if(!r)return 1;const c=r.base_unit??Pt[r.code]??1;return Math.max(1,c)}function kt(r,c,e){const t=parseFloat(c)||1;if(t<=0)return r;const o=r/t;let a;switch(e){case"ceil":a=Math.ceil(o);break;case"floor":a=Math.floor(o);break;default:a=Math.round(o)}return a*t}function de(r,c){const e=typeof c=="string"?{code:c}:c,t=e.code,o=e.symbol&&e.symbol.length>0?e.symbol:xt[t]??"",a=e.decimal_places??Lt[t]??2,n=r.toLocaleString(void 0,{minimumFractionDigits:a,maximumFractionDigits:a});return o?t==="KRW"||o==="₩"||o==="원"?n+"원":o+n:n+" "+t}function Ot(){try{const e=(window.G7Core?.state?.get?.()||{})?.modules?.["sirsoft-ecommerce"]?.language_currency;return Array.isArray(e?.currencies)?e.currencies:[]}catch{return[]}}function ue(r,c){const e=Ot(),t=c||e.find(o=>o.is_default)?.code;return t?de(r,e.find(o=>o.code===t)??t):r.toLocaleString()}function se(r,c){const{basePrice:e,currencies:t}=r,o=parseFloat(String(e))||0;if(!t||!Array.isArray(t)||t.length===0)return{};const a=t.find(i=>i.is_default),n=At(a),s={};for(const i of t){const l=i.code;if(i.is_default??!1)s[l]={price:o,formatted:de(o,i),is_default:!0,editable:!0};else if(i.exchange_rate&&i.exchange_rate>0){const d=o/n*i.exchange_rate,m=kt(d,i.rounding_unit||"0.01",i.rounding_method||"round");s[l]={price:m,formatted:de(m,i),is_default:!1,editable:!1,exchange_rate:i.exchange_rate}}}return s}const z=window.G7Core?.createLogger?.("Ecom:UpdateProduct")??{log:(...r)=>console.log("[Ecom:UpdateProduct]",...r),warn:(...r)=>console.warn("[Ecom:UpdateProduct]",...r),error:(...r)=>console.error("[Ecom:UpdateProduct]",...r)};function Gt(r,c){const e=r.params||{},{productId:t,field:o,dataSourceId:a="products"}=e;let{value:n}=e;if(n&&typeof n=="object"&&n.target!==void 0&&(n=n.target?.value,z.log("[updateProductField] Extracted value from event:",n)),!t||!o){z.warn("[updateProductField] Missing required params:",{productId:t,field:o});return}if(n===void 0){z.warn("[updateProductField] Value is undefined, skipping update");return}const s=window.G7Core;if(!s?.dataSource?.get||!s?.dataSource?.set){z.warn("[updateProductField] G7Core.dataSource API is not available");return}const i=s.dataSource.get(a);if(!i){console.warn(`[updateProductField] DataSource '${a}' not found`);return}const l=i.data?.data||[];if(!Array.isArray(l)||l.length===0){z.warn("[updateProductField] Products data is empty or invalid");return}const u=s.state.get()||{},d=u.modules?.["sirsoft-ecommerce"]?.language_currency?.currencies;let p=[...u._local?.productFieldErrors||[]];const g=l.map(C=>{if(String(C.id)===String(t)){const x=C[o];if(typeof n=="object"&&n!==null?JSON.stringify(x)===JSON.stringify(n):String(x)===String(n))return z.log(`[updateProductField] No change for product ${t}.${o}, skipping`),C;let S=n;const N=parseFloat(n)||0;if(o==="selling_price"){const O=parseFloat(C.list_price)||0;O>0&&N>O?(p.some(Q=>Q.productId===String(t)&&Q.field===o)||p.push({productId:String(t),field:"selling_price",message:"판매가는 정가를 초과할 수 없습니다."}),S=O):p=p.filter($=>!($.productId===String(t)&&$.field===o))}else p=p.filter(O=>!(O.productId===String(t)&&O.field===o));const L={...C,[o]:S,_modified:!0};return o==="selling_price"&&d&&Array.isArray(d)&&(L.multi_currency_selling_price=se({basePrice:S,currencies:d}),z.log(`[updateProductField] Recalculated multi_currency_selling_price for product ${t}`)),L}return C});s.dataSource.set(a,{...i,data:{...i.data,data:g}});const w=s.state.getLocal()||{},y=new Set(w.modifiedProductIds||[]);y.add(t);const _={...w.modifiedProductFields||{}},f=String(t),b=new Set(_[f]||[]);b.add(o),_[f]=Array.from(b),s.state.setLocal({modifiedProductIds:Array.from(y),modifiedProductFields:_,productFieldErrors:p}),z.log(`[updateProductField] Updated product ${t}.${o} =`,n)}const B=window.G7Core?.createLogger?.("Ecom:UpdateOption")??{log:(...r)=>console.log("[Ecom:UpdateOption]",...r),warn:(...r)=>console.warn("[Ecom:UpdateOption]",...r),error:(...r)=>console.error("[Ecom:UpdateOption]",...r)};function Et(r,c){const e=r.params||{},{productId:t,optionId:o,field:a,value:n,dataSourceId:s="products"}=e;if(!t||!o||!a){B.warn("[updateOptionField] Missing required params:",{productId:t,optionId:o,field:a});return}const i=window.G7Core;if(!i?.dataSource?.get||!i?.dataSource?.set){B.warn("[updateOptionField] G7Core.dataSource API is not available");return}const l=i.dataSource.get(s);if(!l){console.warn(`[updateOptionField] DataSource '${s}' not found`);return}const u=l.data?.data||[];if(!Array.isArray(u)||u.length===0){B.warn("[updateOptionField] Products data is empty or invalid");return}const d=i.state.get()||{},m=d.modules?.["sirsoft-ecommerce"]?.language_currency?.currencies;let g=[...d._local?.optionFieldErrors||[]],w=!1,y=!1;const _=u.map(N=>{if(String(N.id)===String(t)){const L=N.options||[],O=L.findIndex(D=>String(D.Line truncated
//# sourceMappingURL=module.iife.js.map
@@ -698,6 +698,13 @@ describe('Partial 레이아웃 구조 검증', () => {
// ========== 합계행 백엔드 필드 마이그레이션 검증 ==========
/**
* 합계행(footerCells)이 order.data 백엔드 필드에 바인딩되어 있는지의 구조 검증.
* 공개 #98(stale dist) 시나리오 매니페스트 admin-order-detail-footer-totals.yaml 의
* 레이아웃 계층 커버를 담당한다 — 서빙 번들 실검은 Playwright spec 이 맡는다.
*
* @effects order_detail_footer_totals_fields_bound
*/
it('합계행(footer)이 computed 대신 order.data 백엔드 필드를 사용한다', () => {
const json = JSON.stringify(orderInfoPartial);
// computed 참조가 없어야 함
@@ -1,3 +1,4 @@
// audit:allow extension-dist-source-literal-sync 고아 중복 구현 — handlers/index.ts 는 noticeHandlers.ts 의 동명 핸들러를 사용하며 이 파일은 어디서도 import 되지 않아 번들에 포함되지 않는다 (공유 리터럴이 있어 번들 포함 게이트로는 걸러지지 않음)
/**
* 고시정보 템플릿 저장 확인 핸들러
*
@@ -1,3 +1,4 @@
// audit:allow extension-dist-source-literal-sync 수신 함수가 읽지 않는 handler 필드를 rollup 최적화가 소거해 해당 리터럴만 번들에서 빠진다 (fresh 빌드로 실측 — stale 아님)
/**
* 상품 목록 확장 행 옵션 지연 로딩 핸들러
*
@@ -0,0 +1,80 @@
/**
* 주문 상세 — 합계행(tfoot) 텍스트 바인딩 해석 회귀 (공개 #98).
*
* 배경: admin_basic 1.0.4 릴리즈에 stale dist 가 실려, `components.json` 의
* `skipBindingKeys`(footerCells 선평가 중단) 선언과 구형 JS(renderFooterCellText 부재)가
* 어긋나 합계행 3셀(`수량`·`적립예정`·`배송비`)에 `{{order.data?.total_quantity ?? 0}}개`
* 같은 표현식 원문이 그대로 노출됐다. 소스·단위 테스트는 정상(green)이었고 **서빙 산출물만**
* 구형이었으므로, 서빙 번들을 실제로 로드하는 이 E2E 만이 해당 회귀를 잡는다.
*
* 측정 규율 (이 spec 을 고칠 사람에게):
* - 값 하드코딩 금지 — 주문 데이터는 변동한다. 형태(정규식)로 단언한다.
* - 헤더/라벨의 한글 문자열 단언 금지 — E2E 세션 로케일이 en 이면 `$t:` 라벨이 영문으로
* 렌더된다(order-detail-numeric-alignment.spec.ts 실측 선례). 셀 식별은 레이아웃
* JSON 이 부여한 className 훅으로 한다: 수량=`text-center`(비 blue), 적립=`text-center`+
* `text-blue-600`, 배송비=`text-label`. `개`/`P` 접미사는 레이아웃에 리터럴로 박힌
* 로케일 무관 문자라 단언에 써도 된다.
* - tfoot 의 선행 빈 셀(expandable/selectable) 유무에 좌우되지 않도록 인덱스 단언 금지.
*/
import { test, expect, authenticatePage } from '../../fixtures/ecommerce-auth';
import type { Page } from '@playwright/test';
/**
* 첫 주문의 상세로 진입한다 (주문번호 하드코딩 회피).
*
* 목록 화면은 좁은 뷰포트에서 카드로 렌더되므로 진입은 항상 데스크톱 폭에서 한다.
* 상세 진입은 주문번호 `<span>` 클릭(DataGrid onRowClick 계열).
*/
async function gotoFirstOrderDetail(page: Page): Promise<void> {
await page.setViewportSize({ width: 1280, height: 900 });
await page.goto('/admin/ecommerce/orders');
await page.waitForLoadState('domcontentloaded', { timeout: 30_000 });
const orderNumber = page.locator('table tbody tr span.cursor-pointer').first();
await orderNumber.waitFor({ state: 'visible', timeout: 30_000 });
await orderNumber.click();
await page.waitForURL(/\/admin\/ecommerce\/orders\/[\w-]+$/, { timeout: 30_000 });
}
test.describe('@sirsoft-ecommerce 주문 상세 합계행 텍스트 바인딩', () => {
// @scenario footer_cell=quantity, viewport=desktop
// @effects footer_text_bindings_resolved_no_raw_expression, footer_quantity_cell_shows_count_with_unit
// @scenario footer_cell=points, viewport=desktop
// @effects footer_points_cell_shows_formatted_number
// @scenario footer_cell=delivery, viewport=desktop
// @effects footer_delivery_cell_shows_shipping_fee_label
test('합계행 수량·적립·배송비 셀이 표현식 원문 없이 값으로 렌더된다', async ({ page, ordersReadToken }) => {
await authenticatePage(page, ordersReadToken);
await gotoFirstOrderDetail(page);
// 상품 목록 표의 합계행이 뜰 때까지 대기 (footerCells 는 데이터 로드 후에만 렌더)
const tfoot = page.locator('table tfoot').first();
await tfoot.waitFor({ state: 'visible', timeout: 30_000 });
// ① 페이지 전체에 미해석 표현식 원문이 없다 — stale dist 회귀의 1차 증상.
// (poll: 데이터 소스 응답 직후 재렌더 타이밍 흡수)
await expect
.poll(async () => (await page.evaluate(() => document.body.innerText)).includes('{{'), {
timeout: 20_000,
})
.toBe(false);
// ② 수량 셀 — 레이아웃 className 훅: text-center 이면서 blue(적립) 가 아닌 셀.
// `개` 는 레이아웃 리터럴(로케일 무관). 회귀 시 `{{...}}개` 라 정규식이 깨진다.
const quantityCell = tfoot.locator('td.text-center:not(.text-blue-600)').first();
await expect(quantityCell).toHaveText(/^[\d,]+개$/);
// ③ 적립예정 셀 — text-center + text-blue-600. `| number` 파이프 해석 결과라
// 숫자(천단위 콤마 허용) + `P` 리터럴 형태여야 한다.
const pointsCell = tfoot.locator('td.text-center.text-blue-600').first();
await expect(pointsCell).toHaveText(/^[\d,]+P$/);
// ④ 배송비 셀 — text-label. 라벨은 `$t:` 로 로케일 의존이므로 라벨 문자열 대신
// "라벨: 값" 구분자 존재 + 표현식 원문 부재를 단언한다.
const deliveryCell = tfoot.locator('td.text-label').first();
const deliveryText = (await deliveryCell.innerText()).trim();
expect(deliveryText).not.toContain('{{');
expect(deliveryText).toMatch(/:/);
});
});
@@ -0,0 +1,37 @@
feature: 관리자 주문상세 — 합계행(tfoot) 텍스트 바인딩 해석 (공개 #98 stale dist 회귀)
description: |
관리자 주문 상세(`admin/ecommerce/orders/:orderNumber`) 상품 목록 표의 합계행은
DataGrid `footerCells` 로 렌더된다. `components.json` 의 `skipBindingKeys` 선언으로
엔진 선평가가 중단된 뒤에는 DataGrid `renderFooterCellText` 가 `text` 바인딩을
해석해야 한다. admin_basic 1.0.4 는 stale dist(구형 JS) 가 릴리즈에 실려
수량·적립예정·배송비 셀에 `{{order.data?.total_quantity ?? 0}}개` 같은 표현식
원문이 노출됐다(공개 #98). 소스와 단위 테스트는 green 인 채 서빙 산출물만 구형인
결함이므로, 서빙 번들을 실제 로드하는 브라우저 E2E 를 회귀 방벽으로 둔다.
axes 는 audit fallback YAML 파서 호환을 위해 flat 인라인 배열로만 선언한다.
모바일 카드 푸터는 `footerCardChildren`(컴포넌트 children 경로) 라 이 결함의
영향 밖이며(실측), Chrome MCP 검수 매트릭스 T8 축이 별도로 확인한다.
axes:
footer_cell: [quantity, points, delivery]
viewport: [desktop]
effects:
# 브라우저 E2E (Playwright — 서빙 번들 실검)
- footer_text_bindings_resolved_no_raw_expression # 페이지 전체 `{{` 0건
- footer_quantity_cell_shows_count_with_unit # 수량 셀 `[\d,]+개` 형태
- footer_points_cell_shows_formatted_number # 적립 셀 `[\d,]+P` 형태 (`| number` 파이프)
- footer_delivery_cell_shows_shipping_fee_label # 배송비 셀 라벨: 값 형태 + 원문 부재
# 컴포넌트 단위 (Vitest — admin_basic DataGrid)
- datagrid_footer_cell_text_binding_resolved # footerCells[].text 바인딩/파이프 해석
# 레이아웃 구조 (Vitest — 이커머스 주문상세 레이아웃 JSON)
- order_detail_footer_totals_fields_bound # 합계행이 order.data 백엔드 필드 사용
test_files:
- templates/_bundled/sirsoft-admin_basic/src/components/composite/__tests__/DataGrid.test.tsx
- modules/_bundled/sirsoft-ecommerce/resources/js/__tests__/layouts/orderDetailLayouts.test.tsx
- modules/_bundled/sirsoft-ecommerce/tests/Playwright/specs/admin/order-detail-footer-totals.spec.ts
validation:
audit_rule: frontend-change-requires-e2e
@@ -5,9 +5,6 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"test": "vitest",
"test:run": "vitest run",
"test:e2e": "playwright test --config=tests/Playwright/playwright.config.ts",