Skip to content

Commit

Permalink
📦 RELEASE: preparing next version (next) (#732)
Browse files Browse the repository at this point in the history
* 📦 RELEASE: new version (next)

* node version

* update

* let's see :(

* I want to have dis

* lint

* lint prettier and everything

* re run ?

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: jycouet <[email protected]>
  • Loading branch information
3 people authored Sep 11, 2024
1 parent 3056914 commit a354e28
Show file tree
Hide file tree
Showing 17 changed files with 116 additions and 105 deletions.
5 changes: 4 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"vite-plugin-watch-and-run": "1.7.1",
"website": "1.1.2"
},
"changesets": []
"changesets": [
"empty-coats-repeat",
"thick-ducks-grin"
]
}
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: jycouet/jycouet/shared-config/setup@main
with:
pnpmVersion: 9
# nodeVersion: 18
nodeVersion: 22.6.0

# - name: 🛠️ Prepare nx 1/2
# uses: nrwl/nx-set-shas@v4
Expand Down Expand Up @@ -48,7 +48,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
template: [kit-routes, sveltekit-remult]
template: [kit-routes]
# template: [kit-routes, sveltekit-remult]
steps:
- name: 🌐 Checkout Repository
uses: actions/checkout@v4
Expand All @@ -60,7 +61,7 @@ jobs:
uses: jycouet/jycouet/shared-config/setup@main
with:
pnpmVersion: 9
# nodeVersion: 18
nodeVersion: 22.6.0

- name: 🚧 Run nx build
run: pnpm build
Expand Down
13 changes: 13 additions & 0 deletions packages/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# eslint-config-kitql

## 0.4.0-next.0

### Minor Changes

