Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: new bundle #566

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit staged
yarn commit staged
6 changes: 6 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Checks

on:
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
- edited
paths-ignore:
- '.github/**'

Expand Down
4,623 changes: 1,367 additions & 3,256 deletions .pnp.cjs

Large diffs are not rendered by default.

86 changes: 53 additions & 33 deletions .pnp.loader.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,629 changes: 1,306 additions & 1,323 deletions .yarn/releases/yarn-remote.cjs
100644 → 100755

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions generators/button/src/generator.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { transform } from '@babel/standalone'

import assert from 'assert'
import { Command } from 'commander'
import { readFileSync } from 'fs'
import { join } from 'path'
import assert from 'assert'

import { ButtonAppearanceStyleGenerator } from './style-generators/index.js'

Expand All @@ -15,17 +14,17 @@
assert.ok(options.theme, 'Theme colors path is required')

const colorsFile = readFileSync(join(process.cwd(), options.theme)).toString('utf-8')
const { code } = transform(colorsFile, { presets: ['env'] })

Check failure on line 17 in generators/button/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.

Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
  14 |     assert.ok(options.theme, 'Theme colors path is required')
  15 |
> 16 |     const colorsFile = readFileSync(join(process.cwd(), options.theme)).toString('utf-8')
     |                                                         ^
  17 |     const { code } = transform(colorsFile, { presets: ['env'] })
  18 |
  19 |     if (!code) throw Error('Could not read the file')

if (!code) throw Error('Could not read the file')

// eslint-disable-next-line no-eval
const colors = eval(code)

Check warning on line 23 in generators/button/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(security/detect-eval-with-expression): eval with argument of type Identifier

eval with argument of type Identifier
Raw output
  20 |
  21 |     // eslint-disable-next-line no-eval
> 22 |     const colors = eval(code)
     |                    ^
  23 |
  24 |     const generator = new ButtonAppearanceStyleGenerator(colors)
  25 |
const generator = new ButtonAppearanceStyleGenerator(colors)

Check failure on line 25 in generators/button/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `ButtonColorSchemes`.

Unsafe argument of type `any` assigned to a parameter of type `ButtonColorSchemes`.
Raw output
  22 |     const colors = eval(code)
  23 |
> 24 |     const generator = new ButtonAppearanceStyleGenerator(colors)
     |                                                          ^
  25 |
  26 |     const genPath = join(process.cwd(), path)
  27 |     generator.generateFile(genPath)
const genPath = join(process.cwd(), path)
generator.generateFile(genPath)

Check failure on line 27 in generators/button/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.

Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
  24 |     const generator = new ButtonAppearanceStyleGenerator(colors)
  25 |
> 26 |     const genPath = join(process.cwd(), path)
     |                                         ^
  27 |     generator.generateFile(genPath)
  28 |
  29 |     // eslint-disable-next-line no-console

