Skip to content

Commit

Permalink
chore: rename and using yarn version berry
Browse files Browse the repository at this point in the history
- rename org kjojs to philip21
  • Loading branch information
devphilip21 committed Jun 10, 2024
1 parent c11469d commit 2e6e5a2
Show file tree
Hide file tree
Showing 50 changed files with 7,640 additions and 4,344 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
.LSOverride

# Package manager
yarn-error.log
node_modules
/.pnp
.pnp.js
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Temp sources in local runner
.rollup.cache
Expand Down
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# `@kjojs`
# `@philip21`

JS/TS monorepo for personal development, reference, and open source purposes.
Various modules useful for front-end development.

## Index

- [@kjojs/canvas-video](./packages/canvas-video/): snapshots of the canvas can be exported as video to fit the frame
- [@kjojs/eventbus](./packages/eventbus/): universal and light(1kb) event bus module
- [@kjojs/idom](./packages/idom/): provides a concise and intuitive dom manipulation API
- [@kjojs/input](./packages/input/): The module recognizes mouse, pointer, and touch-based various input events and delivers refined input data
- [@kjojs/slider](./packages/slider/): slider module (like `swiper.js`)
- [@philip21/canvas-video](./packages/canvas-video/): snapshots of the canvas can be exported as video to fit the frame
- [@philip21/eventbus](./packages/eventbus/): universal and light(1kb) event bus module
- [@philip21/idom](./packages/idom/): provides a concise and intuitive dom manipulation API
- [@philip21/input](./packages/input/): The module recognizes mouse, pointer, and touch-based various input events and delivers refined input data
- [@philip21/slider](./packages/slider/): slider module (like `swiper.js`)
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@rollup/plugin-typescript": "^11.1.6",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"eslint": "^8.48.0",
Expand All @@ -19,5 +20,6 @@
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"typescript": "^5.2.2"
}
},
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions packages/canvas-video/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `@kjojs/canvas-video`
# `@philip21/canvas-video`

- snapshots of the canvas can be exported as video to fit the frame

Expand All @@ -7,7 +7,7 @@
## Getting Started

