for those new commands, add also tsconfig.json src/back ans src/front? also the project has no sealgen installed
Just to make sure: T2721 is about module-starter – a repository we use when starting new libraries. It’s like sealious playground, but for small utils like tempstream. The repository is here: Module Starter · module-starter
from Login
“So we need to have the build and typecheck scripts running using raw eslint. You can use this commit for inspiration - it contains an esbuild.js script that gets most of the work done.”
which commit?
I would like to clarify some issues with project:
- I had a problem with installing dependencies, so I copied “dependencies” and “devDependencies” from your commit. but when I run
npm install
there is an errror:
ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: module-starter@0.0.1
npm ERR! Found: esbuild@0.14.54
npm ERR! node_modules/esbuild
npm ERR! dev esbuild@"^0.14.10" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer esbuild@"^0.19.4" from esbuild-sass-plugin@2.16.1
npm ERR! node_modules/esbuild-sass-plugin
npm ERR! dev esbuild-sass-plugin@"^2.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
- module starter which script commands should run like in sealious? not
start
I guess, we don’t specify docker file yet. Also, in a diff comment you mentioned lint
"scripts": {
"start": "docker-compose up -d db && node .",
"typecheck:back": "tsc --noEmit -p src/back",
"typecheck:front": "tsc --noEmit -p src/front",
"build": "node ./esbuild.js",
"watch": "multiple-scripts-tmux \"npm run typecheck:back --watch\" \"SEALIOUS_PORT=$SEALIOUS_PORT SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL nodemon --enable-source-maps .\" \"npm run build -- --watch\" \"npm run typecheck:front --watch\" ",
"test": "mocha",
"prepare": "npm run build",
"clean-coverage": "rm -rf coverage .nyc_output .xunit",
"coverage": "npm run clean-coverage && nyc mocha",
"test-reports": "npm run clean-coverage && nyc --reporter clover mocha --reporter xunit --reporter-option output=.xunit",
"coverage-html": "npm run test-reports && nyc report --reporter lcov && xdg-open coverage/lcov-report/index.html"
},
You can remove the sass plugin from dependencies - we won’t be building scss in this project. Let’s focus only on building TS in the scope of this task.
Not sure I understand the question. What do you mean “to run like in sealious”? The goal of module starter is to have a quick foundation for creating libraries - ones that may not have a “start” entrypoint.
so I added esbuild, some dependencies and script commands. But how the project should work? Should I add some tests , or server to run on 8080 port? How to verify if migration is successfull?
Here are some checks you can run:
npm install && npm run build
don’t throw errors- You can put some TS code in
src
dir and after runningnpm run build
it appears in thelib
directory as transpiled js files, ready to run. - Adding a
console.log
tosrc/index.ts
, building, and then runningnode .
should run that console.log - Changes to types in
src
should be reflected in.d.ts
files in the@types
directory. Add a method to theExample
class inindex.ts
. Run build. Does the new method appear in the@types
directory? npm run test
passes with output ending with:
Example
example
âś” should equal 'example'
1 passing (5ms)
Remember that module-starter is a bare-bones template for starting a typescript library or a small project, that might not use an HTTP server
so at least partially it works so far i will check this all
D1390 to cr
Ready to land!