// eslint-disable-next-line no-console
console.log(`Generated into ${genPath}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class ButtonAppearanceStyleGenerator {
return { statefulStyles, appearanceStyles, imports }
}

generateFile(path, filename = 'appearance.css.ts') {
generateFile(path: string, filename = 'appearance.css.ts') {
const generated = this.generateAppearanceStyles()

const code = pretty(`
Expand Down
3 changes: 1 addition & 2 deletions generators/icons/src/generator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { transform } from '@babel/standalone'

import assert from 'assert'
import { Command } from 'commander'
import { readFileSync } from 'fs'
import { lstatSync } from 'fs'
import { existsSync } from 'fs'
import { mkdirSync } from 'fs'
import { join } from 'path'
import assert from 'assert'

import { build } from './svgr'

Expand All @@ -19,8 +18,8 @@
assert.ok(options.icons, 'Icons dir path is required')

const iconsPath = join(process.cwd(), options.icons)
const genPath = join(process.cwd(), path)

Check failure on line 21 in generators/icons/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.

Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
  18 |     assert.ok(options.icons, 'Icons dir path is required')
  19 |
> 20 |     const iconsPath = join(process.cwd(), options.icons)
     |                                           ^
  21 |     const genPath = join(process.cwd(), path)
  22 |
  23 |     if (!existsSync(genPath)) {

Check failure on line 22 in generators/icons/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.

Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
  19 |
  20 |     const iconsPath = join(process.cwd(), options.icons)
> 21 |     const genPath = join(process.cwd(), path)
     |                                         ^
  22 |
  23 |     if (!existsSync(genPath)) {
  24 |       mkdirSync(genPath)
if (!existsSync(genPath)) {
mkdirSync(genPath)
}
Expand All @@ -32,7 +31,7 @@

if (options.replacements) {
const replacementsFile = readFileSync(join(process.cwd(), options.replacements)).toString(
'utf-8'

Check failure on line 34 in generators/icons/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.

Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
  31 |
  32 |     if (options.replacements) {
> 33 |       const replacementsFile = readFileSync(join(process.cwd(), options.replacements)).toString(
     |                                                                 ^
  34 |         'utf-8'
  35 |       )
  36 |       const { code } = transform(replacementsFile, { presets: ['env'] })
)
const { code } = transform(replacementsFile, { presets: ['env'] })

Expand All @@ -40,7 +39,7 @@

// eslint-disable-next-line no-eval
replacements = eval(code)
}

Check warning on line 42 in generators/icons/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(security/detect-eval-with-expression): eval with argument of type Identifier

eval with argument of type Identifier
Raw output
  39 |
  40 |       // eslint-disable-next-line no-eval
> 41 |       replacements = eval(code)
     |                      ^
  42 |     }
  43 |
  44 |     await build(iconsPath, genPath, replacements)

await build(iconsPath, genPath, replacements)

Expand Down
14 changes: 7 additions & 7 deletions generators/icons/src/svgr.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import * as prettierPlugin from '@atls/prettier-plugin'

import prettierConfig from '@atls/config-prettier'
// @ts-expect-error missing declaration
import svgr from '@svgr/core'

import { format } from 'prettier/standalone'
import camelcase from 'camelcase'
import fs from 'fs-extra-promise'
import glob from 'glob-promise'
import path from 'path'
import parserBabel from 'prettier/parser-babel'
import parserTypescript from 'prettier/parser-typescript'
import { format } from 'prettier/standalone'

// @ts-expect-error types
const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })

Check failure on line 15 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  12 |
  13 | // @ts-expect-error types
> 14 | const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
     |                      ^
  15 |   const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
  16 |
  17 |   return typeScriptTpl.ast`

Check failure on line 16 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of an `any` typed value.

Unsafe call of an `any` typed value.
Raw output
  13 | // @ts-expect-error types
  14 | const svgrTemplate = ({ template }, opts, { componentName, jsx }) => {
> 15 |   const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
     |                         ^
  16 |
  17 |   return typeScriptTpl.ast`
  18 |  import React from 'react'
return typeScriptTpl.ast`
import React from 'react'

Check failure on line 18 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-return): Unsafe return of an `any` typed value.

Unsafe return of an `any` typed value.
Raw output
  15 |   const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
  16 |
> 17 |   return typeScriptTpl.ast`
     |   ^
  18 |  import React from 'react'
  19 |  import { vars } from '@ui/theme'
  20 |  import { IconProps } from '../icons.interfaces'

Check failure on line 18 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe any typed template tag.

Unsafe any typed template tag.
Raw output
  15 |   const typeScriptTpl = template.smart({ plugins: ['typescript', 'prettier'] })
  16 |
> 17 |   return typeScriptTpl.ast`
     |          ^
  18 |  import React from 'react'
  19 |  import { vars } from '@ui/theme'
  20 |  import { IconProps } from '../icons.interfaces'
import { vars } from '@ui/theme'
import { IconProps } from '../icons.interfaces'

Expand All @@ -25,8 +25,8 @@
`
}

const read = (files) =>
const read = (files: Array<string>) =>
Promise.all(

Check failure on line 29 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  26 | }
  27 |