```js
import CanvasVideo from '@kjojs/canvas-video';
import CanvasVideo from '@philip21/canvas-video';

const TEN_MINUTES = 1000 * 60 * 10;
const canvasWidth = 300;
Expand Down
4 changes: 2 additions & 2 deletions packages/canvas-video/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[@kjojs/canvas-video] examples</title>
<title>[@philip21/canvas-video] examples</title>
<link rel="stylesheet" href="./index.css">
</head>
<body>
<h1>@kjojs/canvas-video</h1>
<h1>@philip21/canvas-video</h1>
<main class="main">
<section>
<h2>1. No Other Components</h2>
Expand Down
4 changes: 3 additions & 1 deletion packages/canvas-video/examples/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':3001/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
(function () {
'use strict';

Expand Down Expand Up @@ -114,7 +116,7 @@
return CanvasVideoCanvas;
}());

var r=function(){function r(){this._registry={};}return r.prototype.on=function(r,t,e){var i=this;switch(typeof r){case"string":if(!t)throw new Error("[@kjojs/hands] argument eventHandler required!");var n=r,s=t;this._registry[n]=this._registry[n]||[],this._registry[n].push({life:null!=e?e:-1,handler:s});break;case"object":if(!r)throw new Error("[@kjojs/hands] argument eventSpecification required!");var h=r;Object.entries(h).forEach((function(r){var t=r[0],e=r[1];i.on(t,e);}));}return this},r.prototype.once=function(r,t){var e=this;switch(typeof r){case"string":if(!t)throw new Error("[@kjojs/hands] argument eventHandler required!");var i=r,n=t;this.on(i,n,1);break;case"object":var s=r;Object.entries(s).forEach((function(r){var t=r[0],i=r[1];e.on(t,i,1);}));}return this},r.prototype.off=function(r,t){if(!r)return this._registry={},this;if("string"==typeof r){var e=r;if(t){if(this._registry[e]){var i=(this._registry[e]||[]).findIndex((function(r){return r.handler===t}));i>=0&&(1===this._registry[e].length?delete this._registry[e]:this._registry[e].splice(i,1));}}else delete this._registry[e];}return this},r.prototype.emit=function(r,t){for(var e=[],i=this._registry[r]||[],n=0;n<i.length;n++){var s=i[n];s.life>0&&s.life--,s.handler(t),0!==s.life&&e.push(s);}e.length>0?this._registry[r]=e:delete this._registry[r];},r.prototype.has=function(r,t){if(!r)return Object.keys(this._registry).length>0;var e=r,i=!!this._registry[e]&&this._registry[e].length>0;return t?!!i&&this._registry[e].findIndex((function(r){return r.handler===t}))>=0:i},r}();
var r=function(){function r(){this._registry={};}return r.prototype.on=function(r,t,e){var i=this;switch(typeof r){case"string":if(!t)throw new Error("[@philip21/hands] argument eventHandler required!");var n=r,s=t;this._registry[n]=this._registry[n]||[],this._registry[n].push({life:null!=e?e:-1,handler:s});break;case"object":if(!r)throw new Error("[@philip21/hands] argument eventSpecification required!");var h=r;Object.entries(h).forEach((function(r){var t=r[0],e=r[1];i.on(t,e);}));}return this},r.prototype.once=function(r,t){var e=this;switch(typeof r){case"string":if(!t)throw new Error("[@philip21/hands] argument eventHandler required!");var i=r,n=t;this.on(i,n,1);break;case"object":var s=r;Object.entries(s).forEach((function(r){var t=r[0],i=r[1];e.on(t,i,1);}));}return this},r.prototype.off=function(r,t){if(!r)return this._registry={},this;if("string"==typeof r){var e=r;if(t){if(this._registry[e]){var i=(this._registry[e]||[]).findIndex((function(r){return r.handler===t}));i>=0&&(1===this._registry[e].length?delete this._registry[e]:this._registry[e].splice(i,1));}}else delete this._registry[e];}return this},r.prototype.emit=function(r,t){for(var e=[],i=this._registry[r]||[],n=0;n<i.length;n++){var s=i[n];s.life>0&&s.life--,s.handler(t),0!==s.life&&e.push(s);}e.length>0?this._registry[r]=e:delete this._registry[r];},r.prototype.has=function(r,t){if(!r)return Object.keys(this._registry).length>0;var e=r,i=!!this._registry[e]&&this._registry[e].length>0;return t?!!i&&this._registry[e].findIndex((function(r){return r.handler===t}))>=0:i},r}();

var CanvasVideoPlayer = /** @class */ (function (_super) {
__extends(CanvasVideoPlayer, _super);
Expand Down
13 changes: 7 additions & 6 deletions packages/canvas-video/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "0.1.0",
"name": "@kjojs/canvas-video",
"name": "@philip21/canvas-video",
"private": true,
"description": "render video using canvas",
"main": "index.js",
Expand All @@ -18,13 +18,14 @@
},
"repository": {
"type": "git",
"url": "https://github.com/devphilip21/kjojs.git",
"url": "https://github.com/devphilip21/philip21.js.git",
"directory": "packages/canvas-video"
},
"dependencies": {
"@kjojs/eventbus": "^1.1.0"
},
"devDependencies": {
"@kjojs/config": "1.0.0"
"@philip21/config": "1.0.0",
"rollup": "^4.18.0"
},
"dependencies": {
"@philip21/eventbus": "1.1.5"
}
}
2 changes: 1 addition & 1 deletion packages/canvas-video/rollup.config.dev.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import defineConfig from '@kjojs/config/rollup/rollup.config.dev.mjs';
import defineConfig from '@philip21/config/rollup/rollup.config.dev.mjs';

export default defineConfig((cliArgs) => {
const cwd = process.cwd();
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-video/rollup.config.example.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import defineConfig from '@kjojs/config/rollup/rollup.config.example.mjs';
import defineConfig from '@philip21/config/rollup/rollup.config.example.mjs';

export default defineConfig((cliArgs) => {
const cwd = process.cwd();
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-video/rollup.config.prod.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import defineConfig from '@kjojs/config/rollup/rollup.config.prod.mjs';
import defineConfig from '@philip21/config/rollup/rollup.config.prod.mjs';

export default defineConfig(() => {
const cwd = process.cwd();
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-video/src/CanvasVideoPlayer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EventBus from '@kjojs/eventbus';
import EventBus from '@philip21/eventbus';
import { CanvasVideoVideoOption } from './models';

export class CanvasVideoPlayer extends EventBus<{
Expand Down
17 changes: 3 additions & 14 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
{
"name": "@philip21/config",
"version": "1.0.0",
"name": "@kjojs/config",
"private": true,
"description": "configuration for me",
"description": "configuration for monorepo",
"main": "index.js",
"types": "index.d.ts",
"type": "module",
"license": "MIT",
"author": {
"name": "devphilip21",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/devphilip21/kjojs.git",
"directory": "packages/config"
},
"dependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
Expand All @@ -28,6 +18,5 @@
"rollup-plugin-serve": "^1.1.1",
"rollup-plugin-typescript2": "^0.36.0",
"ts-jest": "^29.1.1"
},
"devDependencies": {}
}
}
6 changes: 3 additions & 3 deletions packages/eventbus/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `@kjojs/eventbus`
# `@philip21/eventbus`

- universal and light(1kb) event bus module
- no dependencies
Expand All @@ -9,13 +9,13 @@
## Installation

```sh
npm install @kjojs/eventbus --save
npm install @philip21/eventbus --save
```

## Getting Started

```ts
import EventBus from '@kjojs/eventbus';
import EventBus from '@philip21/eventbus';

