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

[Release] 2.12.0 #393

Merged
merged 35 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
708567c
Merge tag '2.11.1' into develop
jeremschelb Jul 13, 2023
574ffa8
Merge tag '2.11.2' into develop
jeremschelb Jul 13, 2023
65437bc
Update postcss to version 8.4.31
depfu[bot] Oct 3, 2023
c56acd0
Merge pull request #390 from studiometa/depfu/update/npm/postcss-8.4.31
titouanmathis Oct 4, 2023
3ef9641
Migrate from forEach to for…of loops
titouanmathis Nov 28, 2023
0222f70
Enable ESLint cache
titouanmathis Nov 28, 2023
06181b0
Remove `.filter()` calls from `for…of` loops
titouanmathis Nov 29, 2023
9a4ccb2
Remove unnecessary array
titouanmathis Nov 29, 2023
b9bcff3
Fix Map loops
titouanmathis Nov 29, 2023
1526508
Update Node from 18 to 20
titouanmathis Nov 29, 2023
b0fa8f4
Lint MD files
titouanmathis Nov 29, 2023
8178064
Update changelog
titouanmathis Dec 1, 2023
a12076e
Merge pull request #391 from studiometa/feature/migrate-to-for-of
titouanmathis Dec 1, 2023
d3e7aa9
Update tests dependencies
titouanmathis Dec 1, 2023
cfab493
Fix tests import paths
titouanmathis Dec 1, 2023
bd40de6
Fix types
titouanmathis Dec 1, 2023
536ed77
Update root dependencies
titouanmathis Dec 1, 2023
c3af0e2
Fix a semver constraint
titouanmathis Dec 1, 2023
30417a9
Update demo dependencies
titouanmathis Dec 1, 2023
b442611
Remove unused patch-package
titouanmathis Dec 1, 2023
c998226
Update docs dependencies
titouanmathis Dec 1, 2023
3a70444
Update docs incompatibilites
titouanmathis Dec 1, 2023
dcb4276
Update changelog
titouanmathis Dec 1, 2023
c335cec
Merge pull request #392 from studiometa/feature/dependency-update
titouanmathis Dec 1, 2023
7a6b841
Add `startsWith` and `endsWith` utility functions
titouanmathis Jul 31, 2023
ebee6c9
Use the more performant `startsWith` and `endsWith` functions
titouanmathis Jul 31, 2023
731eb2c
Update test import paths
titouanmathis Jul 31, 2023
2a259c4
Fix the `endsWith` function
titouanmathis Jul 31, 2023
3ebd400
Fix tests
titouanmathis Jul 31, 2023
0723619
Improve performance
titouanmathis Aug 1, 2023
76d1b2a
Lint files
titouanmathis Dec 1, 2023
04feea5
Update doc
titouanmathis Dec 1, 2023
af384e9
Update changelog
titouanmathis Dec 1, 2023
c7654a3
Merge pull request #389 from studiometa/feature/starts-ends-with-utils
titouanmathis Dec 1, 2023
70b63fc
Bump version number
titouanmathis Dec 1, 2023
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: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module.exports = {
'jsdoc/valid-types': 'off',
'jsdoc/check-types': 'off',
'jsdoc/tag-lines': ['warn', 'always', { count: 0, startLines: 1 }],
'unicorn/no-array-for-each': 'warn',
'no-restricted-syntax': 'off',
},
settings: {
'import/extensions': ['.js', '.mjs', '.jsx', '.ts', '.mts'],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org/

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
cache: npm
- name: Install modules
run: npm install
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
cache: npm
- name: Install modules
run: npm install
Expand All @@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
cache: npm
- name: Install modules
run: npm install
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_modules/
yarn.lock
.cache/
packages/**/package-lock.json
.eslintcache

# Log files
npm-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

## [v2.12.0](https://github.com/studiometa/js-toolkit/compare/2.11.2..2.12.0) (2023-12-01)

### Added

- Add `startsWith` and `endsWith` utils ([#389](https://github.com/studiometa/js-toolkit/pull/389))

### Changed

- Improve performance by migrating from `forEach` to `for…of` for loops ([#391](https://github.com/studiometa/js-toolkit/pull/391))
- Update NPM dependencies ([#392](https://github.com/studiometa/js-toolkit/pull/392))

## [v2.11.2](https://github.com/studiometa/js-toolkit/compare/2.11.1..2.11.2) (2023-07-13)

### Fixed
Expand Down
36,281 changes: 9,113 additions & 27,168 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/js-toolkit-workspace",
"version": "2.11.2",
"version": "2.12.0",
"private": true,
"workspaces": [
"packages/*"
Expand All @@ -13,8 +13,8 @@
"docs:build": "npm run build --workspace=@studiometa/js-toolkit-docs",
"test": "npm run test --workspace=@studiometa/js-toolkit-tests",
"lint": "npm run lint:eslint && npm run lint:types && npm run lint:docs",
"lint:eslint": "eslint packages/js-toolkit --ext=.js,.ts",
"lint:docs": "prettier --check 'packages/docs/**/*.{md,js,html,vue}'",
"lint:eslint": "eslint packages/js-toolkit --ext=.js,.ts --cache",
"lint:docs": "prettier --check 'packages/docs/**/*.{md,js,html,vue}' --cache",
"lint:types": "tsc --build tsconfig.lint.json",
"lint:md": "prettier --check '*.md'",
"fix": "npm run fix:docs && npm run fix:md",
Expand All @@ -24,28 +24,26 @@
"build:cp-files": "cp packages/js-toolkit/package.json dist/ && sed -i '' 's/index\\.ts/index\\.js/' dist/package.json && cat dist/package.json && cp LICENSE dist/ && cp README.md dist",
"build:types": "tsc --build tsconfig.build.json",
"build:pkg": "node scripts/build.js",
"build-for-export-size": "node scripts/add-utils-export.js && rm -rf dist && npm run build:pkg && npm run build:cp-files",
"postinstall": "patch-package"
"build-for-export-size": "node scripts/add-utils-export.js && rm -rf dist && npm run build:pkg && npm run build:cp-files"
},
"devDependencies": {
"@studiometa/eslint-config": "^3.1.3",
"@studiometa/prettier-config": "^2.1.1",
"@studiometa/prettier-config": "^3.0.0",
"@studiometa/stylelint-config": "^3.0.2",
"@types/estree": "^1.0.1",
"@types/jest": "^29.5.3",
"@types/node": "^18.16.19",
"@types/estree": "^1.0.5",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.44.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint": "^8.54.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-import-resolver-exports": "^1.0.0-beta.5",
"eslint-plugin-jest": "^27.2.2",
"patch-package": "^7.0.1",
"eslint-plugin-jest": "^27.6.0",
"prettier": "^2.8.8",
"typescript": "^4.9.5"
"typescript": "^5.3.2"
},
"dependencies": {
"esbuild": "^0.15.18",
"fast-glob": "^3.3.0"
"esbuild": "^0.19.8",
"fast-glob": "^3.3.2"
}
}
2 changes: 1 addition & 1 deletion packages/demo/meta.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolve, dirname } from 'node:path';
import { defineConfig } from '@studiometa/webpack-config';
import { prototyping } from '@studiometa/webpack-config/presets';
import { prototyping } from '@studiometa/webpack-config-preset-prototyping';

const { pathname } = new URL(import.meta.url);

Expand Down
15 changes: 8 additions & 7 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/js-toolkit-demo",
"version": "2.11.2",
"version": "2.12.0",
"private": true,
"type": "commonjs",
"scripts": {
Expand All @@ -12,13 +12,14 @@
"@studiometa/eslint-config": "^3.1.3",
"@studiometa/stylelint-config": "^3.0.2",
"@studiometa/tailwind-config": "^2.0.2",
"@studiometa/ui": "^0.2.33",
"@studiometa/webpack-config": "^4.2.6",
"eslint": "^8.44.0",
"postcss": "^8.4.25",
"@studiometa/ui": "^0.2.40",
"@studiometa/webpack-config": "^5.3.0",
"@studiometa/webpack-config-preset-prototyping": "^5.3.0",
"eslint": "^8.54.0",
"postcss": "^8.4.31",
"prettier": "^2.8.8",
"stylefire": "^7.0.3",
"stylelint": "^15.10.1",
"tailwindcss": "^3.3.2"
"stylelint": "^15.11.0",
"tailwindcss": "^3.3.5"
}
}
2 changes: 2 additions & 0 deletions packages/docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ function getUtilsSidebar() {
link: '/utils/string/',
collapsible: true,
items: [
{ text: 'startsWith', link: '/utils/string/startsWith.html' },
{ text: 'endsWith', link: '/utils/string/endsWith.html' },
{ text: 'withLeadingCharacters', link: '/utils/string/withLeadingCharacters.html' },
{ text: 'withLeadingSlash', link: '/utils/string/withLeadingSlash.html' },
{ text: 'withoutLeadingCharacters', link: '/utils/string/withoutLeadingCharacters.html' },
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/.vitepress/theme/components/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
border-radius: 0.25em;
padding: 0.5em 0.75em;
color: #fff;
background-color: var(--vp-c-brand);
background-color: var(--vp-button-brand-bg);
white-space: nowrap;
}

Expand Down
12 changes: 4 additions & 8 deletions packages/docs/.vitepress/theme/components/Loader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,25 @@
leave-to-class="opacity-0 transform scale-0"
leave-active-class="transition"
appear
mode="out-in"
>
mode="out-in">
<div class="absolute top-1/2 left-1/2 w-6 h-6 -mt-3 -ml-3">
<svg
class="animate-spin h-full w-full text-gray-500"
style="animation-duration: 0.2s"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
>
viewBox="0 0 24 24">
<circle
class="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
stroke-width="4"
></circle>
stroke-width="4"></circle>
<path
class="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
></path>
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<span class="sr-only">Loading...</span>
</div>
Expand Down
6 changes: 2 additions & 4 deletions packages/docs/.vitepress/theme/components/PreviewIframe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
<template>
<div
class="relative my-4 rounded bg-vp-sidebar-bg overflow-hidden"
style="height: 60vh; border: 1px solid var(--vp-c-divider)"
>
style="height: 60vh; border: 1px solid var(--vp-c-divider)">
<Loader v-if="isLoading" />
<iframe
ref="iframe"
Expand All @@ -63,7 +62,6 @@
height: calc(60vh * 1.5);
transform-origin: top left;
transform: scale(0.6666);
"
/>
" />
</div>
</template>
49 changes: 0 additions & 49 deletions packages/docs/.vitepress/theme/components/Tabs.vue

This file was deleted.

2 changes: 0 additions & 2 deletions packages/docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import DefaultTheme from 'vitepress/theme';
import Badge from './components/Badge.vue';
import Tabs from './components/Tabs.vue';
import PreviewIframe from './components/PreviewIframe.vue';
import './custom.scss';

export default {
...DefaultTheme,
enhanceApp({ app }) {
app.component('Badge', Badge);
app.component('Tabs', Tabs);
app.component('PreviewIframe', PreviewIframe);
},
};
4 changes: 2 additions & 2 deletions packages/docs/api/decorators/withRelativePointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class RelativePointer extends withRelativePointer(Base, {
}) {
static config = {
name: 'RelativePointer',
refs: ['item']
refs: ['item'],
};

movedrelative(props) {
Expand Down Expand Up @@ -46,7 +46,7 @@ The `movedrelative` class method will be triggered when moving the pointer.

### Move a ref element

This decorator can be used to easily use the pointer position relative from the component's root element. The following example will scale a ref based on the position of the pointer *inside* the component's root element.
This decorator can be used to easily use the pointer position relative from the component's root element. The following example will scale a ref based on the position of the pointer _inside_ the component's root element.

```js
import { Base, withRelativePointer } from '@studiometa/js-toolkit';
Expand Down
12 changes: 4 additions & 8 deletions packages/docs/api/decorators/withResponsiveOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export default class Component extends withResponsiveOptions(Base) {
data-component="Component"
data-option-label:xxs="Small Mobile"
data-option-label:xs:s="Large Mobile And Tablet"
data-option-label="Other devices"
>
data-option-label="Other devices">
...
</div>
```
Expand Down Expand Up @@ -94,8 +93,7 @@ export default class Component extends withResponsiveOptions(Base) {
<div
data-component="Component"
data-option-label:s="You are on a small screen"
data-option-label="I am the default label"
>
data-option-label="I am the default label">
...
</div>
```
Expand All @@ -117,8 +115,7 @@ With the same breakpoins and component as before, but with a different markup, w
data-component="Component"
data-option-label:s="You are on a small screen"
data-option-label:m="You are on a medium screen"
data-option-label:l="You are on a large screen"
>
data-option-label:l="You are on a large screen">
...
</div>
```
Expand All @@ -139,8 +136,7 @@ Breakpoints can be combined to use the same value multiple times:
<div
data-component="Component"
data-option-label:s:m="You are on a small or medium screen"
data-option-label:l="You are on a large screen"
>
data-option-label:l="You are on a large screen">
...
</div>
```
Expand Down
20 changes: 6 additions & 14 deletions packages/docs/guide/recipes/counter-component/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,13 @@ Find below the JavaScript and HTML implementation of a counter component.

<div class="my-4 p-10 rounded bg-vp-bg-alt text-center" v-html="CounterHtmlRaw"></div>

<Tabs :items="tabs">
<template #content-1>
::: code-group

<<< ./guide/recipes/counter-component/Counter.js
<<< ./Counter.js

</template>
<template #content-2>
<<< ./Counter.html

<<< ./guide/recipes/counter-component/Counter.html

</template>
<template #content-3>

```js
```js [app.js]
import { Base, createApp } from '@studiometa/js-toolkit';
import Counter from './Counter.js';

Expand All @@ -56,8 +49,7 @@ class App extends Base {
};
}

export default createApp(App, document.body);
export default createApp(App);
```

</template>
</Tabs>
:::
Loading