- [#733](https://github.com/jycouet/kitql/pull/733)
[`8aee9fa`](https://github.com/jycouet/kitql/commit/8aee9fae8d8440a39c85afa3852e4767479c267b)
Thanks [@jycouet](https://github.com/jycouet)! - Bump to eslint 9 and prettier 3

### Patch Changes

- Updated dependencies []:
- @kitql/helpers@0.8.10

## 0.3.7

### Patch Changes
Expand Down
125 changes: 38 additions & 87 deletions packages/eslint-config/cmd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import { spawn, spawnSync } from 'node:child_process'
import { spawnSync } from 'node:child_process'
import fs from 'node:fs'
import { Option, program } from 'commander'

Expand Down Expand Up @@ -55,54 +55,33 @@ if (pre === 'npm') {
preToUse = ''
}

// First prettier
const cmdPrettier =
preToUse +
`prettier` +
` --list-different` +
// ignore?
` --ignore-path ${pathPrettierIgnore}` +
// config
` --config ${pathPrettierCjs}` +
// format or not
`${format ? ' --write' : ''}` +
// exec
` ${glob}`

if (verbose) {
log.info(cmdPrettier)
}
const result_prettier = spawn(cmdPrettier, {
shell: true,
cwd: process.cwd(),
stdio: 'pipe',
})

// let's not log anything when we are formating prettier
if (!format) {
const logPrettier = new Log('kitql-lint prettier')
result_prettier.stdout.on('data', (data) => {
logPrettier.error(
data
.toString()
// rmv the last \n if any
.replace(/\n$/, ''),
)
})
}
if (format && verbose) {
const logPrettier = new Log('kitql-lint prettier')
result_prettier.stdout.on('data', (data) => {
logPrettier.success(
data
.toString()
// rmv the last \n if any
.replace(/\n$/, ''),
)
function prettierRun() {
const cmdPrettier =
preToUse +
`prettier` +
` --list-different` +
// ignore?
` --ignore-path ${pathPrettierIgnore}` +
// config
` --config ${pathPrettierCjs}` +
// format or not
`${format ? ' --write' : ''}` +
// exec
` ${glob}`

if (verbose) {
log.info(cmdPrettier)
}
const result_prettier = spawnSync(cmdPrettier, {
shell: true,
cwd: process.cwd(),
stdio: 'pipe',
})

return result_prettier
}

function esLintRun(code) {
function eslintRun() {
// Then eslint
const cmdEsLint =
preToUse +
Expand All @@ -124,48 +103,20 @@ function esLintRun(code) {
stdio: 'inherit',
})

if (result_eslint.status) {
log.error(red(`eslint failed, check logs above.`))
}

if (code === 0 && result_eslint.status === 0) {
log.success(`All good, your files looks great!`)
}

process.exit(code || result_eslint.status)
return result_eslint
}

result_prettier.stdout.on('end', (data) => {
if (verbose) {
log.info(`end`, data)
}
})
result_prettier.stdout.on('error', (data) => {
if (verbose) {
log.info(`error`, data)
}
})
result_prettier.stdout.on('pause', (data) => {
if (verbose) {
log.info(`pause`, data)
}
})
result_prettier.stdout.on('readable', (data) => {
if (verbose) {
log.info(`readable`, data)
}
})
result_prettier.stdout.on('resume', (data) => {
if (verbose && data) {
log.info(`resume`, data)
}
esLintRun(0)
})
const eslintCode = eslintRun()
if (eslintCode.status) {
log.error(red(`eslint failed, check logs above.`))
process.exit(eslintCode.status)
}

result_prettier.on('close', (data) => {
if (verbose) {
log.info(`close`, data)
}
const prettierCode = prettierRun()
if (prettierCode.status) {
log.error(red(`prettier failed, check logs above.`))
process.exit(eslintCode.status)
}

esLintRun(data)
})
log.success(`All good, your files looks great!`)
process.exit(0)
Empty file.
8 changes: 6 additions & 2 deletions packages/eslint-config/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import globals from 'globals'
import ts from 'typescript-eslint'

/** @type {import('eslint').Linter.Config[]} */
export default [
export const config = [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
Expand All @@ -28,13 +28,15 @@ export default [
ignores: ['build/', '.svelte-kit/', 'dist/'],
},
{
name: '@kitql rules',
rules: {
'no-console': [
'error',
{
allow: ['info', 'warn', 'error', 'time', 'timeEnd', 'dir'],
},
],

'@typescript-eslint/no-unused-vars': [
'warn',
{
Expand All @@ -52,9 +54,11 @@ export default [
'@typescript-eslint/no-empty-object-type': 'off',

'no-undef': 'off',
'svelte/no-at-html-tags': 'off',
'no-inner-declarations': 'off',
'svelte/no-at-html-tags': 'off',
'svelte/no-inner-declarations': 'off',
},
},
]

export default config
5 changes: 3 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kitql/eslint-config",
"version": "0.3.7",
"version": "0.4.0-next.0",
"type": "module",
"description": "opinionated linting and formatting for projects",
"repository": {
Expand All @@ -18,7 +18,8 @@
".prettierrc.cjs",
"cmd.js",
"cmd.sh",
"eslint.config.js"
"eslint.config.js",
"eslint.config.d.ts"
],
"keywords": [
"cli",
Expand Down
11 changes: 11 additions & 0 deletions packages/internals/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @kitql/internals

## 0.9.10-next.0

### Patch Changes

- [#731](https://github.com/jycouet/kitql/pull/731)
[`1bd5ea8`](https://github.com/jycouet/kitql/commit/1bd5ea8c5dc08f995b16d015d23dd577a14a7cf6)
Thanks [@jycouet](https://github.com/jycouet)! - bump internal usage of svelte

- Updated dependencies []:
- @kitql/helpers@0.8.10

## 0.9.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"AST",
"fs"
],
"version": "0.9.9",
"version": "0.9.10-next.0",
"license": "MIT",
"type": "module",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/internals/src/lib/fs/fs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ describe('fs', () => {
})

it('should get package path with / and in root', async () => {
const path = getRelativePackagePath('@theguild/eslint-config')
expect(path).toMatchInlineSnapshot(`"../../node_modules/@theguild/eslint-config"`)
const path = getRelativePackagePath('@theguild/prettier-config')
expect(path).toMatchInlineSnapshot(`"../../node_modules/@theguild/prettier-config"`)
})

it('should get null as the package doesn t exist', async () => {
Expand Down
10 changes: 10 additions & 0 deletions packages/vite-plugin-kit-routes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# vite-plugin-kit-routes

## 0.6.11-next.0

### Patch Changes

- Updated dependencies
[[`1bd5ea8`](https://github.com/jycouet/kitql/commit/1bd5ea8c5dc08f995b16d015d23dd577a14a7cf6)]:
- @kitql/internals@0.9.10-next.0
- @kitql/helpers@0.8.10
- [email protected]

## 0.6.10

### Patch Changes
Expand Down
4 changes: 4 additions & 0 deletions packages/vite-plugin-kit-routes/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import kitql from '@kitql/eslint-config'
export default [
...kitql,
{
name: 'custom rules',
rules: {
'@typescript-eslint/no-unsafe-function-type': 'off',
'no-unused-disable': 'off',
},
},
{
ignores: ['src/test/'],
},
]
2 changes: 1 addition & 1 deletion packages/vite-plugin-kit-routes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": [
"vite"
],
"version": "0.6.10",
"version": "0.6.11-next.0",
"license": "MIT",
"type": "module",
"repository": {
Expand Down
1 change: 0 additions & 1 deletion packages/vite-plugin-kit-routes/src/lib/ROUTES.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
/**
* This file was generated by 'vite-plugin-kit-routes'
*
Expand Down
12 changes: 8 additions & 4 deletions packages/vite-plugin-kit-routes/src/lib/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,10 +817,14 @@ export const run = async (atStart: boolean, o?: Options) => {
// TODO check if harcoded links are around?
// for (let i = 0; i < files.length; i++) {
// if (files[i].endsWith('.svelte')) {
// const found = extractHtmlElementAttr_Text(options.routes_path + '/' + files[i], [
// { type: 'a', attr: 'href' },
// ])
// console.log(`found`, found, files[i])
// const pathToCheck = (options.routes_path ?? '/src/routes') + '/' + files[i]

// try {
// const found = extractHtmlElementAttr_Text(pathToCheck, [{ type: 'a', attr: 'href' }])
// } catch (error) {
// console.log(`error`, error)
// }
// // console.log(`found`, found, files[i])

// // log.info(
// // `⚠️ Warning ${yellow(`action="?/save"`)} detected ` +
Expand Down
10 changes: 10 additions & 0 deletions packages/vite-plugin-stripper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# vite-plugin-stripper

## 0.5.5-next.0

### Patch Changes

- Updated dependencies
[[`1bd5ea8`](https://github.com/jycouet/kitql/commit/1bd5ea8c5dc08f995b16d015d23dd577a14a7cf6)]:
- @kitql/internals@0.9.10-next.0
- @kitql/helpers@0.8.10
- [email protected]

## 0.5.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-stripper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": [
"vite"
],
"version": "0.5.4",
"version": "0.5.5-next.0",
"license": "MIT",
"type": "module",
"repository": {
Expand Down

0 comments on commit a354e28

Please sign in to comment.