const eventBus = new EventBus();

Expand Down
2 changes: 1 addition & 1 deletion packages/eventbus/examples/example_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@kjojs/eventbus Examples</title>
<title>@philip21/eventbus Examples</title>
</head>
<body>
<script src="./index.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion packages/eventbus/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import commonConfig from '@kjojs/config/jest/jest.config.mjs';
import commonConfig from '@philip21/config/jest/jest.config.mjs';

export default commonConfig;
12 changes: 6 additions & 6 deletions packages/eventbus/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@kjojs/eventbus",
"name": "@philip21/eventbus",
"version": "1.1.5",
"description": "universal and light(1kb) event bus module",
"main": "dist/index.esm.js",
Expand All @@ -18,21 +18,21 @@
},
"repository": {
"type": "git",
"url": "https://github.com/devphilip21/kjojs.git",
"url": "https://github.com/devphilip21/philip21.js.git",
"directory": "packages/eventbus"
},
"bugs": {
"url": "https://github.com/devphilip21/kjojs/issues"
"url": "https://github.com/devphilip21/philip21.js/issues"
},
"homepage": "https://github.com/devphilip21/kjojs/tree/main/packages/eventbus#readme",
"homepage": "https://github.com/devphilip21/philip21.js/tree/main/packages/eventbus#readme",
"scripts": {
"dev": "example=index rollup -w -c rollup.config.dev.mjs",
"build": "rollup -c rollup.config.prod.mjs",
"test": "jest --config jest.config.mjs",
"prepublish": "npm run test && npm run build"
},
"dependencies": {},
"devDependencies": {
"@kjojs/config": "1.0.0"
"@philip21/config": "1.0.0",
"rollup": "^4.18.0"
}
}
2 changes: 1 addition & 1 deletion packages/eventbus/rollup.config.dev.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import defineConfig from '@kjojs/config/rollup/rollup.config.dev.mjs';
import defineConfig from '@philip21/config/rollup/rollup.config.dev.mjs';