> 28 | const read = (files: Array<string>) =>
     |              ^
  29 |   Promise.all(
  30 |     files.map(async (iconPath) => ({
  31 |       name: `${camelcase(path.basename(iconPath, path.extname(iconPath)), {

Check failure on line 29 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/promise-function-async): Functions that return promises must be async.

Functions that return promises must be async.
Raw output
  26 | }
  27 |
> 28 | const read = (files: Array<string>) =>
     |              ^
  29 |   Promise.all(
  30 |     files.map(async (iconPath) => ({
  31 |       name: `${camelcase(path.basename(iconPath, path.extname(iconPath)), {
files.map(async (iconPath) => ({
name: `${camelcase(path.basename(iconPath, path.extname(iconPath)), {
pascalCase: true,
Expand All @@ -35,12 +35,12 @@
}))
)

const compile = (icons, replacements) =>
const compile = (icons: Array<{ name: string, source: string }>, replacements: Record<string, any>) =>
Promise.all(

Check failure on line 39 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  36 |   )
  37 |
> 38 | const compile = (icons: Array<{ name: string, source: string }>, replacements: Record<string, any>) =>
     |                 ^
  39 |   Promise.all(
  40 |     icons.map(async (icon) => ({
  41 |       name: icon.name,

Check failure on line 39 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/promise-function-async): Functions that return promises must be async.

Functions that return promises must be async.
Raw output
  36 |   )
  37 |
> 38 | const compile = (icons: Array<{ name: string, source: string }>, replacements: Record<string, any>) =>
     |                 ^
  39 |   Promise.all(
  40 |     icons.map(async (icon) => ({
  41 |       name: icon.name,
icons.map(async (icon) => ({
name: icon.name,
code: await svgr(
icon.source.replace(/mask0/g, icon.name),

Check failure on line 43 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of an `any` typed value.

Unsafe call of an `any` typed value.
Raw output
  40 |     icons.map(async (icon) => ({
  41 |       name: icon.name,
> 42 |       code: await svgr(
     |                   ^
  43 |         icon.source.replace(/mask0/g, icon.name),
  44 |         {
  45 |           icon: true,
{
icon: true,
template: svgrTemplate,
Expand All @@ -51,29 +51,29 @@
}))
)

const save = async (sources, targetDir) =>
const save = async (sources: Array<{ name: string }>, targetDir: string) =>
Promise.all(

Check failure on line 55 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  52 |   )
  53 |
> 54 | const save = async (sources: Array<{ name: string }>, targetDir: string) =>
     |              ^
  55 |   Promise.all(
  56 |     sources.map((source) =>
  57 |       fs.writeFileAsync(
sources.map((source) =>
fs.writeFileAsync(
path.join(targetDir, `${source.name}.tsx`),
// @ts-ignore
format(`/* eslint-disable */\n${source.code}`, {

Check failure on line 60 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/prefer-ts-expect-error): Use "@ts-expect-error" to ensure an error is actually being suppressed.

Use "@ts-expect-error" to ensure an error is actually being suppressed.
Raw output
  57 |       fs.writeFileAsync(
  58 |         path.join(targetDir, `${source.name}.tsx`),
> 59 |         // @ts-ignore
     |         ^
  60 |         format(`/* eslint-disable */\n${source.code}`, {
  61 |           ...prettierConfig,
  62 |           filepath: path.join(targetDir, `${source.name}.tsx`),
...prettierConfig,

Check failure on line 61 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/restrict-template-expressions): Invalid type "any" of template literal expression.

Invalid type "any" of template literal expression.
Raw output
  58 |         path.join(targetDir, `${source.name}.tsx`),
  59 |         // @ts-ignore
> 60 |         format(`/* eslint-disable */\n${source.code}`, {
     |                                         ^
  61 |           ...prettierConfig,
  62 |           filepath: path.join(targetDir, `${source.name}.tsx`),
  63 |           plugins: [parserTypescript, parserBabel, prettierPlugin],
filepath: path.join(targetDir, `${source.name}.tsx`),
plugins: [parserTypescript, parserBabel, prettierPlugin],
})
))
)

const createIndex = (sources, targetDir) =>
const createIndex = (sources: Array<{ name: string }>, targetDir: string) =>
fs.writeFileAsync(

Check failure on line 69 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  66 |   )
  67 |
> 68 | const createIndex = (sources: Array<{ name: string }>, targetDir: string) =>
     |                     ^
  69 |   fs.writeFileAsync(
  70 |     path.join(targetDir, 'index.ts'),
  71 |     `${sources.map((source) => `export * from './${source.name}'`).join('\n')}\n`
path.join(targetDir, 'index.ts'),
`${sources.map((source) => `export * from './${source.name}'`).join('\n')}\n`
)

export const build = async (iconsPath: string, targetDir: string, replacements: object) => {
const prettifyIconsPath = () => {

Check failure on line 75 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-module-boundary-types): Missing return type on function.

Missing return type on function.
Raw output
  72 |   )
  73 |
> 74 | export const build = async (iconsPath: string, targetDir: string, replacements: object) => {
     |                      ^
  75 |   const prettifyIconsPath = () => {
  76 |     const parts = iconsPath.split('')
  77 |     if (parts[parts.length - 1] === '/') {

Check failure on line 75 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  72 |   )
  73 |
> 74 | export const build = async (iconsPath: string, targetDir: string, replacements: object) => {
     |                      ^
  75 |   const prettifyIconsPath = () => {
  76 |     const parts = iconsPath.split('')
  77 |     if (parts[parts.length - 1] === '/') {
const parts = iconsPath.split('')

Check failure on line 76 in generators/icons/src/svgr.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
  73 |
  74 | export const build = async (iconsPath: string, targetDir: string, replacements: object) => {
> 75 |   const prettifyIconsPath = () => {
     |                             ^
  76 |     const parts = iconsPath.split('')
  77 |     if (parts[parts.length - 1] === '/') {
  78 |       parts.pop()
if (parts[parts.length - 1] === '/') {
parts.pop()
return parts.join('')
Expand Down
3 changes: 1 addition & 2 deletions generators/input/src/generator.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { transform } from '@babel/standalone'

import assert from 'assert'
import { Command } from 'commander'
import { readFileSync } from 'fs'
import { join } from 'path'
import assert from 'assert'

import { InputAppearanceStyleGenerator } from './style-generators/index.js'

Expand All @@ -15,17 +14,17 @@
assert.ok(options.theme, 'Theme colors path is required')

const colorsFile = readFileSync(join(process.cwd(), options.theme)).toString('utf-8')
const { code } = transform(colorsFile, { presets: ['env'] })

Check failure on line 17 in generators/input/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.

Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
  14 |     assert.ok(options.theme, 'Theme colors path is required')
  15 |
> 16 |     const colorsFile = readFileSync(join(process.cwd(), options.theme)).toString('utf-8')
     |                                                         ^
  17 |     const { code } = transform(colorsFile, { presets: ['env'] })
  18 |
  19 |     if (!code) throw Error('Could not read the file')

if (!code) throw Error('Could not read the file')

// eslint-disable-next-line no-eval
const colors = eval(code)

Check warning on line 23 in generators/input/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(security/detect-eval-with-expression): eval with argument of type Identifier

eval with argument of type Identifier
Raw output
  20 |
  21 |     // eslint-disable-next-line no-eval
> 22 |     const colors = eval(code)
     |                    ^
  23 |
  24 |     const generator = new InputAppearanceStyleGenerator(colors)
  25 |
const generator = new InputAppearanceStyleGenerator(colors)

Check failure on line 25 in generators/input/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `InputColorSchemes`.

Unsafe argument of type `any` assigned to a parameter of type `InputColorSchemes`.
Raw output
  22 |     const colors = eval(code)
  23 |
> 24 |     const generator = new InputAppearanceStyleGenerator(colors)
     |                                                         ^
  25 |
  26 |     const genPath = join(process.cwd(), path)
  27 |     generator.generateFile(genPath)
const genPath = join(process.cwd(), path)
generator.generateFile(genPath)

Check failure on line 27 in generators/input/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-unsafe-argument): Unsafe argument of type `any` assigned to a parameter of type `string`.

Unsafe argument of type `any` assigned to a parameter of type `string`.
Raw output
  24 |     const generator = new InputAppearanceStyleGenerator(colors)
  25 |
> 26 |     const genPath = join(process.cwd(), path)
     |                                         ^
  27 |     generator.generateFile(genPath)
  28 |
  29 |     // eslint-disable-next-line no-console

// eslint-disable-next-line no-console
console.log(`Generated into ${genPath}`)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { writeFileSync } from 'fs'

import { pretty } from '@atls-ui-generators/utils'
import { getStylesName } from '@atls-ui-generators/utils'
import { pretty } from '@atls-ui-generators/utils'
import { getStylesName } from '@atls-ui-generators/utils'
import { writeFileSync } from 'fs'

import { InputColorSchemes } from '../input-generator.interfaces.js'

const getAppearanceStylesName = (variant, state) => getStylesName('appearance', variant, state)
const getAppearanceStylesName = (variant: string, state: string) => getStylesName('appearance', variant, state)

export class InputAppearanceStyleGenerator {
readonly requiredImports = [
Expand All @@ -21,9 +20,7 @@ export class InputAppearanceStyleGenerator {
[]
)

const uniqueVariants = [...new Set(allVariants)]

this.#variants = uniqueVariants
this.#variants = [...new Set(allVariants)]
}

private generateVariantStatefulStyles(variant: string) {
Expand Down Expand Up @@ -93,7 +90,7 @@ export class InputAppearanceStyleGenerator {
return { statefulStyles, appearanceStyles, imports }
}

generateFile(path, filename = 'appearance.css.ts') {
generateFile(path: string, filename = 'appearance.css.ts') {
const generated = this.generateAppearanceStyles()

const code = pretty(`
Expand Down
7 changes: 3 additions & 4 deletions generators/locales/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import { mergeLocales } from './merge-locales/index.js'
import { processDirectory } from './process-directory/index.js'

const allLocales = []
let outputFile = 'ru'
const argPaths: string[] = []
const allLocales: Array<string> = []
let outputFile: string = 'ru'
const argPaths: Array<string> = []

// @ts-ignore
process.argv.slice(2).forEach((arg) => {
if (!arg.startsWith('--out=')) {
argPaths.push(arg)
Expand All @@ -18,5 +17,5 @@
const paths = argPaths.length ? argPaths : defaultPaths

paths.forEach((path) => processDirectory(path, 'locales', allLocales, outputFile))

Check failure on line 20 in generators/locales/src/generator.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/no-confusing-void-expression): Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function.

Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function.
Raw output
  17 | const paths = argPaths.length ? argPaths : defaultPaths
  18 |
> 19 | paths.forEach((path) => processDirectory(path, 'locales', allLocales, outputFile))
     |                         ^
  20 |
  21 | mergeLocales(allLocales, `./locales/${outputFile}.json`)
  22 |
mergeLocales(allLocales, `./locales/${outputFile}.json`)
2 changes: 1 addition & 1 deletion generators/locales/src/locales-generator.constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const defaultPaths = ['../../fragments', '../../pages']
export const defaultPaths: Array<string> = ['../../fragments', '../../pages']
2 changes: 1 addition & 1 deletion generators/locales/src/unit/locales-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Locale processing script', () => {
it('should remove empty locale file', () => {
mergeLocales([''], outputPath)

const allLocales = []
const allLocales: Array<string> = []
const mergedContent = JSON.parse(readFileSync(outputPath, 'utf8'))
expect(mergedContent).toEqual({})
removeEmptyLocale(
Expand Down
6 changes: 2 additions & 4 deletions generators/utils/src/pretty.util.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import * as prettierPlugin from '@atls/prettier-plugin'

import prettierConfig from '@atls/config-prettier'

import { format } from 'prettier/standalone'
import parserBabel from 'prettier/parser-babel'
import parserTypescript from 'prettier/parser-typescript'
import { format } from 'prettier/standalone'

const pretty = (string) =>
const pretty = (string: string) =>
// @ts-ignore

Check failure on line 8 in generators/utils/src/pretty.util.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-function-return-type): Missing return type on function.

Missing return type on function.
Raw output
   5 | import parserTypescript    from 'prettier/parser-typescript'
   6 |
>  7 | const pretty = (string: string) =>
     |                ^
   8 |   // @ts-ignore
   9 |   format(string, {
  10 |     ...prettierConfig,

Check failure on line 8 in generators/utils/src/pretty.util.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/explicit-module-boundary-types): Missing return type on function.

Missing return type on function.
Raw output
   5 | import parserTypescript    from 'prettier/parser-typescript'
   6 |
>  7 | const pretty = (string: string) =>
     |                ^
   8 |   // @ts-ignore
   9 |   format(string, {
  10 |     ...prettierConfig,
format(string, {

Check failure on line 9 in generators/utils/src/pretty.util.ts

View workflow job for this annotation

GitHub Actions / Lint

(@typescript-eslint/prefer-ts-expect-error): Use "@ts-expect-error" to ensure an error is actually being suppressed.

Use "@ts-expect-error" to ensure an error is actually being suppressed.
Raw output
   6 |
   7 | const pretty = (string: string) =>
>  8 |   // @ts-ignore
     |   ^
   9 |   format(string, {
  10 |     ...prettierConfig,
  11 |     parser: 'babel',
...prettierConfig,
parser: 'babel',
plugins: [parserTypescript, parserBabel, prettierPlugin],
Expand Down
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,20 @@
"@vanilla-extract/integration@npm:^7.1.7": "patch:@vanilla-extract/integration@npm%3A7.1.7#~/.yarn/patches/@vanilla-extract-integration-npm-7.1.7-cf020c7449.patch"
},
"devDependencies": {
"@atls/code-service": "0.1.9",
"@atls/config-eslint": "0.0.12",
"@atls/config-jest": "0.0.17",
"@atls/schematics": "0.0.16",
"@jest/core": "29.7.0",
"@types/eslint": "8.56.2",
"@types/glob": "8.1.0",
"@atls/code-runtime": "1.1.0",
"@types/jest": "29.5.11",
"@types/node": "20.11.5",
"eslint": "8.57.0",
"jest-environment-jsdom": "29.7.0",
"typescript": "5.2.2"
"typescript": "5.4.2"
},
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.4.1",
"tools": {
"schematic": {
"collection": "@atls/schematics",
"schematic": "project",
"type": "libraries",
"migration": "1653826505519"
}
}
},
"typecheckSkipLibCheck": true
}
1 change: 1 addition & 0 deletions project.types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="@atls/code-runtime/types" />
Loading
Loading