Skip to content

Commit

Permalink
Merge pull request #1267 from grid-js/functional
Browse files Browse the repository at this point in the history
Grid.js v6 - Functional Components
  • Loading branch information
afshinm committed Jan 16, 2023
2 parents ddc61d4 + 95d8564 commit 51e0818
Show file tree
Hide file tree
Showing 85 changed files with 8,582 additions and 10,389 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["tsconfig.json", "*/tsconfig.release.json", "plugins/*/tsconfig.release.json", "tests/cypress/tsconfig.json"],
"project": ["tsconfig.json", "*/tsconfig.json", "plugins/*/tsconfig.json", "tests/cypress/tsconfig.json"],
"sourceType": "module"
},
"plugins": [
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Code Coverage

name: 'coverage'
on:
pull_request:
branches:
- master
- main

pull_request:
branches:
- master
- main
jobs:
coverage:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run install:plugins
- uses: artiomtr/jest-coverage-report-action@v1.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
test_script: npm run test:jest
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run install:plugins
- uses: ArtiomTr/jest-coverage-report-action@v2
id: coverage
with:
output: report-markdown
test-script: npm run test:jest
- uses: marocchino/sticky-pull-request-comment@v2
with:
message: ${{ steps.coverage.outputs.report }}
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
Expand Down
32 changes: 11 additions & 21 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
import Grid from './src/grid';

import { html } from './src/util/html';
import { h, createElement, Component, createRef } from 'preact';
import { useEffect, useRef } from 'preact/hooks';
import { UserConfig, Config } from './src/config';
import { BaseComponent, BaseProps } from './src/view/base';
import {
PluginPosition,
PluginBaseComponent,
PluginBaseProps,
} from './src/plugin';
import { BaseActions } from './src/view/base/actions';
import { useEffect, useRef, useState } from 'preact/hooks';
import { Config } from './src/config';
import { PluginPosition } from './src/plugin';
import { ID } from './src/util/id';
import { className } from './src/util/className';
import Row from './src/row';
import Cell from './src/cell';
import BaseStore from './src/view/base/store';
import Dispatcher from './src/util/dispatcher';
import { useConfig } from './src/hooks/useConfig';
import { useStore } from './src/hooks/useStore';
import useSelector from './src/hooks/useSelector';

export {
Grid,
ID,
Dispatcher,
Row,
Cell,
BaseActions,
BaseStore,
className,
html,
UserConfig,
Config,
BaseComponent,
BaseProps,
PluginPosition,
PluginBaseComponent,
PluginBaseProps,
h,
createElement,
Component,
createRef,
useEffect,
useRef
useRef,
useStore,
useConfig,
useState,
useSelector,
};
9 changes: 3 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ module.exports = {
testEnvironment: 'node',
setupFilesAfterEnv: ["jest-extended/all"],
roots: roots,
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': ['ts-jest', {
...require('./tsconfig.test.json')
}],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ['./tests/jest/setup.ts'],
Expand Down
41 changes: 20 additions & 21 deletions l10n/cs_CZ.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
export default {
search: {
placeholder: 'Napište klíčové slovo...',
},
sort: {
sortAsc: 'Seřadit sloupec vzestupně',
sortDesc: 'Seřadit sloupec sestupně',
},
pagination: {
firstPage: 'První stránka',
previous: 'Předchozí',
next: 'Další',
navigate: (page, pages) => `Stránka ${page} z ${pages}`,
page: (page) => `Stránka ${page}`,
showing: 'Zobrazeno',
of: 'z',
to: 'až',
results: 'výsledků',
},
loading: 'Načítám...',
noRecordsFound: 'Nebyly nalezeny žádné odpovídající záznamy',
error: 'Při načítání dat došlo k chybě',
search: {
placeholder: 'Napište klíčové slovo...',
},
sort: {
sortAsc: 'Seřadit sloupec vzestupně',
sortDesc: 'Seřadit sloupec sestupně',
},
pagination: {
previous: 'Předchozí',
next: 'Další',
navigate: (page, pages) => `Stránka ${page} z ${pages}`,
page: (page) => `Stránka ${page}`,
showing: 'Zobrazeno',
of: 'z',
to: 'až',
results: 'výsledků',
},
loading: 'Načítám...',
noRecordsFound: 'Nebyly nalezeny žádné odpovídající záznamy',
error: 'Při načítání dat došlo k chybě',
};
4 changes: 3 additions & 1 deletion l10n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ptBR from './pt_BR';
import faIR from './fa_IR';
import nbNO from './nb_NO';
import uaUA from './ua_UA';
import csCZ from './cs_CZ';

export {
esES,
Expand All @@ -31,5 +32,6 @@ export {
ptBR,
faIR,
nbNO,
uaUA
uaUA,
csCZ,
};
12 changes: 12 additions & 0 deletions l10n/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"removeComments": true
},
"include": [
"index.ts",
"src/**/*",
"tests/**/*"
]
}
8 changes: 4 additions & 4 deletions l10n/tsconfig.release.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"extends": "../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"removeComments": true
},
"include": [
"index.ts"
"index.ts",
"src/**/*"
],
"exclude": [
"tests/**/*",
"src/**/*"
"tests/**/*"
]
}
7 changes: 7 additions & 0 deletions l10n/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["jest"],
"esModuleInterop": true
}
}

0 comments on commit 51e0818

Please sign in to comment.