diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71a1cedf..2057db0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,18 @@ jobs: build: name: Builds & Tests runs-on: ubuntu-latest + strategy: + matrix: + prj: + [ + eslint-config, + handles, + helpers, + internals, + vite-plugin-kit-routes, + vite-plugin-stripper, + vite-plugin-watch-and-run, + ] steps: - name: ๐ŸŒ Checkout Repository uses: actions/checkout@v4 @@ -23,46 +35,10 @@ jobs: nodeVersion: 22.11.0 - name: ๐Ÿšง Build Packages - run: pnpm -r build + run: pnpm -F "!website" build - name: ๐Ÿงน Lint Check - run: pnpm -r lint + run: pnpm -F ${{ matrix.prj }} lint - name: ๐Ÿ‘Œ Run Tests - run: pnpm -r test:ci - - # verify_create: - # name: Verify Create - # runs-on: ubuntu-latest - # strategy: - # matrix: - # template: [kit-routes] - # # template: [kit-routes, sveltekit-remult] - # steps: - # - name: ๐ŸŒ Checkout Repository - # uses: actions/checkout@v4 - # with: - # # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits - # fetch-depth: 0 - - # - name: ๐Ÿง‘โ€๐Ÿ’ป Setup env - # uses: jycouet/jycouet/shared-config/setup@main - # with: - # pnpmVersion: 9.15.1 - # nodeVersion: 22.11.0 - - # - name: ๐Ÿšง Run build - # run: pnpm build - - # - name: โž• Create template - # run: - # cd packages/create-kitql && pnpm dev test-${{ matrix.template }} -t ${{ matrix.template }} - - # - name: ๐Ÿง‘โ€๐Ÿ’ป Install playwright - # run: cd packages/create-kitql/test-${{ matrix.template }} && npx playwright@1.46.1 install - - # - name: ๐Ÿ› ๏ธ e2e install - # run: cd packages/create-kitql/test-${{ matrix.template }} && pnpm i --no-frozen-lockfile - - # - name: ๐Ÿ‘Œ e2e tests (build, e2e, unit) - # run: cd packages/create-kitql/test-${{ matrix.template }} && pnpm run test:ci + run: pnpm -F ${{ matrix.prj }} test:ci diff --git a/packages/vite-plugin-kit-routes/src/lib/ROUTES.ts b/packages/vite-plugin-kit-routes/src/lib/ROUTES.ts index ac5ded5f..70036f2b 100644 --- a/packages/vite-plugin-kit-routes/src/lib/ROUTES.ts +++ b/packages/vite-plugin-kit-routes/src/lib/ROUTES.ts @@ -258,7 +258,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts - * import type { KIT_ROUTES } from '$lib/ROUTES' + * import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/lib/plugin.ts b/packages/vite-plugin-kit-routes/src/lib/plugin.ts index 1061ee6f..29f703af 100644 --- a/packages/vite-plugin-kit-routes/src/lib/plugin.ts +++ b/packages/vite-plugin-kit-routes/src/lib/plugin.ts @@ -675,8 +675,8 @@ export function buildMetadata( const pathBaesStr = options?.router_type === 'hash' ? '#' : options?.path_base ? '${base}' : '' const strDefault = paramsDefaults.length > 0 ? `${paramsDefaults.join('\n')}` : '' - const completeToRet = `${pathBaesStr}${toRet}`; - const trailingSlashToUse = o.trailingSlash === 'always' && !completeToRet.endsWith("/") ? '/' : '' + const completeToRet = `${pathBaesStr}${toRet}` + const trailingSlashToUse = o.trailingSlash === 'always' && !completeToRet.endsWith('/') ? '/' : '' const strReturn = `\`${completeToRet}${trailingSlashToUse}${actionsFormat}${fullSP}\`` const strParams = params.join(', ') @@ -1050,8 +1050,8 @@ ${objTypes return false } -// eslint-disable-next-line -let dolLib = ['$', 'lib'].join('') +// const dolLib = ['$', 'lib'].join('') +const dolLib = ['$', '_', 'lib'].join('') function theEnd( atStart: boolean, diff --git a/packages/vite-plugin-kit-routes/src/lib/plugins.spec.ts b/packages/vite-plugin-kit-routes/src/lib/plugins.spec.ts index 256fc8fc..d817666a 100644 --- a/packages/vite-plugin-kit-routes/src/lib/plugins.spec.ts +++ b/packages/vite-plugin-kit-routes/src/lib/plugins.spec.ts @@ -836,7 +836,8 @@ describe('run()', async () => { path_base: true, }) - expect(read(generated_file_path)?.includes("import { base } from '$app/paths'")).toBe(true) + expect(read(generated_file_path)?.includes('import { base } from')).toBe(true) + expect(read(generated_file_path)?.includes('$app/paths')).toBe(true) expect(read(generated_file_path)?.includes('${base}')).toBe(true) }) @@ -847,7 +848,7 @@ describe('run()', async () => { router_type: 'hash', }) - expect(read(generated_file_path)?.includes(`"/": \`#/\``)).toBe(true) + expect(read(generated_file_path)?.includes('#/')).toBe(true) }) }) diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_base.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_base.ts index 5915bb8d..30e0d5b0 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_base.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_base.ts @@ -174,7 +174,7 @@ export const routes = [ /** * To be used like this: * ```ts - * import { route } from '$lib/ROUTES' + * import { route } from './ROUTES' * * route('site_id', { id: 1 }) * ``` diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path.ts index b42cb3b0..f8489e7f 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path.ts @@ -176,7 +176,7 @@ export const currentSp = () => { * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path_shortened.ts index ae7d0a3b..fe6daf14 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-path_shortened.ts @@ -177,7 +177,7 @@ export const currentSp = () => { * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol.ts index 1adb3a17..756e52d3 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol.ts @@ -180,7 +180,7 @@ export const currentSp = () => { * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol_shortened.ts index e90f1c82..6d5f13fb 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-object-symbol_shortened.ts @@ -181,7 +181,7 @@ export const currentSp = () => { * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path.ts index 387abf3e..3e2ba1b7 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path.ts @@ -208,7 +208,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path_shortened.ts index ea0865e2..9a3e86f6 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-path_shortened.ts @@ -209,7 +209,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol.ts index 8690c4d1..92f6350b 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol.ts @@ -187,7 +187,7 @@ export const routes = [ /** * To be used like this: * ```ts - * import { route } from '$lib/ROUTES' + * import { route } from './ROUTES' * * route('site_id', { id: 1 }) * ``` diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol_shortened.ts index 843a1809..89565dea 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-and-object-symbol_shortened.ts @@ -209,7 +209,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id.ts index 04ad63ba..61e5eaa9 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id.ts @@ -208,7 +208,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id_shortened.ts index d00ce825..6ce789a0 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path-page-route-id_shortened.ts @@ -209,7 +209,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path.ts index fa74e0ec..476cdbd6 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path.ts @@ -208,7 +208,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path_shortened.ts index 05be11fd..7a851920 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-path_shortened.ts @@ -209,7 +209,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol.ts index 1c2e06de..b47b27b5 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol.ts @@ -208,7 +208,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol_shortened.ts index 80ef3c68..77e8559e 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-route-symbol_shortened.ts @@ -209,7 +209,7 @@ export function route(key: T, ...params: any[]): strin * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables.ts index ca7c1c33..7a78e73c 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables.ts @@ -172,7 +172,7 @@ export const currentSp = () => { * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables_shortened.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables_shortened.ts index 8ed0c34d..716177f5 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables_shortened.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_format-variables_shortened.ts @@ -173,7 +173,7 @@ export const currentSp = () => { * * Full example: * ```ts -* import type { KIT_ROUTES } from '$lib/ROUTES' +* import type { KIT_ROUTES } from '$_lib/ROUTES' * import { kitRoutes } from 'vite-plugin-kit-routes' * * kitRoutes({ diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_hash.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_hash.ts index 06ae2e7e..80fda932 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_hash.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_hash.ts @@ -173,7 +173,7 @@ export const routes = [ /** * To be used like this: * ```ts - * import { route } from '$lib/ROUTES' + * import { route } from './ROUTES' * * route('site_id', { id: 1 }) * ``` diff --git a/packages/vite-plugin-kit-routes/src/test/ROUTES_post-update.ts b/packages/vite-plugin-kit-routes/src/test/ROUTES_post-update.ts index ccc4ab1e..fc1bdd7f 100644 --- a/packages/vite-plugin-kit-routes/src/test/ROUTES_post-update.ts +++ b/packages/vite-plugin-kit-routes/src/test/ROUTES_post-update.ts @@ -173,7 +173,7 @@ export const routes = [ /** * To be used like this: * ```ts - * import { route } from '$lib/ROUTES' + * import { route } from './ROUTES' * * route('site_id', { id: 1 }) * ``` diff --git a/website/src/pages/docs/_meta.ts b/website/src/pages/docs/_meta.ts index a52f3777..cf0e0494 100644 --- a/website/src/pages/docs/_meta.ts +++ b/website/src/pages/docs/_meta.ts @@ -1,6 +1,6 @@ export default { index: 'Introduction', - create: 'npm create kitql', + // create: 'npm create kitql', tools: 'Tools', faq: 'F.A.Q.', } diff --git a/website/src/pages/docs/create.mdx b/website/src/pages/docs/create.mdx index 00f5757c..741f29a0 100644 --- a/website/src/pages/docs/create.mdx +++ b/website/src/pages/docs/create.mdx @@ -2,6 +2,10 @@ import { Callout } from '@theguild/components' # โž• How to - `npm create kitql` + + All best practices are now in `npm create remult@latest` _(with the sveltekit template)_. + + This is a cli to help you get started with KitQL and all tooling around it. You will have different templates available to help you get started. @@ -19,14 +23,6 @@ npm create kitql@latest npm create kitql@latest demo-kitql --template sveltekit-remult ``` -### ๐ŸŒ Online - -[![](https://img.shields.io/badge/Open_in-SvelteLab-black?logo=svelte&color=%23FF3E00)](https://www.sveltelab.dev/?provider=github&owner=jycouet&repo=kitql&branch=main&path=%2Fpackages%2Fcreate-kitql%2Ftemplates%2Fsveltekit-remult) - -[![](https://img.shields.io/badge/Open_in-CodeSandbox-black?logo=codesandbox&color=%23151515)](https://codesandbox.io/p/sandbox/github/jycouet/kitql/tree/main/packages/create-kitql/templates/sveltekit-remult) - -[![](https://img.shields.io/badge/Open_in-StackBlitz-black?logo=stackblitz&color=%231269D3)](https://stackblitz.com/github.com/jycouet/kitql/tree/main/packages/create-kitql/templates/sveltekit-remult) - ## โญ๏ธ Join us [![GitHub Repo stars](https://img.shields.io/github/stars/jycouet/kitql?logo=github&label=KitQL&color=#4ACC31)](https://github.com/jycouet/kitql)