@react-consulting/rc-kit 0.0.0-stage → 0.13.0
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/LICENSE +21 -0
- package/README.md +94 -2
- package/devkit/README.md +301 -0
- package/devkit/cli.test.ts +211 -0
- package/devkit/cli.ts +120 -0
- package/devkit/commands/build.ts +127 -0
- package/devkit/commands/checks.ts +123 -0
- package/devkit/commands/context.ts +47 -0
- package/devkit/commands/db.ts +154 -0
- package/devkit/commands/deploy.ts +46 -0
- package/devkit/commands/dev.ts +191 -0
- package/devkit/commands/doctor.ts +25 -0
- package/devkit/commands/kit.ts +45 -0
- package/devkit/commands/new.ts +81 -0
- package/devkit/commands/registry.ts +20 -0
- package/devkit/commands/secrets.ts +254 -0
- package/devkit/lib/args.ts +65 -0
- package/devkit/lib/audit.test.ts +405 -0
- package/devkit/lib/audit.ts +813 -0
- package/devkit/lib/config.test.ts +203 -0
- package/devkit/lib/config.ts +417 -0
- package/devkit/lib/database/index.test.ts +223 -0
- package/devkit/lib/database/index.ts +314 -0
- package/devkit/lib/database/neon.test.ts +233 -0
- package/devkit/lib/database/neon.ts +357 -0
- package/devkit/lib/database/prepare.ts +54 -0
- package/devkit/lib/deploy-config.test.ts +217 -0
- package/devkit/lib/deploy-config.ts +133 -0
- package/devkit/lib/deploy.test.ts +275 -0
- package/devkit/lib/deploy.ts +177 -0
- package/devkit/lib/dev-gateway.test.ts +128 -0
- package/devkit/lib/dev-gateway.ts +162 -0
- package/devkit/lib/dev-menu.test.ts +114 -0
- package/devkit/lib/dev-menu.ts +332 -0
- package/devkit/lib/dev-secrets.test.ts +156 -0
- package/devkit/lib/dev-secrets.ts +97 -0
- package/devkit/lib/dev.test.ts +194 -0
- package/devkit/lib/dev.ts +119 -0
- package/devkit/lib/doctor.test.ts +144 -0
- package/devkit/lib/doctor.ts +264 -0
- package/devkit/lib/env-file.test.ts +102 -0
- package/devkit/lib/env-file.ts +96 -0
- package/devkit/lib/glob.ts +31 -0
- package/devkit/lib/infisical.test.ts +208 -0
- package/devkit/lib/infisical.ts +139 -0
- package/devkit/lib/json-schema.ts +220 -0
- package/devkit/lib/jsonc.test.ts +53 -0
- package/devkit/lib/jsonc.ts +93 -0
- package/devkit/lib/kit-migrate.test.ts +212 -0
- package/devkit/lib/kit-migrate.ts +617 -0
- package/devkit/lib/kit-package.test.ts +83 -0
- package/devkit/lib/kit-package.ts +57 -0
- package/devkit/lib/kit-version.ts +22 -0
- package/devkit/lib/naming.test.ts +547 -0
- package/devkit/lib/naming.ts +796 -0
- package/devkit/lib/paths.ts +7 -0
- package/devkit/lib/process.ts +78 -0
- package/devkit/lib/project-checks.ts +86 -0
- package/devkit/lib/scaffold.test.ts +302 -0
- package/devkit/lib/scaffold.ts +315 -0
- package/devkit/lib/secrets.test.ts +101 -0
- package/devkit/lib/secrets.ts +125 -0
- package/devkit/lib/sourcemaps.test.ts +86 -0
- package/devkit/lib/sourcemaps.ts +98 -0
- package/devkit/lib/test-utils.ts +68 -0
- package/devkit/lib/workspace.ts +87 -0
- package/devkit/lib/wrangler.ts +231 -0
- package/docs/rc-config.md +93 -0
- package/package.json +86 -4
- package/presets/build.d.ts +15 -0
- package/presets/build.js +53 -0
- package/presets/vite-plus.d.ts +28 -0
- package/presets/vite-plus.js +153 -0
- package/registry/README.md +294 -0
- package/registry/public/r/avatar-stack.json +18 -0
- package/registry/public/r/avatar.json +20 -0
- package/registry/public/r/back-link.json +21 -0
- package/registry/public/r/badge.json +17 -0
- package/registry/public/r/button.json +18 -0
- package/registry/public/r/calendar-days.json +14 -0
- package/registry/public/r/calendar-popover.json +24 -0
- package/registry/public/r/calendar.json +23 -0
- package/registry/public/r/callout.json +20 -0
- package/registry/public/r/card.json +18 -0
- package/registry/public/r/character-counter.json +17 -0
- package/registry/public/r/checkbox.json +22 -0
- package/registry/public/r/choice-cards.json +22 -0
- package/registry/public/r/color-tag.json +17 -0
- package/registry/public/r/combobox.json +24 -0
- package/registry/public/r/confirm-button.json +24 -0
- package/registry/public/r/confirm-dialog.json +23 -0
- package/registry/public/r/copy-button.json +24 -0
- package/registry/public/r/date-picker.json +24 -0
- package/registry/public/r/date-range-picker.json +28 -0
- package/registry/public/r/detail-header.json +17 -0
- package/registry/public/r/detail-row.json +17 -0
- package/registry/public/r/dev-inbox-api.json +33 -0
- package/registry/public/r/dev-toolbar.json +109 -0
- package/registry/public/r/dev-tools-contract.json +15 -0
- package/registry/public/r/dialog.json +23 -0
- package/registry/public/r/empty-state.json +20 -0
- package/registry/public/r/error-state.json +23 -0
- package/registry/public/r/eyebrow.json +17 -0
- package/registry/public/r/fab.json +20 -0
- package/registry/public/r/field-error.json +17 -0
- package/registry/public/r/field-grid.json +17 -0
- package/registry/public/r/field.json +19 -0
- package/registry/public/r/file-picker.json +22 -0
- package/registry/public/r/filter-chips.json +17 -0
- package/registry/public/r/form-section.json +17 -0
- package/registry/public/r/form-sheet.json +22 -0
- package/registry/public/r/icon-button.json +23 -0
- package/registry/public/r/input.json +18 -0
- package/registry/public/r/label.json +18 -0
- package/registry/public/r/list-row.json +17 -0
- package/registry/public/r/loading-state.json +18 -0
- package/registry/public/r/localized-field.json +23 -0
- package/registry/public/r/markdown-text.json +17 -0
- package/registry/public/r/menu.json +21 -0
- package/registry/public/r/money-input.json +17 -0
- package/registry/public/r/month-day-select.json +18 -0
- package/registry/public/r/numbered-step.json +20 -0
- package/registry/public/r/page-actions.json +14 -0
- package/registry/public/r/page-header.json +17 -0
- package/registry/public/r/pending.json +17 -0
- package/registry/public/r/person-option.json +21 -0
- package/registry/public/r/popover.json +20 -0
- package/registry/public/r/progress-bar.json +17 -0
- package/registry/public/r/query-view.json +22 -0
- package/registry/public/r/registry.json +1352 -0
- package/registry/public/r/retry-button.json +21 -0
- package/registry/public/r/rich-text-editor.json +32 -0
- package/registry/public/r/save-bar.json +22 -0
- package/registry/public/r/search-input.json +23 -0
- package/registry/public/r/search-select.json +24 -0
- package/registry/public/r/section-tabs.json +17 -0
- package/registry/public/r/segmented.json +18 -0
- package/registry/public/r/select.json +23 -0
- package/registry/public/r/sheet.json +24 -0
- package/registry/public/r/skeleton.json +17 -0
- package/registry/public/r/spinner.json +20 -0
- package/registry/public/r/stale-notice.json +23 -0
- package/registry/public/r/stat-tile.json +23 -0
- package/registry/public/r/stepper.json +23 -0
- package/registry/public/r/suggestion-strip.json +21 -0
- package/registry/public/r/swatch-picker.json +22 -0
- package/registry/public/r/switch.json +21 -0
- package/registry/public/r/tabs.json +20 -0
- package/registry/public/r/textarea.json +18 -0
- package/registry/public/r/theme.json +15 -0
- package/registry/public/r/timezone-select.json +19 -0
- package/registry/public/r/toaster.json +21 -0
- package/registry/public/r/tooltip.json +17 -0
- package/registry/public/r/ui-labels.json +14 -0
- package/registry/public/r/use-copy-to-clipboard.json +20 -0
- package/registry/public/r/use-online.json +14 -0
- package/registry/public/r/use-stale-queries.json +17 -0
- package/registry/public/r/utils.json +18 -0
- package/registry/public/r/weekday-picker.json +19 -0
- package/registry/public/r/yes-no.json +20 -0
- package/registry/serve.ts +29 -0
- package/rules/architecture.md +47 -0
- package/rules/cloudflare.md +74 -0
- package/rules/code.md +12 -0
- package/rules/git.md +10 -0
- package/rules/index.md +14 -0
- package/rules/observability.md +13 -0
- package/rules/performance.md +39 -0
- package/rules/runtime.md +9 -0
- package/rules/secrets.md +11 -0
- package/rules/stack.md +33 -0
- package/rules/ui.md +23 -0
- package/runtime/ai.test.ts +106 -0
- package/runtime/ai.ts +125 -0
- package/runtime/observability/allowlists.ts +42 -0
- package/runtime/observability/anonymize.test.ts +111 -0
- package/runtime/observability/anonymize.ts +249 -0
- package/runtime/observability/browser.test.ts +46 -0
- package/runtime/observability/browser.ts +126 -0
- package/runtime/observability/server.test.ts +84 -0
- package/runtime/observability/server.ts +152 -0
- package/runtime/observability/tunnel.test.ts +276 -0
- package/runtime/observability/tunnel.ts +360 -0
- package/runtime/observability/user-agent.ts +51 -0
- package/schema/rc.config.schema.json +333 -0
- package/template/.gitattributes +1 -0
- package/template/.github/workflows/ci.yml +64 -0
- package/template/CLAUDE.md +48 -0
- package/template/README.md +50 -0
- package/template/apps/admin/.dev.vars.example +5 -0
- package/template/apps/admin/components.json +24 -0
- package/template/apps/admin/package.json +48 -0
- package/template/apps/admin/public/favicon.svg +1 -0
- package/template/apps/admin/src/components/app-shell.tsx +41 -0
- package/template/apps/admin/src/components/dev-sign-in-links.tsx +57 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-context.ts +13 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-environment-panel.tsx +105 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-inbox-list.tsx +54 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-inbox-message.tsx +104 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-inbox-panel.tsx +130 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-launcher.tsx +45 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-panel.tsx +90 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-types.ts +11 -0
- package/template/apps/admin/src/components/dev-toolbar/dev-toolbar.tsx +61 -0
- package/template/apps/admin/src/components/dev-toolbar/development-devtools.tsx +32 -0
- package/template/apps/admin/src/components/login-form.tsx +115 -0
- package/template/apps/admin/src/components/login-sent.tsx +23 -0
- package/template/apps/admin/src/components/message-list.tsx +44 -0
- package/template/apps/admin/src/components/turnstile-challenge.tsx +140 -0
- package/template/apps/admin/src/components/ui/button.tsx +87 -0
- package/template/apps/admin/src/components/ui/callout.tsx +84 -0
- package/template/apps/admin/src/components/ui/card.tsx +48 -0
- package/template/apps/admin/src/components/ui/eyebrow.tsx +33 -0
- package/template/apps/admin/src/components/ui/field-error.tsx +24 -0
- package/template/apps/admin/src/components/ui/field.tsx +100 -0
- package/template/apps/admin/src/components/ui/input.tsx +73 -0
- package/template/apps/admin/src/components/ui/label.tsx +39 -0
- package/template/apps/admin/src/components/ui/skeleton.tsx +225 -0
- package/template/apps/admin/src/components/ui/spinner.tsx +12 -0
- package/template/apps/admin/src/components/ui/toaster.tsx +33 -0
- package/template/apps/admin/src/components/ui/tooltip.tsx +51 -0
- package/template/apps/admin/src/hooks/use-dev-inbox.ts +25 -0
- package/template/apps/admin/src/hooks/use-dev-toolbar-state.ts +48 -0
- package/template/apps/admin/src/lib/api.ts +39 -0
- package/template/apps/admin/src/lib/auth-client.ts +7 -0
- package/template/apps/admin/src/lib/dev-inbox-links.ts +66 -0
- package/template/apps/admin/src/lib/dev-tools-client.ts +54 -0
- package/template/apps/admin/src/lib/dev-tools-contract.ts +52 -0
- package/template/apps/admin/src/lib/messages.ts +5 -0
- package/template/apps/admin/src/lib/query-keys.ts +3 -0
- package/template/apps/admin/src/lib/security-headers.ts +18 -0
- package/template/apps/admin/src/lib/session.ts +27 -0
- package/template/apps/admin/src/lib/site-url.ts +7 -0
- package/template/apps/admin/src/lib/turnstile.ts +70 -0
- package/template/apps/admin/src/lib/ui-labels.tsx +182 -0
- package/template/apps/admin/src/lib/utils.ts +6 -0
- package/template/apps/admin/src/routeTree.gen.ts +109 -0
- package/template/apps/admin/src/router.tsx +29 -0
- package/template/apps/admin/src/routes/__root.tsx +56 -0
- package/template/apps/admin/src/routes/_app/index.tsx +38 -0
- package/template/apps/admin/src/routes/_app.tsx +26 -0
- package/template/apps/admin/src/routes/login.tsx +48 -0
- package/template/apps/admin/src/styles/app.css +11 -0
- package/template/apps/admin/src/worker.ts +88 -0
- package/template/apps/admin/tsconfig.json +19 -0
- package/template/apps/admin/vite.config.ts +69 -0
- package/template/apps/admin/wrangler.jsonc +92 -0
- package/template/apps/web/.env.example +1 -0
- package/template/apps/web/astro.config.ts +46 -0
- package/template/apps/web/package.json +33 -0
- package/template/apps/web/public/favicon.svg +1 -0
- package/template/apps/web/src/components/ContactForm.astro +78 -0
- package/template/apps/web/src/env.d.ts +11 -0
- package/template/apps/web/src/layouts/BaseLayout.astro +32 -0
- package/template/apps/web/src/lib/api.ts +8 -0
- package/template/apps/web/src/pages/api/messages.ts +32 -0
- package/template/apps/web/src/pages/index.astro +26 -0
- package/template/apps/web/src/pages/media/[...key].ts +4 -0
- package/template/apps/web/src/scripts/contact-form.ts +105 -0
- package/template/apps/web/src/scripts/error-reporting.ts +4 -0
- package/template/apps/web/src/scripts/turnstile.ts +177 -0
- package/template/apps/web/src/styles/global.css +11 -0
- package/template/apps/web/src/worker.ts +34 -0
- package/template/apps/web/tsconfig.json +11 -0
- package/template/apps/web/wrangler.jsonc +45 -0
- package/template/bun.lock +1925 -0
- package/template/bunfig.toml +2 -0
- package/template/gitignore +23 -0
- package/template/package.json +74 -0
- package/template/packages/api/components.json +21 -0
- package/template/packages/api/package.json +30 -0
- package/template/packages/api/src/client.ts +13 -0
- package/template/packages/api/src/cloudflare-env.d.ts +26 -0
- package/template/packages/api/src/emails/escape-html.ts +13 -0
- package/template/packages/api/src/emails/layout.ts +22 -0
- package/template/packages/api/src/emails/magic-link.ts +32 -0
- package/template/packages/api/src/emails/new-message.ts +32 -0
- package/template/packages/api/src/emails/send.ts +14 -0
- package/template/packages/api/src/lib/auth-guard.ts +16 -0
- package/template/packages/api/src/lib/auth.ts +108 -0
- package/template/packages/api/src/lib/context.ts +7 -0
- package/template/packages/api/src/lib/dev-inbox/routes.ts +77 -0
- package/template/packages/api/src/lib/dev-inbox/send.ts +57 -0
- package/template/packages/api/src/lib/dev-inbox/store.ts +185 -0
- package/template/packages/api/src/lib/dev-inbox.ts +6 -0
- package/template/packages/api/src/lib/dev-tools-contract.ts +52 -0
- package/template/packages/api/src/lib/environment.ts +17 -0
- package/template/packages/api/src/lib/turnstile.ts +33 -0
- package/template/packages/api/src/media.ts +45 -0
- package/template/packages/api/src/routes/admin-messages.ts +21 -0
- package/template/packages/api/src/routes/dev.ts +31 -0
- package/template/packages/api/src/routes/health.ts +7 -0
- package/template/packages/api/src/routes/messages.ts +58 -0
- package/template/packages/api/src/schemas.ts +18 -0
- package/template/packages/api/src/server.ts +29 -0
- package/template/packages/api/tsconfig.json +10 -0
- package/template/packages/db/migrations/0001_init.sql +79 -0
- package/template/packages/db/package.json +34 -0
- package/template/packages/db/prisma/schema.prisma +95 -0
- package/template/packages/db/prisma.config.ts +9 -0
- package/template/packages/db/scripts/migrate.ts +15 -0
- package/template/packages/db/scripts/new-migration.ts +185 -0
- package/template/packages/db/scripts/reset.ts +54 -0
- package/template/packages/db/scripts/seed.ts +44 -0
- package/template/packages/db/scripts/wrangler.ts +35 -0
- package/template/packages/db/src/d1.ts +7 -0
- package/template/packages/db/src/migration-guard.test.ts +43 -0
- package/template/packages/db/src/migration-guard.ts +51 -0
- package/template/packages/db/src/new-migration.test.ts +16 -0
- package/template/packages/db/src/scope.ts +38 -0
- package/template/packages/db/src/seed.ts +30 -0
- package/template/packages/db/src/sql.ts +42 -0
- package/template/packages/db/tsconfig.json +8 -0
- package/template/packages/shared/components.json +21 -0
- package/template/packages/shared/package.json +33 -0
- package/template/packages/shared/src/edge/origins.ts +20 -0
- package/template/packages/shared/src/edge/turnstile.ts +11 -0
- package/template/packages/shared/src/locales.ts +13 -0
- package/template/packages/shared/src/message-rules.ts +16 -0
- package/template/packages/shared/src/messages.test.ts +26 -0
- package/template/packages/shared/src/messages.ts +30 -0
- package/template/packages/shared/src/observability/build-release.ts +9 -0
- package/template/packages/shared/src/observability/error-reporting.ts +31 -0
- package/template/packages/shared/src/observability/error-tunnel.ts +20 -0
- package/template/packages/shared/src/observability/sentry-browser.ts +1 -0
- package/template/packages/shared/src/observability/server-errors.ts +74 -0
- package/template/packages/shared/src/project.ts +1 -0
- package/template/packages/shared/src/styles/rc-theme.css +138 -0
- package/template/packages/shared/src/styles/theme.css +9 -0
- package/template/packages/shared/tsconfig.json +10 -0
- package/template/rc.config.json +25 -0
- package/template/scripts/bootstrap-local.ts +42 -0
- package/template/tsconfig.base.json +20 -0
- package/template/tsconfig.json +8 -0
- package/template/tsconfig.worker.json +7 -0
- package/template/turbo.json +40 -0
- package/template/vite.config.ts +8 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
deployOrder,
|
|
5
|
+
infisicalEnvironment,
|
|
6
|
+
infisicalTarget,
|
|
7
|
+
parseConfig,
|
|
8
|
+
type RcConfig,
|
|
9
|
+
validateConfig,
|
|
10
|
+
} from "./config"
|
|
11
|
+
|
|
12
|
+
const VALID: RcConfig = {
|
|
13
|
+
project: "contoso-immo",
|
|
14
|
+
prefix: "gio",
|
|
15
|
+
account: "contoso",
|
|
16
|
+
apps: {
|
|
17
|
+
admin: { path: "apps/admin" },
|
|
18
|
+
web: { path: "apps/web", dependsOn: ["admin"] },
|
|
19
|
+
},
|
|
20
|
+
infisical: { projectId: "11111111-1111-4111-8111-111111111111" },
|
|
21
|
+
devEnvFiles: [
|
|
22
|
+
{ path: "apps/admin/.dev.vars" },
|
|
23
|
+
{ path: "apps/web/.env", include: ["PUBLIC_*"] },
|
|
24
|
+
],
|
|
25
|
+
naming: { legacy: [] },
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe("validateConfig", () => {
|
|
29
|
+
test("accepts the example of docs/rc-config.md", async () => {
|
|
30
|
+
const doc = await Bun.file(
|
|
31
|
+
new URL("../../docs/rc-config.md", import.meta.url)
|
|
32
|
+
).text()
|
|
33
|
+
const example = doc.match(/```jsonc\n([\s\S]*?)```/)?.[1] ?? ""
|
|
34
|
+
|
|
35
|
+
expect(parseConfig(example, "rc.config.json").prefix).toBe("ctm")
|
|
36
|
+
expect(validateConfig(VALID)).toEqual([])
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
test("reports schema errors with their JSON pointer", () => {
|
|
40
|
+
expect(
|
|
41
|
+
validateConfig({
|
|
42
|
+
...VALID,
|
|
43
|
+
prefix: "contoso",
|
|
44
|
+
account: "Acme Co",
|
|
45
|
+
extra: true,
|
|
46
|
+
apps: { admin: {} },
|
|
47
|
+
})
|
|
48
|
+
).toEqual([
|
|
49
|
+
"/prefix : « contoso » ne respecte pas ^[a-z]{3}$",
|
|
50
|
+
"/account : « Acme Co » ne respecte pas ^[a-z][a-z0-9-]*$",
|
|
51
|
+
"/apps/admin : propriété requise « path » absente",
|
|
52
|
+
"/extra : propriété inconnue",
|
|
53
|
+
])
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
test("checks the database block against its provider", () => {
|
|
57
|
+
const production = { projectId: "little-river-1", projectName: "contoso" }
|
|
58
|
+
|
|
59
|
+
expect(
|
|
60
|
+
validateConfig({
|
|
61
|
+
...VALID,
|
|
62
|
+
database: { provider: "neon", neon: { production } },
|
|
63
|
+
})
|
|
64
|
+
).toEqual([])
|
|
65
|
+
expect(
|
|
66
|
+
validateConfig({ ...VALID, database: { provider: "neon" } })
|
|
67
|
+
).toEqual(["/database/neon : requis avec provider neon"])
|
|
68
|
+
expect(
|
|
69
|
+
validateConfig({
|
|
70
|
+
...VALID,
|
|
71
|
+
database: {
|
|
72
|
+
provider: "neon",
|
|
73
|
+
neon: { production, devProjectName: "contoso" },
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
).toEqual([
|
|
77
|
+
"/database/neon/devProjectName : la base de dev doit être un autre projet que la production",
|
|
78
|
+
])
|
|
79
|
+
expect(
|
|
80
|
+
validateConfig({
|
|
81
|
+
...VALID,
|
|
82
|
+
database: { provider: "d1", d1: { app: "api", binding: "DB" } },
|
|
83
|
+
})
|
|
84
|
+
).toEqual(["/database/d1/app : app inconnue « api »"])
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
test("refuses an unknown or circular dependsOn", () => {
|
|
88
|
+
expect(
|
|
89
|
+
validateConfig({
|
|
90
|
+
...VALID,
|
|
91
|
+
apps: { web: { path: "w", dependsOn: ["api"] } },
|
|
92
|
+
})
|
|
93
|
+
).toEqual(["/apps/web/dependsOn : app inconnue « api »"])
|
|
94
|
+
expect(
|
|
95
|
+
validateConfig({
|
|
96
|
+
...VALID,
|
|
97
|
+
apps: {
|
|
98
|
+
a: { path: "a", dependsOn: ["b"] },
|
|
99
|
+
b: { path: "b", dependsOn: ["a"] },
|
|
100
|
+
},
|
|
101
|
+
})
|
|
102
|
+
).toEqual(["/apps : dépendance circulaire a → b → a"])
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
test("requires an Infisical project id and refuses unknown keys", () => {
|
|
106
|
+
expect(validateConfig({ ...VALID, infisical: {} })).toEqual([
|
|
107
|
+
"/infisical : propriété requise « projectId » absente",
|
|
108
|
+
])
|
|
109
|
+
expect(
|
|
110
|
+
validateConfig({ ...VALID, infisical: { projectId: "gio" } })
|
|
111
|
+
).toEqual([
|
|
112
|
+
expect.stringContaining("/infisical/projectId : « gio » ne respecte pas"),
|
|
113
|
+
])
|
|
114
|
+
expect(validateConfig({ ...VALID, vault: {} })).toEqual([
|
|
115
|
+
"/vault : propriété inconnue",
|
|
116
|
+
])
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
test("reports invalid JSON", () => {
|
|
120
|
+
expect(() => parseConfig("{ nope", "rc.config.json")).toThrow(
|
|
121
|
+
"n'est pas un JSON valide"
|
|
122
|
+
)
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
describe("deployOrder", () => {
|
|
127
|
+
test("deploys dependencies first", () => {
|
|
128
|
+
const apps = {
|
|
129
|
+
app: { path: "a", dependsOn: ["api"] },
|
|
130
|
+
api: { path: "b", dependsOn: ["mail", "realtime"] },
|
|
131
|
+
mail: { path: "c", dependsOn: ["realtime"] },
|
|
132
|
+
realtime: { path: "d" },
|
|
133
|
+
site: { path: "e" },
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
expect(deployOrder(apps, Object.keys(apps))).toEqual([
|
|
137
|
+
"realtime",
|
|
138
|
+
"mail",
|
|
139
|
+
"api",
|
|
140
|
+
"app",
|
|
141
|
+
"site",
|
|
142
|
+
])
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
describe("infisicalEnvironment", () => {
|
|
147
|
+
test("maps dev to dev, production to prod, and any other key to itself", () => {
|
|
148
|
+
expect(infisicalEnvironment(VALID, "dev", {})).toBe("dev")
|
|
149
|
+
expect(infisicalEnvironment(VALID, "production", {})).toBe("prod")
|
|
150
|
+
expect(infisicalEnvironment(VALID, "staging", {})).toBe("staging")
|
|
151
|
+
expect(infisicalEnvironment(VALID, "atlas-tours", {})).toBe("atlas-tours")
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
test("reads the mapping of rc.config.json before the defaults", () => {
|
|
155
|
+
const mapped: RcConfig = {
|
|
156
|
+
...VALID,
|
|
157
|
+
infisical: {
|
|
158
|
+
projectId: VALID.infisical.projectId,
|
|
159
|
+
environments: {
|
|
160
|
+
production: "contoso-live",
|
|
161
|
+
"atlas-tours": "tours-prod",
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
expect(infisicalEnvironment(mapped, "production", {})).toBe("contoso-live")
|
|
167
|
+
expect(infisicalEnvironment(mapped, "atlas-tours", {})).toBe("tours-prod")
|
|
168
|
+
expect(infisicalEnvironment(mapped, "dev", {})).toBe("dev")
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
test("lets INFISICAL_ENV_<ENV> win over the mapping", () => {
|
|
172
|
+
expect(
|
|
173
|
+
infisicalEnvironment(VALID, "production", {
|
|
174
|
+
INFISICAL_ENV_PRODUCTION: "prod-perso",
|
|
175
|
+
})
|
|
176
|
+
).toBe("prod-perso")
|
|
177
|
+
expect(
|
|
178
|
+
infisicalEnvironment(VALID, "atlas-tours", {
|
|
179
|
+
INFISICAL_ENV_ATLAS_TOURS: "tours-perso",
|
|
180
|
+
})
|
|
181
|
+
).toBe("tours-perso")
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
describe("infisicalTarget", () => {
|
|
186
|
+
test("pairs the project id of rc.config.json with the mapped environment", () => {
|
|
187
|
+
expect(infisicalTarget(VALID, "production", {})).toEqual({
|
|
188
|
+
projectId: "11111111-1111-4111-8111-111111111111",
|
|
189
|
+
environment: "prod",
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
test("lets INFISICAL_PROJECT_ID win over rc.config.json", () => {
|
|
194
|
+
expect(
|
|
195
|
+
infisicalTarget(VALID, "dev", {
|
|
196
|
+
INFISICAL_PROJECT_ID: "33333333-3333-4333-8333-333333333333",
|
|
197
|
+
})
|
|
198
|
+
).toEqual({
|
|
199
|
+
projectId: "33333333-3333-4333-8333-333333333333",
|
|
200
|
+
environment: "dev",
|
|
201
|
+
})
|
|
202
|
+
})
|
|
203
|
+
})
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs"
|
|
2
|
+
import { dirname, isAbsolute, join, resolve } from "node:path"
|
|
3
|
+
|
|
4
|
+
import { parseJsonc } from "./jsonc"
|
|
5
|
+
import { type JsonSchema, validateSchema } from "./json-schema"
|
|
6
|
+
import { type Account, isAccount } from "./naming"
|
|
7
|
+
import { CONFIG_FILE, SCHEMA_PATH } from "./paths"
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_ENVIRONMENT = "production"
|
|
10
|
+
export const PLACEHOLDER_PROJECT_ID = "00000000-0000-0000-0000-000000000000"
|
|
11
|
+
|
|
12
|
+
const DEFAULT_INFISICAL_ENVIRONMENTS: Record<string, string> = {
|
|
13
|
+
dev: "dev",
|
|
14
|
+
production: "prod",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface AppConfig {
|
|
18
|
+
path: string
|
|
19
|
+
dependsOn?: string[]
|
|
20
|
+
optionalSecrets?: string[]
|
|
21
|
+
localOnlyBindings?: string[]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface DevEnvFile {
|
|
25
|
+
path: string
|
|
26
|
+
include?: string[]
|
|
27
|
+
exclude?: string[]
|
|
28
|
+
generate?: string[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface DevTarget {
|
|
32
|
+
path: string
|
|
33
|
+
label: string
|
|
34
|
+
url?: string
|
|
35
|
+
companions?: string[]
|
|
36
|
+
host?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DevConfig {
|
|
40
|
+
targets: Record<string, DevTarget>
|
|
41
|
+
presets?: Record<string, string[]>
|
|
42
|
+
defaultPreset?: string
|
|
43
|
+
bootstrap?: string[]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface InfisicalConfig {
|
|
47
|
+
projectId: string
|
|
48
|
+
environments?: Record<string, string>
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface SentryConfig {
|
|
52
|
+
org: string
|
|
53
|
+
url?: string
|
|
54
|
+
projects: Record<string, string>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface DatabaseCommand {
|
|
58
|
+
command: string[]
|
|
59
|
+
cwd?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface NeonDatabaseConfig {
|
|
63
|
+
production: {
|
|
64
|
+
projectId: string
|
|
65
|
+
projectName: string
|
|
66
|
+
endpointId?: string
|
|
67
|
+
}
|
|
68
|
+
devProjectName?: string
|
|
69
|
+
featureBranchTtlDays?: number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface DatabaseConfig {
|
|
73
|
+
provider: "neon" | "d1"
|
|
74
|
+
envFile?: string
|
|
75
|
+
migrate?: DatabaseCommand
|
|
76
|
+
seed?: DatabaseCommand
|
|
77
|
+
neon?: NeonDatabaseConfig
|
|
78
|
+
d1?: { app: string; binding: string }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface RcConfig {
|
|
82
|
+
project: string
|
|
83
|
+
kit?: string
|
|
84
|
+
prefix: string
|
|
85
|
+
account: Account
|
|
86
|
+
apps: Record<string, AppConfig>
|
|
87
|
+
infisical: InfisicalConfig
|
|
88
|
+
sentry?: SentryConfig
|
|
89
|
+
devEnvFiles?: DevEnvFile[]
|
|
90
|
+
naming?: {
|
|
91
|
+
legacy?: string[]
|
|
92
|
+
externalWorkers?: string[]
|
|
93
|
+
clients?: Record<string, string>
|
|
94
|
+
}
|
|
95
|
+
dev?: DevConfig
|
|
96
|
+
database?: DatabaseConfig
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface LoadedConfig {
|
|
100
|
+
config: RcConfig
|
|
101
|
+
configPath: string
|
|
102
|
+
root: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export class ConfigError extends Error {
|
|
106
|
+
constructor(
|
|
107
|
+
message: string,
|
|
108
|
+
readonly details: string[] = []
|
|
109
|
+
) {
|
|
110
|
+
super(message)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
let cachedSchema: JsonSchema | undefined
|
|
115
|
+
|
|
116
|
+
export function rcConfigSchema(): JsonSchema {
|
|
117
|
+
cachedSchema ??= JSON.parse(readFileSync(SCHEMA_PATH, "utf8")) as JsonSchema
|
|
118
|
+
|
|
119
|
+
return cachedSchema
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function dependencyErrors(apps: Record<string, AppConfig>): string[] {
|
|
123
|
+
const errors: string[] = []
|
|
124
|
+
|
|
125
|
+
for (const [name, app] of Object.entries(apps)) {
|
|
126
|
+
for (const dependency of app.dependsOn ?? []) {
|
|
127
|
+
if (!Object.hasOwn(apps, dependency)) {
|
|
128
|
+
errors.push(`/apps/${name}/dependsOn : app inconnue « ${dependency} »`)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (errors.length === 0) {
|
|
134
|
+
try {
|
|
135
|
+
deployOrder(apps, Object.keys(apps))
|
|
136
|
+
} catch (error) {
|
|
137
|
+
errors.push(error instanceof Error ? error.message : String(error))
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return errors
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function hostErrors(
|
|
145
|
+
dev: DevConfig,
|
|
146
|
+
name: string,
|
|
147
|
+
host: string | undefined
|
|
148
|
+
): string[] {
|
|
149
|
+
if (host === undefined) {
|
|
150
|
+
return []
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (!Object.hasOwn(dev.targets, host)) {
|
|
154
|
+
return [`/dev/targets/${name}/host : cible inconnue « ${host} »`]
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (host === name) {
|
|
158
|
+
return [`/dev/targets/${name}/host : une cible ne s'héberge pas elle-même`]
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (dev.targets[host]?.host !== undefined) {
|
|
162
|
+
return [`/dev/targets/${name}/host : « ${host} » est elle-même hébergée`]
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return []
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function devErrors(dev: DevConfig | undefined): string[] {
|
|
169
|
+
if (!dev) {
|
|
170
|
+
return []
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const targets = Object.keys(dev.targets)
|
|
174
|
+
const presets = Object.entries(dev.presets ?? {})
|
|
175
|
+
const errors: string[] = []
|
|
176
|
+
|
|
177
|
+
for (const [name, target] of Object.entries(dev.targets)) {
|
|
178
|
+
for (const companion of target.companions ?? []) {
|
|
179
|
+
if (!targets.includes(companion)) {
|
|
180
|
+
errors.push(
|
|
181
|
+
`/dev/targets/${name}/companions : cible inconnue « ${companion} »`
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
errors.push(...hostErrors(dev, name, target.host))
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
for (const [preset, members] of presets) {
|
|
190
|
+
if (targets.includes(preset)) {
|
|
191
|
+
errors.push(`/dev/presets/${preset} : même nom qu'une cible`)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
for (const member of members) {
|
|
195
|
+
if (!targets.includes(member)) {
|
|
196
|
+
errors.push(`/dev/presets/${preset} : cible inconnue « ${member} »`)
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (
|
|
202
|
+
dev.defaultPreset &&
|
|
203
|
+
!Object.hasOwn(dev.presets ?? {}, dev.defaultPreset)
|
|
204
|
+
) {
|
|
205
|
+
errors.push(
|
|
206
|
+
`/dev/defaultPreset : préréglage inconnu « ${dev.defaultPreset} »`
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return errors
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function databaseErrors(config: RcConfig): string[] {
|
|
214
|
+
const database = config.database
|
|
215
|
+
|
|
216
|
+
if (!database) {
|
|
217
|
+
return []
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (database.provider === "neon") {
|
|
221
|
+
const production = database.neon?.production
|
|
222
|
+
|
|
223
|
+
if (!production) {
|
|
224
|
+
return ["/database/neon : requis avec provider neon"]
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (database.d1) {
|
|
228
|
+
return ["/database/d1 : réservé à provider d1"]
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const devName =
|
|
232
|
+
database.neon?.devProjectName ?? `${production.projectName}-dev`
|
|
233
|
+
|
|
234
|
+
return devName === production.projectName
|
|
235
|
+
? [
|
|
236
|
+
"/database/neon/devProjectName : la base de dev doit être un autre projet que la production",
|
|
237
|
+
]
|
|
238
|
+
: []
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (!database.d1) {
|
|
242
|
+
return ["/database/d1 : requis avec provider d1"]
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (database.neon) {
|
|
246
|
+
return ["/database/neon : réservé à provider neon"]
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return Object.hasOwn(config.apps, database.d1.app)
|
|
250
|
+
? []
|
|
251
|
+
: [`/database/d1/app : app inconnue « ${database.d1.app} »`]
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function validateConfig(value: unknown): string[] {
|
|
255
|
+
const errors = validateSchema(value, rcConfigSchema()).map(
|
|
256
|
+
(error) => `${error.path || "/"} : ${error.message}`
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
if (errors.length > 0) {
|
|
260
|
+
return errors
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const config = value as RcConfig
|
|
264
|
+
|
|
265
|
+
if (!isAccount(config.account)) {
|
|
266
|
+
return [`/account : compte inconnu`]
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return [
|
|
270
|
+
...dependencyErrors(config.apps),
|
|
271
|
+
...devErrors(config.dev),
|
|
272
|
+
...databaseErrors(config),
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function parseConfig(source: string, configPath: string): RcConfig {
|
|
277
|
+
let value: unknown
|
|
278
|
+
|
|
279
|
+
try {
|
|
280
|
+
value = parseJsonc(source)
|
|
281
|
+
} catch (error) {
|
|
282
|
+
throw new ConfigError(
|
|
283
|
+
`${configPath} n'est pas un JSON valide : ${error instanceof Error ? error.message : String(error)}`
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const errors = validateConfig(value)
|
|
288
|
+
|
|
289
|
+
if (errors.length > 0) {
|
|
290
|
+
throw new ConfigError(`${configPath} est invalide.`, errors)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return value as RcConfig
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export function findProjectRoot(start: string): string {
|
|
297
|
+
let dir = resolve(start)
|
|
298
|
+
|
|
299
|
+
while (!existsSync(join(dir, CONFIG_FILE))) {
|
|
300
|
+
const parent = dirname(dir)
|
|
301
|
+
|
|
302
|
+
if (parent === dir) {
|
|
303
|
+
return resolve(start)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
dir = parent
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return dir
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function resolveConfigPath(root: string, explicit?: string): string {
|
|
313
|
+
if (!explicit) {
|
|
314
|
+
return join(root, CONFIG_FILE)
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return isAbsolute(explicit) ? explicit : resolve(process.cwd(), explicit)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function loadConfig(options: {
|
|
321
|
+
root: string
|
|
322
|
+
config?: string
|
|
323
|
+
}): LoadedConfig {
|
|
324
|
+
const configPath = resolveConfigPath(options.root, options.config)
|
|
325
|
+
|
|
326
|
+
if (!existsSync(configPath)) {
|
|
327
|
+
throw new ConfigError(
|
|
328
|
+
`Aucun ${CONFIG_FILE} trouvé (${configPath}). Crée-le à la racine du projet (voir docs/rc-config.md) ou passe --config <chemin>.`
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
return {
|
|
333
|
+
config: parseConfig(readFileSync(configPath, "utf8"), configPath),
|
|
334
|
+
configPath,
|
|
335
|
+
root: options.root,
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export function deployOrder(
|
|
340
|
+
apps: Record<string, AppConfig>,
|
|
341
|
+
selected: string[]
|
|
342
|
+
): string[] {
|
|
343
|
+
const order: string[] = []
|
|
344
|
+
const state = new Map<string, "visiting" | "done">()
|
|
345
|
+
|
|
346
|
+
function visit(name: string, trail: string[]): void {
|
|
347
|
+
if (state.get(name) === "done") {
|
|
348
|
+
return
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (state.get(name) === "visiting") {
|
|
352
|
+
throw new Error(
|
|
353
|
+
`/apps : dépendance circulaire ${[...trail, name].join(" → ")}`
|
|
354
|
+
)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
state.set(name, "visiting")
|
|
358
|
+
|
|
359
|
+
for (const dependency of apps[name]?.dependsOn ?? []) {
|
|
360
|
+
visit(dependency, [...trail, name])
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
state.set(name, "done")
|
|
364
|
+
order.push(name)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
for (const name of selected) {
|
|
368
|
+
visit(name, [])
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
return order
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface InfisicalTarget {
|
|
375
|
+
projectId: string
|
|
376
|
+
environment: string
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export function envVarSuffix(environment: string): string {
|
|
380
|
+
return environment.toUpperCase().replaceAll("-", "_")
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export function infisicalEnvironment(
|
|
384
|
+
config: RcConfig,
|
|
385
|
+
environment: string,
|
|
386
|
+
env: Record<string, string | undefined> = process.env
|
|
387
|
+
): string {
|
|
388
|
+
return (
|
|
389
|
+
env[`INFISICAL_ENV_${envVarSuffix(environment)}`] ||
|
|
390
|
+
config.infisical.environments?.[environment] ||
|
|
391
|
+
DEFAULT_INFISICAL_ENVIRONMENTS[environment] ||
|
|
392
|
+
environment
|
|
393
|
+
)
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export function infisicalTarget(
|
|
397
|
+
config: RcConfig,
|
|
398
|
+
environment: string,
|
|
399
|
+
env: Record<string, string | undefined> = process.env
|
|
400
|
+
): InfisicalTarget {
|
|
401
|
+
return {
|
|
402
|
+
projectId: env.INFISICAL_PROJECT_ID || config.infisical.projectId,
|
|
403
|
+
environment: infisicalEnvironment(config, environment, env),
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export function appDir(loaded: LoadedConfig, app: string): string {
|
|
408
|
+
const entry = loaded.config.apps[app]
|
|
409
|
+
|
|
410
|
+
if (!entry) {
|
|
411
|
+
throw new Error(
|
|
412
|
+
`App inconnue « ${app} ». Apps de ${loaded.configPath} : ${Object.keys(loaded.config.apps).join(", ")}.`
|
|
413
|
+
)
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return resolve(loaded.root, entry.path)
|
|
417
|
+
}
|