export default defineConfig((cliArgs) => {
const cwd = process.cwd();
Expand Down
2 changes: 1 addition & 1 deletion packages/eventbus/rollup.config.prod.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import defineConfig from '@kjojs/config/rollup/rollup.config.prod.mjs';
import defineConfig from '@philip21/config/rollup/rollup.config.prod.mjs';

export default defineConfig(() => {
const cwd = process.cwd();
Expand Down
6 changes: 3 additions & 3 deletions packages/eventbus/src/EventBus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class EventBus<D extends object = any> {
switch (typeof eventName) {
case 'string': {
if (!eventHandler) {
throw new Error('[@kjojs/hands] argument eventHandler required!');
throw new Error('[@philip21/hands] argument eventHandler required!');
}

const name = eventName as keyof D;
Expand All @@ -40,7 +40,7 @@ export class EventBus<D extends object = any> {
}
case 'object': {
if (!eventName) {
throw new Error('[@kjojs/hands] argument eventSpecification required!');
throw new Error('[@philip21/hands] argument eventSpecification required!');
}

const spec = eventName as EventSpecification<D>;
Expand All @@ -64,7 +64,7 @@ export class EventBus<D extends object = any> {
switch (typeof eventName) {
case 'string': {
if (!eventHandler) {
throw new Error('[@kjojs/hands] argument eventHandler required!');
throw new Error('[@philip21/hands] argument eventHandler required!');
}

const name = eventName as keyof D;
Expand Down
6 changes: 3 additions & 3 deletions packages/idom/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `@kjojs/idom`
# `@philip21/idom`

- provides a concise and intuitive dom manipulation API
- like jquery, but only partial features
Expand All @@ -8,13 +8,13 @@
## Installation

```sh
npm install @kjojs/idom --save
npm install @philip21/idom --save
```

## Getting Started

```js
import idom from '@kjojs/idom';
import idom from '@philip21/idom';

const popupDom = idom(document.getElementById('id')); // or idom('#id')

Expand Down
2 changes: 1 addition & 1 deletion packages/idom/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[@kjojs/idom] examples</title>
<title>[@philip21/idom] examples</title>
</head>
<body>
<div class="target">
Expand Down
13 changes: 7 additions & 6 deletions packages/idom/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@kjojs/idom",
"name": "@philip21/idom",
"version": "1.5.3",
"description": "provides a concise and intuitive dom manipulation API",
"main": "dist/index.esm.js",
Expand All @@ -18,22 +18,23 @@
},
"repository": {
"type": "git",
"url": "https://github.com/devphilip21/kjojs.git",
"url": "https://github.com/devphilip21/philip21.js.git",
"directory": "packages/idom"
},
"bugs": {
"url": "https://github.com/devphilip21/kjojs/issues"
"url": "https://github.com/devphilip21/philip21.js/issues"
},
"homepage": "https://github.com/devphilip21/kjojs/tree/main/packages/idom#readme",
"homepage": "https://github.com/devphilip21/philip21.js/tree/main/packages/idom#readme",
"scripts": {
"dev": "example=index rollup -w -c rollup.config.dev.mjs",
"build": "rollup -c rollup.config.prod.mjs && cp src/index.d.ts dist/index.d.ts",
"prepublish": "npm run build"
},
"dependencies": {
"@kjojs/eventbus": "1.1.5"
"@philip21/eventbus": "1.1.5"
},
"devDependencies": {
"@kjojs/config": "1.0.0"
"@philip21/config": "1.0.0",
"rollup": "^4.18.0"
}
}
2 changes: 1 addition & 1 deletion packages/idom/rollup.config.dev.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import defineConfig from '@kjojs/config/rollup/rollup.config.dev.mjs';
import defineConfig from '@philip21/config/rollup/rollup.config.dev.mjs';

export default defineConfig((cliArgs) => {
const cwd = process.cwd();
Expand Down
2 changes: 1 addition & 1 deletion packages/idom/rollup.config.prod.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import defineConfig from '@kjojs/config/rollup/rollup.config.prod.mjs';
import defineConfig from '@philip21/config/rollup/rollup.config.prod.mjs';

export default defineConfig(() => {
const cwd = process.cwd();
Expand Down
4 changes: 2 additions & 2 deletions packages/idom/src/IDom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EventBus from '@kjojs/eventbus';
import EventBus from '@philip21/eventbus';

/**
* @typedef {import('./index').IDom}
Expand Down Expand Up @@ -26,5 +26,5 @@ IDom.prototype._initElements = function (elements) {
}
}

throw new Error('[@kjojs/idom] invalid elements');
throw new Error('[@philip21/idom] invalid elements');
};
2 changes: 1 addition & 1 deletion packages/input/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `@kjojs/input`
# `@philip21/input`

The module recognizes mouse, pointer, and touch-based various input events and delivers refined input data.
It didn't try to have too many features, supports only the minimum necessary functions to enable free handling.
Expand Down
Loading

0 comments on commit 2e6e5a2

Please sign in to comment.