Skip to content
Draft
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
1 change: 0 additions & 1 deletion _templates/create-package/library/files/tsconfig.json.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ to: packages/<%=package%>/tsconfig.json
"compilerOptions": {
"module": "ESNext",
"outDir": "./dist/esm",
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true
Expand Down
5 changes: 1 addition & 4 deletions packages/css-in-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
"url": "https://rocket.chat/"
},
"main": "dist/index.js",
"unpkg": "dist/index.umd.js",
"module": "dist/index.module.js",
"source": "src/index.ts",
"types": "dist/index.d.ts",
"files": [
"/dist",
"/logicalProperties"
"/dist"
],
"scripts": {
"build": "rollup -c",
Expand Down
8 changes: 0 additions & 8 deletions packages/css-in-js/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ export default defineConfig({
format: 'es',
sourcemap: true,
},
{
dir: dirname(pkg.unpkg),
entryFileNames: basename(pkg.unpkg),
format: 'umd',
name: 'cssInJs',
sourcemap: true,
globals,
},
],
plugins: [
terser({
Expand Down
3 changes: 3 additions & 0 deletions packages/css-in-js/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist"
},
"exclude": ["src/**/*.spec.ts"]
}
5 changes: 0 additions & 5 deletions packages/css-in-js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"module": "ESNext",
"lib": ["dom", "es6"],
"declarationDir": "./dist",
"outDir": "./dist",
"moduleResolution": "node",
"noEmit": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src"],
Expand Down
3 changes: 1 addition & 2 deletions packages/css-supports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"/dist"
],
"scripts": {
"build": "tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json",
"clean": "rimraf dist",
"build": "rimraf dist && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json",
"docs": "typedoc",
"lint": "lint",
"lint-and-fix": "lint-and-fix"
Expand Down
6 changes: 5 additions & 1 deletion packages/css-supports/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "./tsconfig.json"
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"outDir": "./dist/esm"
}
}
7 changes: 2 additions & 5 deletions packages/css-supports/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"module": "ESNext",
"outDir": "./dist/esm",
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true
"types": [],
"lib": ["ES2024", "DOM"]
},
"include": ["src/**/*"],
"typedocOptions": {
Expand Down
7 changes: 0 additions & 7 deletions packages/emitter/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ export default defineConfig({
format: 'es',
sourcemap: true,
},
{
dir: dirname(pkg.unpkg),
entryFileNames: basename(pkg.unpkg),
format: 'umd',
name: 'Emitter',
sourcemap: true,
},
],
plugins: [
terser({
Expand Down
3 changes: 3 additions & 0 deletions packages/emitter/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist"
},
"exclude": ["src/**/*.spec.ts"]
}
6 changes: 0 additions & 6 deletions packages/emitter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"module": "ESNext",
"target": "ES5",
"lib": ["dom", "ES2015"],
"declarationDir": "./dist",
"outDir": "./dist",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true
},
Expand Down
2 changes: 0 additions & 2 deletions packages/fuselage-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"url": "https://rocket.chat/"
},
"main": "dist/index.js",
"unpkg": "dist/index.umd.js",
"module": "dist/index.module.js",
"source": "src/index.ts",
"types": "dist/index.d.ts",
"files": [
"/dist"
Expand Down
8 changes: 0 additions & 8 deletions packages/fuselage-hooks/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ export default defineConfig({
format: 'es',
sourcemap: true,
},
{
dir: dirname(pkg.unpkg),
entryFileNames: basename(pkg.unpkg),
format: 'umd',
name: 'FuselageHooks',
sourcemap: true,
globals,
},
],
plugins: [
terser({
Expand Down
3 changes: 2 additions & 1 deletion packages/fuselage-hooks/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": ["./src/**/*.spec.ts"]
}
5 changes: 0 additions & 5 deletions packages/fuselage-hooks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "ESNext",
"lib": ["DOM", "ES2015"],
"declarationDir": "./dist",
"outDir": "./dist",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true,
"jsx": "react-jsx"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage-toastbar/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"module": "commonjs",
"rootDir": "./src",
"outDir": "./dist/cjs"
},
Expand Down
1 change: 0 additions & 1 deletion packages/fuselage-toastbar/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"rootDir": "./src",
"outDir": "./dist/esm"
},
Expand Down
5 changes: 1 addition & 4 deletions packages/fuselage-toastbar/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDirs": ["./src", "./.storybook"],
"target": "ES5",
"module": "CommonJS",
"outDir": "./dist",
"esModuleInterop": true,
"module": "commonjs",
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
Expand Down
9 changes: 2 additions & 7 deletions packages/fuselage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@
"storybook": "storybook dev -p 6006 --no-version-updates",
"build": "run-s .:build:clean .:build:dev .:build:prod",
".:build:clean": "rimraf dist",
".:build:prod": "run-s .:build:prod:bundle .:build:prod:check",
".:build:dev": "run-s .:build:dev:bundle .:build:dev:check",
".:build:prod:bundle": "webpack --mode production",
".:build:prod:check": "es-check es5 dist/*.production.js",
".:build:dev:bundle": "webpack --mode development",
".:build:dev:check": "es-check es5 dist/*.development.js",
".:build:prod": "webpack --mode production",
".:build:dev": "webpack --mode development",
"lint": "lint",
"lint-and-fix": "lint-and-fix",
"test": "jest --runInBand",
Expand Down Expand Up @@ -79,7 +75,6 @@
"cross-env": "^7.0.3",
"css-loader": "~7.1.2",
"cssnano": "~7.1.0",
"es-check": "~9.1.4",
"eslint": "~9.29.0",
"jest": "~30.0.0",
"jest-axe": "~10.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/fuselage/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
"module": "commonjs",
"outDir": "./dist"
},
"include": ["./src"],
"exclude": [
Expand Down
8 changes: 1 addition & 7 deletions packages/fuselage/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDirs": ["./src", "./.storybook"],
"target": "ES5",
"module": "CommonJS",
"lib": ["ES2020", "DOM"],
"downlevelIteration": true,
"outDir": "./dist",
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"allowJs": true,
"allowJs": false,
"jsx": "react-jsx"
},
"include": [
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"module": "commonjs",
"rootDir": "./src",
"outDir": "./dist/cjs"
},
Expand Down
1 change: 0 additions & 1 deletion packages/layout/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"rootDir": "./src",
"outDir": "./dist/esm"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/layout/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDirs": ["./src", "./.storybook"],
"target": "ES5",
"module": "CommonJS",
"outDir": "./dist",
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/logo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"scripts": {
"build": "run-s .:build:clean .:build:esm .:build:cjs .:build:logo",
".:build:clean": "rimraf dist",
".:build:esm": "tsc -p tsconfig-esm.json",
".:build:cjs": "tsc -p tsconfig-cjs.json",
".:build:esm": "tsc -p tsconfig.esm.json",
".:build:cjs": "tsc -p tsconfig.cjs.json",
".:build:logo": "build-logo",
"lint": "lint",
"lint-and-fix": "lint-and-fix",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/esm"
},
"exclude": ["./**/*.spec.tsx"]
}
10 changes: 1 addition & 9 deletions packages/logo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"target": "es5",
"module": "ESNext",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist/esm",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"jsx": "react-jsx"
Expand Down
4 changes: 2 additions & 2 deletions packages/memo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"/dist"
],
"scripts": {
".:build:cjs": "tsc -p tsconfig-cjs.json",
".:build:esm": "tsc -p tsconfig-esm.json",
".:build:cjs": "tsc -p tsconfig.cjs.json",
".:build:esm": "tsc -p tsconfig.esm.json",
"build": "run .:build:esm && run .:build:cjs",
"clean": "rimraf dist",
"docs": "typedoc",
Expand Down
2 changes: 2 additions & 0 deletions packages/memo/src/memoize.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { it, jest, expect, describe } from '@jest/globals';

import { memoize, clear } from './memoize';

it('should memoize a function that takes no parameter', () => {
Expand Down
14 changes: 7 additions & 7 deletions packages/memo/src/memoize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Options {
}

const store = new WeakMap<
MemoizableFunction<unknown, unknown, unknown>,
MemoizableFunction<any, any, any>,
Map<unknown, unknown>
>();

Expand All @@ -18,7 +18,7 @@ const isCachedValue = <A, R>(

export const memoize = <T, A, R>(
fn: MemoizableFunction<T, A, R>,
_options?: Options,
options?: Options,
): MemoizedFunction<T, A, R> => {
const cache = new Map<A, R>();
const cacheTimers = new Map<A, ReturnType<typeof setTimeout>>();
Expand All @@ -37,8 +37,8 @@ export const memoize = <T, A, R>(
clearTimeout(oldTimer);
}

if (_options) {
const timer = setTimeout(cleanUp, _options.maxAge);
if (options) {
const timer = setTimeout(cleanUp, options.maxAge);
cacheTimers.set(arg, timer);
}

Expand All @@ -49,15 +49,15 @@ export const memoize = <T, A, R>(

cache.set(arg, result);

if (_options) {
const timer = setTimeout(cleanUp, _options.maxAge);
if (options) {
const timer = setTimeout(cleanUp, options.maxAge);
cacheTimers.set(arg, timer);
}

return result;
};

store.set(memoized as MemoizableFunction<unknown, unknown, unknown>, cache);
store.set(memoized, cache);

return memoized;
};
Expand Down
3 changes: 0 additions & 3 deletions packages/memo/tsconfig-esm.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"compilerOptions": {
"module": "commonjs",
"outDir": "./dist/cjs"
}
},
"exclude": ["src/**/*.spec.ts"]
}
Loading
Loading