Skip to content
This repository was archived by the owner on May 20, 2022. It is now read-only.

Commit

Permalink
fix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
steveruizok committed Nov 7, 2021
1 parent 8df9fbe commit 202f05c
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 52 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,19 @@ export function App() {

## Local Development

- Run `yarn` to install dependencies.

- Run `yarn start` to start the development server for the package and for the example.
To start the development servers for the package and the advanced example:

- Open `localhost:5000` to view the example project.
- Run `yarn` to install dependencies.
- Run `yarn start`.
- Open `localhost:5420`.

- Run `yarn test` to execute unit tests via [Jest](https://jestjs.io).
You can also run:

- Run `yarn docs` to build the docs via [ts-doc](https://typedoc.org/).
- `start:advanced` to start development servers for the package and the advanced example.
- `start:simple` to start development servers for the package and the simple example.
- `test` to execute unit tests via [Jest](https://jestjs.io).
- `docs` to build the docs via [ts-doc](https://typedoc.org/).
- `build` to build the package.

## Example

Expand Down
10 changes: 6 additions & 4 deletions example-advanced/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# @tldraw/core-example-advanced
# @tldraw/core Advanced Example

An advanced example project with a very fast dev server.
An advanced example project for `@tldraw/core`.

You probably do not need to start the server here: it is started as
part of `yarn start` in the root directory.
To start this project:

- run `yarn start` in the root directory
- open `http://localhost:5420` in your browser
2 changes: 1 addition & 1 deletion example-advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "MIT",
"private": true,
"scripts": {
"start": "node scripts/dev.mjs -w",
"start:advanced": "node scripts/dev.mjs -w",
"build": "node scripts/build.mjs"
},
"files": [],
Expand Down
2 changes: 1 addition & 1 deletion example-advanced/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function main() {
esbuild.buildSync({
entryPoints: ['./src/index.tsx'],
outdir: 'dist',
minify: true,
minify: false,
bundle: true,
format: 'cjs',
target: 'es6',
Expand Down
5 changes: 2 additions & 3 deletions example-advanced/scripts/dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ async function main() {
await esbuildServe(
{
entryPoints: ['src/index.tsx'],
outfile: 'dist/index.js',
bundle: true,
outfile: 'dist/bundle.js',
minify: false,
sourcemap: true,
incremental: true,
Expand All @@ -26,13 +26,12 @@ async function main() {
},
watch: {
onRebuild(err) {
serve.update()
err ? error('❌ Failed') : log('✅ Updated')
},
},
},
{
port: 5000,
port: 5420,
root: './dist',
live: true,
}
Expand Down
10 changes: 0 additions & 10 deletions example-advanced/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,5 @@
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script type="module" src="./index.js"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
8 changes: 5 additions & 3 deletions example-simple/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# @tldraw/core-example-simple
# @tldraw/core Simple Example

A (relatively) simple example project with a very fast dev server.

You probably do not need to start the server here: it is started as
part of `yarn start:simple` in the root directory.
To start this project:

- run `yarn start:simple` in the root directory
- open `http://localhost:5420` in your browser
3 changes: 1 addition & 2 deletions example-simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"license": "MIT",
"private": true,
"scripts": {
"start": "node scripts/dev.mjs -w",
"start:simple": "node scripts/dev.mjs -w",
"build": "node scripts/build.mjs"
},
"files": [],
"sideEffects": false,
"devDependencies": {
"@tldraw/core": "^0.1.18",
"@tldraw/vec": "^0.0.130",
Expand Down
2 changes: 1 addition & 1 deletion example-simple/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function main() {
esbuild.buildSync({
entryPoints: ['./src/index.tsx'],
outdir: 'dist',
minify: true,
minify: false,
bundle: true,
format: 'cjs',
target: 'es6',
Expand Down
5 changes: 2 additions & 3 deletions example-simple/scripts/dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ async function main() {
await esbuildServe(
{
entryPoints: ['src/index.tsx'],
bundle: true,
outfile: 'dist/bundle.js',
bundle: true,
minify: false,
sourcemap: true,
incremental: true,
Expand All @@ -26,13 +26,12 @@ async function main() {
},
watch: {
onRebuild(err) {
serve.update()
err ? error('❌ Failed') : log('✅ Updated')
},
},
},
{
port: 5000,
port: 5420,
root: './dist',
live: true,
}
Expand Down
10 changes: 0 additions & 10 deletions example-simple/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,5 @@
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script type="module" src="./bundle.js"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
"example-advanced"
],
"scripts": {
"test": "jest",
"test:watch": "jest --watchAll",
"lerna": "lerna",
"start": "yarn start:advanced",
"start:simple": "lerna run start:simple --stream --parallel",
"start:advanced": "lerna run start:advanced --stream --parallel",
"build": "lerna run build && lerna run docs",
"start": "cd packages/core && yarn start & cd example-advanced && yarn start",
"start:simple": "cd packages/core && yarn start & cd example-simple && yarn start",
"start:all": "lerna run start --stream --parallel",
"publish:patch": "yarn test && yarn build && lerna publish patch",
"docs": "lerna run docs",
"docs:watch": "lerna run docs:watch"
"docs:watch": "lerna run docs:watch",
"test": "jest",
"test:watch": "jest --watchAll",
"lerna": "lerna"
},
"devDependencies": {
"@swc-node/jest": "^1.3.3",
Expand Down
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"scripts": {
"start:simple": "yarn start",
"start:advanced": "yarn start",
"start": "node scripts/dev & yarn types:dev",
"build": "node scripts/build && yarn types:build && node scripts/copy-readme",
"types:dev": "tsc -w --p tsconfig.build.json",
Expand All @@ -48,4 +50,4 @@
"@types/react": "^17.0.33",
"@types/react-dom": "^17.0.10"
}
}
}

1 comment on commit 202f05c

@vercel
Copy link

@vercel vercel bot commented on 202f05c Nov 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.