Skip to content

Commit

Permalink
release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PejmanNik committed Jul 2, 2023
1 parent 7f9a1c6 commit 8200ccb
Show file tree
Hide file tree
Showing 61 changed files with 491 additions and 359 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ plugins:
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.2.3.cjs

supportedArchitectures:
os:
- "current"
- linux
cpu:
- "current"
- x64
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.0]

### Changed

- Breaking change in the Table component

### Added

- Add sandbox project for testing

### Fixed

- Fix PageBreak component issue in none-host component

## [0.2.3]
### Changed
Expand Down
12 changes: 6 additions & 6 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jikji/website",
"version": "0.2.0",
"version": "0.3.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -14,13 +14,13 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "latest",
"@docusaurus/preset-classic": "latest",
"@mdx-js/react": "^2.2.1",
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-inlinesvg": "^3.0.1"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-query": "^3.39.3",
"recharts": "^2.3.2"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.3",
"version": "0.3.0",
"name": "jikji",
"workspaces": [
"packages/*",
Expand All @@ -11,7 +11,7 @@
"sandbox": "yarn workspace @jikji/sandbox start",
"generator": "yarn workspace @jikji/generator start",
"docs": "yarn workspace @jikji/website start --port 3001",
"build": "yarn build-react && yarn build-generator",
"build": "yarn run build-react & yarn run build-generator",
"build-react": "yarn workspace @jikji/react build",
"test-react": "yarn workspace @jikji/react test",
"build-docs": "yarn workspace @jikji/website build",
Expand All @@ -30,4 +30,4 @@
"@types/eslint": "^8.4.10",
"@types/prettier": "^2.7.2"
}
}
}
8 changes: 4 additions & 4 deletions packages/generator/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
clearMocks: true,
};
preset: "ts-jest",
testEnvironment: "jest-environment-node",
clearMocks: true,
};
2 changes: 1 addition & 1 deletion packages/generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jikji/generator",
"version": "0.2.3",
"version": "0.3.0",
"main": "lib/index.cjs.js",
"module": "lib/index.esm.js",
"files": [
Expand Down
21 changes: 17 additions & 4 deletions packages/generator/scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { build } from "esbuild";
import esbuild from "esbuild";
import { buildTsc } from "@jikji/shared/build-tsc.mjs";

const args = process.argv;
Expand All @@ -14,19 +14,32 @@ const shared = {
platform: "node",
};

const esm = build({
const esmCtx = await esbuild.context({
...shared,
format: "esm",
outfile: "./lib/index.esm.js",
target: ["es2020", "node18"],
watch: args.includes("--watch"),
});

const cjs = build({
let esm = esmCtx.rebuild();
if (args.includes("--watch")) {
esm = esm.then(() => esmCtx.watch());
}

const cjsCtx = await esbuild.context({
...shared,
format: "cjs",
outfile: "./lib/index.cjs.js",
target: ["es2020", "node18"],
});

const cjs = cjsCtx.rebuild();

await Promise.all([buildTsc(import.meta.url), esm, cjs]);

await esmCtx.dispose();
await cjsCtx.dispose();

console.log(
`\x1b[32mCompleted Generator build\x1b[0m`
);
10 changes: 8 additions & 2 deletions packages/generator/src/serve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { startServer } from "./serve";
import http, { Server } from "http";

jest.mock("http");
jest.mock("serve-handler");
jest.mock("http");
jest.mock("fs/promises", () => ({
readdir: jest.fn().mockResolvedValue([{
isDirectory: () => true,
name: "static",
}]),
}));

const mockedHttp = jest.mocked(http, { shallow: true });
const mockedListen = jest.fn();
Expand All @@ -20,6 +26,6 @@ test("start server with custom port", async () => {
const port = 3000;
const result = await startServer(dir, port);

expect(result.getHost()).toBe("http://localhost:3000");
expect(result.getHost()).toBe("http://localhost:3000");
expect(mockedListen).toHaveBeenCalledWith(port);
});
8 changes: 3 additions & 5 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jikji/react",
"version": "0.2.3",
"version": "0.3.0",
"main": "lib/index.cjs.js",
"module": "lib/index.esm.js",
"files": [
Expand All @@ -24,6 +24,7 @@
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@hyrious/esbuild-plugin-style": "^0.3.5",
"@jikji/shared": "workspace:^",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
Expand All @@ -36,7 +37,7 @@
"@types/react-reconciler": "^0.28.2",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"esbuild": "^0.17.5",
"esbuild": "0.18.11",
"eslint": "^8.33.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
Expand All @@ -50,8 +51,5 @@
"recoil": "^0.7.6",
"tslib": "^2.5.0",
"typescript": "^4.9.4"
},
"dependencies": {
"@hyrious/esbuild-plugin-style": "^0.3.5"
}
}
15 changes: 12 additions & 3 deletions packages/react/scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {build} from 'esbuild';
import esbuild from 'esbuild';
import {buildTsc} from '@jikji/shared/build-tsc.mjs';
import {style} from '@hyrious/esbuild-plugin-style';

Expand All @@ -14,18 +14,27 @@ export const shared = {
plugins: [style({minify: true})],
};

const esm = build({
const esmCtx = await esbuild.context({
...shared,
format: 'esm',
outfile: './lib/index.esm.js',
target: ['es2020', 'node18'],
});
const esm = esmCtx.rebuild();

const cjs = build({
const cjsCtx = await esbuild.context({
...shared,
format: 'cjs',
outfile: './lib/index.cjs.js',
target: ['es2020', 'node18'],
});
const cjs = cjsCtx.rebuild();

await Promise.all([buildTsc(import.meta.url), esm, cjs]);

await esmCtx.dispose();
await cjsCtx.dispose();

console.log(
`\x1b[32mCompleted ReactLib build\x1b[0m`
);
4 changes: 2 additions & 2 deletions packages/react/src/core/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const flagColor = [
];

//TODO: convert unknown to primitive types for better logs in SSG
interface LogParam {
export interface LogParam {
[key: string | number]: unknown;
}
class Log {
export class Log {
private level: LogLevel = 'none';
private flags: LogFlag[] = [];

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/index-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export { ComponentPulp } from './core/pulp/ComponentPulp';
export type { ComponentPulpState, ComponentPulpProps } from './core/pulp/ComponentPulp';

export { logLevel, LogFlag } from './core/log';
export type { LogLevel } from './core/log';
export type { LogLevel, Log, LogParam } from './core/log';
export { default as logger } from './core/log';
export { default as logConfig } from './core/logConfig';
5 changes: 3 additions & 2 deletions packages/shared/build-tsc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const buildTsc = async (url) => {
await exec("tsc");
const tsFinishTime = performance.now();
console.log(
`\x1b[32mTS Done in ${Math.round(tsFinishTime - startTime)}ms \x1b[0m`
`\x1b[32mCompleted TS build in ${Math.round(tsFinishTime - startTime)}ms \x1b[0m`
);

const dirname = path.dirname(fileURLToPath(url));
Expand All @@ -35,7 +35,7 @@ export const buildTsc = async (url) => {

if (extractorResult.succeeded) {
console.log(
`\x1b[32mAPI Extractor Done in ${Math.round(
`\x1b[32mCompleted API Extractor in ${Math.round(
apiFinishTime - tsFinishTime
)}ms \x1b[0m`
);
Expand All @@ -46,5 +46,6 @@ export const buildTsc = async (url) => {
` and ${extractorResult.warningCount} warnings`
);
process.exitCode = 1;
throw new Error("API Extractor completed with errors");
}
};
6 changes: 4 additions & 2 deletions packages/shared/window.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export const jikji_isReady = "__jikji_isReady";
export const jikji_readJsonDataFile = "__jikji_readJsonDataFile";
module.exports = {
jikji_isReady: "__jikji_isReady",
jikji_readJsonDataFile: "__jikji_readJsonDataFile",
};
Loading

0 comments on commit 8200ccb

Please sign in to comment.