Skip to content

Commit

Permalink
🚧 UPDATE: CI (#819)
Browse files Browse the repository at this point in the history
* 🚧 UPDATE: CI

* let's check

* !website

* no mater the format

* update links (fix #820)

* dollib
  • Loading branch information
jycouet authored Dec 28, 2024
1 parent 650e2ca commit f58f9f5
Show file tree
Hide file tree
Showing 25 changed files with 47 additions and 74 deletions.
54 changes: 15 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 [email protected] 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
2 changes: 1 addition & 1 deletion packages/vite-plugin-kit-routes/src/lib/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
8 changes: 4 additions & 4 deletions packages/vite-plugin-kit-routes/src/lib/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ')
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions packages/vite-plugin-kit-routes/src/lib/plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand All @@ -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)
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-kit-routes/src/test/ROUTES_base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function route<T extends keyof AllTypes>(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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<KIT_ROUTES>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<KIT_ROUTES>({
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-kit-routes/src/test/ROUTES_hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
* ```
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/docs/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
index: 'Introduction',
create: 'npm create kitql',
// create: 'npm create kitql',
tools: 'Tools',
faq: 'F.A.Q.',
}
12 changes: 4 additions & 8 deletions website/src/pages/docs/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { Callout } from '@theguild/components'

# ➕ How to - `npm create kitql`

<Callout type="info" emoji="💡">
All best practices are now in `npm create remult@latest` _(with the sveltekit template)_.
</Callout>

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.

Expand All @@ -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)

0 comments on commit f58f9f5

Please sign in to comment.