Skip to content

Commit

Permalink
chore: monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
jungpaeng committed Oct 1, 2023
1 parent 2ae56bd commit ab3e3e2
Show file tree
Hide file tree
Showing 28 changed files with 323 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Unplugged Packages
run: yarn install --immutable --immutable-cache
- name: Package Build
run: yarn build
run: yarn build:package
- name: Package Release
id: changesets
uses: cometkim/yarn-changeset-action@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
.turbo

node_modules
.yarn/*
Expand Down
177 changes: 127 additions & 50 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 7 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,31 @@
{
"name": "lit-intl",
"version": "0.0.1",
"private": true,
"main": "index.js",
"repository": "https://github.com/jungpaeng/lit-intl.git",
"author": "jungpaeng",
"license": "MIT",
"packageManager": "[email protected]",
"workspaces": [
"packages/*"
],
"scripts": {
"clean": "rimraf dist",
"build": "yarn clean && yarn build:js && yarn build:dts",
"build:dts": "tsc --emitDeclarationOnly",
"build:js": "node esbuild.config.cjs",
"test": "yarn vitest"
},
"dependencies": {
"intl-messageformat": "^10.5.3"
"build:package": "yarn turbo build"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.23",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"esbuild": "^0.19.4",
"esbuild-node-externals": "^1.9.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^3.0.0",
"jsdom": "^22.1.0",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
},
"peerDependencies": {
"react": "^18.0.0"
"turbo": "^1.10.14",
"typescript": "^5.2.2"
}
}
27 changes: 27 additions & 0 deletions packages/core/esbuild.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { build } = require('esbuild');
const { nodeExternalsPlugin } = require('esbuild-node-externals');

const baseBuild = ({
format,
outExtension,
entryPoints = ['src/index.ts'],
outdir = 'dist',
} = {}) => {
return build({
format,
outExtension,
entryPoints,
outdir,
target: 'es2015',
bundle: true,
minify: true,
sourcemap: true,
plugins: [nodeExternalsPlugin()],
});
};

Promise.all([
baseBuild({ format: 'cjs', outExtension: { '.js': '.min.cjs' } }),
baseBuild({ format: 'esm', outExtension: { '.js': '.min.mjs' } }),
]).catch(() => process.exit(1));
36 changes: 36 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@lit-intl/core",
"version": "0.0.1",
"main": "index.js",
"repository": "https://github.com/jungpaeng/lit-intl.git",
"author": "jungpaeng",
"license": "MIT",
"packageManager": "[email protected]",
"workspaces": [
"packages/*"
],
"scripts": {
"clean": "rimraf dist",
"build": "yarn clean && yarn build:js && yarn build:dts",
"build:dts": "tsc -p tsconfig.build.json --emitDeclarationOnly",
"build:js": "node esbuild.config.cjs",
"test": "yarn vitest"
},
"dependencies": {
"intl-messageformat": "^10.5.3"
},
"devDependencies": {
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.23",
"esbuild": "^0.19.4",
"esbuild-node-externals": "^1.9.0",
"jsdom": "^22.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"vitest": "^0.34.6"
},
"peerDependencies": {
"react": "^18.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

import IntlMessageFormat from 'intl-messageformat';

import { LitIntlContext } from './lit-intl.context';
import { type IntlMessage } from './types/intl-message';
import { type TranslationValue } from './types/translation';

import IntlMessageFormat from 'intl-messageformat';

function resolvePath(messages: IntlMessage, idPath: string) {
let message = messages;

Expand Down
1 change: 1 addition & 0 deletions packages/core/test/setup.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
File renamed without changes.
1 change: 1 addition & 0 deletions packages/core/test/use-translation.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
File renamed without changes.
7 changes: 7 additions & 0 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src"
},
"exclude": ["test"]
}
9 changes: 9 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist",
"jsx": "react-jsx"
},
"include": ["src", "test"]
}
2 changes: 2 additions & 0 deletions packages/core/vitest.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: import("vite").UserConfig;
export default _default;
File renamed without changes.
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"target": "es6",
"module": "esnext",
"lib": ["dom", "esnext"],
"outDir": "dist",
"jsx": "react-jsx",
"strict": true,
"sourceMap": true,
"declaration": true,
Expand All @@ -15,5 +13,6 @@
"typeRoots": ["node_modules/@types"],
"skipLibCheck": true,
"skipDefaultLibCheck": true
}
},
"exclude": ["packages/**/dist/*"]
}
9 changes: 9 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
}
}
}
102 changes: 91 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,25 @@ __metadata:
languageName: node
linkType: hard

"@lit-intl/core@workspace:packages/core":
version: 0.0.0-use.local
resolution: "@lit-intl/core@workspace:packages/core"
dependencies:
"@testing-library/react": ^14.0.0
"@types/react": ^18.2.23
esbuild: ^0.19.4
esbuild-node-externals: ^1.9.0
intl-messageformat: ^10.5.3
jsdom: ^22.1.0
react: ^18.2.0
react-dom: ^18.2.0
rimraf: ^5.0.5
vitest: ^0.34.6
peerDependencies:
react: ^18.0.0
languageName: unknown
linkType: soft

"@manypkg/find-root@npm:^1.1.0":
version: 1.1.0
resolution: "@manypkg/find-root@npm:1.1.0"
Expand Down Expand Up @@ -3735,29 +3754,19 @@ __metadata:
resolution: "lit-intl@workspace:."
dependencies:
"@changesets/cli": ^2.26.2
"@testing-library/react": ^14.0.0
"@types/react": ^18.2.23
"@typescript-eslint/eslint-plugin": ^6.7.3
"@typescript-eslint/parser": ^6.7.3
esbuild: ^0.19.4
esbuild-node-externals: ^1.9.0
eslint: ^8.50.0
eslint-config-prettier: ^9.0.0
eslint-plugin-import: ^2.28.1
eslint-plugin-prettier: ^5.0.0
eslint-plugin-react: ^7.33.2
eslint-plugin-react-hooks: ^4.6.0
eslint-plugin-unused-imports: ^3.0.0
intl-messageformat: ^10.5.3
jsdom: ^22.1.0
prettier: ^3.0.3
react: ^18.2.0
react-dom: ^18.2.0
rimraf: ^5.0.5
turbo: ^1.10.14
typescript: ^5.2.2
vitest: ^0.34.6
peerDependencies:
react: ^18.0.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -5729,6 +5738,77 @@ __metadata:
languageName: node
linkType: hard

"turbo-darwin-64@npm:1.10.14":
version: 1.10.14
resolution: "turbo-darwin-64@npm:1.10.14"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"turbo-darwin-arm64@npm:1.10.14":
version: 1.10.14
resolution: "turbo-darwin-arm64@npm:1.10.14"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"turbo-linux-64@npm:1.10.14":
version: 1.10.14
resolution: "turbo-linux-64@npm:1.10.14"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard

"turbo-linux-arm64@npm:1.10.14":
version: 1.10.14
resolution: "turbo-linux-arm64@npm:1.10.14"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard

"turbo-windows-64@npm:1.10.14":
version: 1.10.14
resolution: "turbo-windows-64@npm:1.10.14"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"turbo-windows-arm64@npm:1.10.14":
version: 1.10.14
resolution: "turbo-windows-arm64@npm:1.10.14"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"turbo@npm:^1.10.14":
version: 1.10.14
resolution: "turbo@npm:1.10.14"
dependencies:
turbo-darwin-64: 1.10.14
turbo-darwin-arm64: 1.10.14
turbo-linux-64: 1.10.14
turbo-linux-arm64: 1.10.14
turbo-windows-64: 1.10.14
turbo-windows-arm64: 1.10.14
dependenciesMeta:
turbo-darwin-64:
optional: true
turbo-darwin-arm64:
optional: true
turbo-linux-64:
optional: true
turbo-linux-arm64:
optional: true
turbo-windows-64:
optional: true
turbo-windows-arm64:
optional: true
bin:
turbo: bin/turbo
checksum: 219d245bb5cc32a9f76b136b81e86e179228d93a44cab4df3e3d487a55dd2688b5b85f4d585b66568ac53166145352399dd2d7ed0cd47f1aae63d08beb814ebb
languageName: node
linkType: hard

"type-check@npm:^0.4.0, type-check@npm:~0.4.0":
version: 0.4.0
resolution: "type-check@npm:0.4.0"
Expand Down

0 comments on commit ab3e3e2

Please sign in to comment.