Skip to content

Commit

Permalink
Merge pull request #57 from benrbray/benrbray/gh54/pnpm-attempt-2
Browse files Browse the repository at this point in the history
migrate from `npm` to `pnpm` monorepo with workspaces
  • Loading branch information
benrbray authored Jun 11, 2023
2 parents a0969eb + 1c713b8 commit 4c2b46c
Show file tree
Hide file tree
Showing 16 changed files with 12,580 additions and 9,344 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,23 @@ Noteworthy is still a bit rough around the edges, and is missing some basic qual

```bash
git clone [email protected]:benrbray/noteworthy.git
cd noteworthy
pnpm install
pnpm build
cd noteworthy-electron
npm run build:linux
pnpm run build:linux
pnpm run build:win
pnpm run build:mac
```

After building, look in the `/dist` folder for an executable.

## Development

Noteworthy is built with [`electron-vite`](https://evite.netlify.app/). To run in development mode with live-reload,
Noteworthy is built with [`electron-vite`](https://evite.netlify.app/), and structured as a monorepo using [`pnpm` workspaces](https://pnpm.io/workspaces). To run in development mode with live-reload,

```bash
cd noteworthy-electron
npm run dev
pnpm dev:electron
```

## Acknowledgements
Expand Down
27 changes: 27 additions & 0 deletions noteworthy-editor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@noteworthy/editor",
"private": true,
"version": "0.0.0",
"type": "module",
"files": ["dist"],
"main": "./dist/noteworthy-editor.umd.cjs",
"module": "./dist/noteworthy-editor.js",
"types": "./dist/noteworthy-editor.d.ts",
"exports": {
".": {
"import": "./dist/noteworthy-editor.js",
"require": "./dist/noteworthy-editor.umd.cjs"
}
},
"scripts": {
"dev": "vite",
"dev:electron": "pnpm run build",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^5.0.2",
"vite": "^4.3.9",
"vite-plugin-dts": "^2.3.0"
}
}
3 changes: 3 additions & 0 deletions noteworthy-editor/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function foo() {
console.log(2);
}
1 change: 1 addition & 0 deletions noteworthy-editor/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
23 changes: 23 additions & 0 deletions noteworthy-editor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
33 changes: 33 additions & 0 deletions noteworthy-editor/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { resolve } from "path";
import { defineConfig } from "vite";
import vitePluginDts from 'vite-plugin-dts';

export default defineConfig({
plugins: [
vitePluginDts({ insertTypesEntry: true })
],
resolve: {
alias: {
"@common" : "src/common",
}
},
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'NoteworthyEditor',
fileName: 'noteworthy-editor',
},
// rollupOptions: {
// // make sure to externalize deps that shouldn't be bundled
// // into your library
// external: ['vue'],
// output: {
// // Provide global variables to use in the UMD build
// // for externalized deps
// globals: {
// vue: 'Vue',
// },
// },
// },
}
})
1 change: 1 addition & 0 deletions noteworthy-electron/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
Loading

0 comments on commit 4c2b46c

Please sign in to comment.