Skip to content

Update dependencies #131

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

Merged
merged 8 commits into from
Jan 9, 2025
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
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
},
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": []
},
"ghcr.io/devcontainers/features/git:1": {}
},
"remoteEnv": {
"PATH": "${containerEnv:PATH}:./node_modules/.bin"
}
}
68 changes: 0 additions & 68 deletions .eslintrc.js

This file was deleted.

23 changes: 14 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ on:
- develop
- release-*

env:
HUSKY: 0

jobs:
build:
runs-on: ubuntu-latest
environment: upload

permissions:
id-token: write # Required by Akeyless
contents: read
id-token: write
contents: write
issues: write
packages: read
pull-requests: write

steps:
- name: Import Secrets
Expand All @@ -28,23 +33,23 @@ jobs:
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
static-secrets: |
{
"/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN",
"/WebComponents/prod/tokens/PROGRESS_NPM_REGISTRY_TOKEN": "NPM_TOKEN"
"${{ secrets.GH_AKEYLESS_GH_TOKEN_PATH }}": "GH_TOKEN",
"${{ secrets.GH_AKEYLESS_NPM_TOKEN_PATH }}": "NPM_TOKEN"
}
export-secrets-to-environment: false

- name: Check out branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all branches

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '20'

- name: Install modules
run: npm install --no-audit
run: npm ci --no-audit

- name: Build package
run: npm run build-package
Expand All @@ -53,7 +58,7 @@ jobs:
run: npm run test

- name: Publish release
run: npx ci-semantic-release
run: npx semantic-release
env:
NPM_TOKEN: ${{ steps.import-secrets.outputs.NPM_TOKEN }}
GH_TOKEN: ${{ steps.import-secrets.outputs.GH_TOKEN }}
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- develop
- release-*

env:
HUSKY: 0

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -18,15 +21,15 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '20'

- name: Install modules
run: npm install --no-audit
run: npm ci --no-audit

- name: Lint
run: npm run lint
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,18 @@ jobs:
uses: LanceMcCarthy/akeyless-action@v3
with:
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
static-secrets: '{ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN" }'
static-secrets: '{ "${{ secrets.GH_AKEYLESS_GH_TOKEN_PATH }}": "GH_TOKEN" }'
export-secrets-to-environment: false

- name: Check out master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0 # Fetch all branches
token: ${{ steps.import-secrets.outputs.GH_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install modules
run: npm install @progress/semantic-prerelease --no-save

- name: Fast-forward master to develop
run: npx release-master
run: |
# TODO: Remove after first sync with master
git checkout origin/develop -- ./tools/release-master
./tools/release-master
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Build Status](https://travis-ci.org/telerik/kendo-intl.svg?branch=master)](https://travis-ci.org/telerik/kendo-intl)
[![npm version](https://badge.fury.io/js/%40progress%2Fkendo-intl.svg)](https://badge.fury.io/js/%40telerik%2Fkendo-intl)


Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: [ "@commitlint/config-conventional" ]
};
76 changes: 76 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import importPlugin from 'eslint-plugin-import';
import jestPlugin from 'eslint-plugin-jest';

/** @type {import('eslint').Linter.Config[]} */
export default [
importPlugin.flatConfigs.recommended,
{
files: ["*/*.js"],
languageOptions: {
ecmaVersion: 2020,
sourceType: "module"
},
plugins: {
jest: jestPlugin
},
rules: {
'import/no-deprecated': [
'warn'
],
'brace-style': [
'warn',
'1tbs',
{
'allowSingleLine': true
}
],
'capitalized-comments': [
'off',
'never'
],
'comma-dangle': 'error',
'default-case': 'error',
'dot-notation': 'off',
'id-denylist': [
'error',
'String',
'string',
'Boolean',
'boolean',
'Undefined',
'undefined'
],

'indent': [
'warn',
4
],
'no-empty': 'error',
'no-empty-function': 'off',
'no-redeclare': 'error',
'no-shadow': 'off',
'no-unused-expressions': 'warn',
'no-use-before-define': 'off',
'semi': 'error',

// Jest rules
"jest/no-disabled-tests": "off",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "warn",
"jest/prefer-spy-on": "warn",
"jest/prefer-to-be": "warn",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error"
}
},
{
ignores: ["dist/", "docs/"]
},
{
settings: {
"import/ignore": [
"vitest"
],
},
}
];
5 changes: 0 additions & 5 deletions jest.config.json

This file was deleted.

12 changes: 8 additions & 4 deletions locale-tests/all.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { afterAll, beforeAll, describe, it, expect, vi } from 'vitest';

import { formatNumber, parseNumber, formatDate, parseDate, firstDay, weekendRange, setData } from '../src/main';
import { LOCALES, NO_CURRENCY_LOCALE, clean } from './utils';

Expand All @@ -6,10 +8,12 @@ describe('generated-locales', () => {
const number = 5.55;
const numberString = '5.55';

describe.each(LOCALES)('%s (all)', (locale) => {
beforeAll(() => {
const all = require(`./locales/${ locale }/all`).default;
setData(all);
describe.each(LOCALES)('%s (all)', async(locale) => {
beforeAll(async () => {
const all = await import(`./locales/${ locale }/all.js`);
await vi.dynamicImportSettled();

setData(all.default);
});

afterAll(() => {
Expand Down
12 changes: 8 additions & 4 deletions locale-tests/calendar.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { afterAll, beforeAll, describe, it, expect, vi } from 'vitest';

import { formatDate, parseDate, firstDay, weekendRange, setData } from '../src/main';
import { LOCALES, clean } from './utils';

describe('generated-locales', () => {
const date = new Date(2000, 0, 1);

describe.each(LOCALES)('%s (calendar)', (locale) => {
beforeAll(() => {
const calendar = require(`./locales/${ locale }/calendar`).default;
setData(calendar);
describe.each(LOCALES)('%s (calendar)', async(locale) => {
beforeAll(async () => {
const calendar = await import(`./locales/${ locale }/calendar.js`);
await vi.dynamicImportSettled();

setData(calendar.default);
});

afterAll(() => {
Expand Down
15 changes: 8 additions & 7 deletions locale-tests/currency.test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { afterAll, beforeAll, describe, it, expect, vi } from 'vitest';
import { formatNumber, parseNumber, setData } from '../src/main';
import { LOCALES, clean, NO_CURRENCY_LOCALE } from './utils';

const number = 5.55;
const numberString = '5.55';
const currencyLocales = LOCALES.filter(locale => locale !== NO_CURRENCY_LOCALE);

describe.each(currencyLocales)('%s currency', (locale) => {
beforeAll(() => {
const numbers = require(`./locales/${ locale }/numbers`).default;
const currencies = require(`./locales/${ locale }/currencies`).default;

setData(numbers);
setData(currencies);
describe.each(currencyLocales)('%s currency', async(locale) => {
beforeAll(async() => {
const numbers = await import(`./locales/${ locale }/numbers.js`);
const currencies = await import(`./locales/${ locale }/currencies.js`);
await vi.dynamicImportSettled();

setData(numbers.default);
setData(currencies.default);
});

afterAll(() => {
Expand Down
Loading
Loading