What Happens
I can't run the package.json scripts successfully
- When I run the
dev script in package.json I get an error.Here is the output:
> @pkl-community/pkl-typescript@0.0.19 dev
> tsx pkl-gen-typescript/main.ts
ERROR You must provide at least one file to evaluate. 11:08:13 AM
◐ Generating TypeScript sources for modules 11:08:13 AM
Process finished with exit code 0
- when I run the
e2e script in package.json, jest tries to also run tests in the /dist directory.
> @pkl-community/pkl-typescript@0.0.19 test:e2e
> jest
[start] Generating TypeScript sources for modules /Users/ashley0/DEV/CODE/TS-JS/GH-other-owners/pkl-typescript/dist/e2e/only_primitives/schema.pkl
[start] Generating TypeScript sources for modules /Users/ashley0/DEV/CODE/TS-JS/GH-other-owners/pkl-typescript/dist/e2e/only_primitives/schema.pkl
[start] Generating TypeScript sources for modules /Users/ashley0/DEV/CODE/TS-JS/GH-other-owners/pkl-typescript/dist/e2e/only_primitives/schema.pkl
[start] Generating TypeScript sources for modules /Users/ashley0/DEV/CODE/TS-JS/GH-other-owners/pkl-typescript/e2e/only_primitives/schema.pkl
[start] Generating TypeScript sources for modules /Users/ashley0/DEV/CODE/TS-JS/GH-other-owners/pkl-typescript/dist/e2e/only_primitives/schema.pkl
FAIL dist/e2e/only_primitives/primitives.test.js
● E2E of config with only primitive values › can generate TypeScript sources and load valid values
–– Pkl Error ––
Cannot find module `file:///Users/ashley0/DEV/CODE/TS-JS/GH-other-owners/pkl-typescript/dist/e2e/only_primitives/schema.pkl`.
[snip]
What I expected to happen
test:e2e would only run tests in the ./e2e directory and jest would ignore the dist directory
- 'dev':
- First make sure everything is freshly compiled / generated etc.
- Run pkl-gen-typescript/main.ts and provide a pkl module (perhaps some simple one in an example or test directory)
Discussion
Suggestions
Here's how I would update the package.json script:
"test:e2e": "jest ./e2e",
"dev": "tsc && tsx pkl-gen-typescript/main.ts ./examples/basic-intro/config.pkl",
And I would create a configuration file for jest so that the directories it recognizes as valid (e.g. testMatch patterns) are made explicit.
What Happens
I can't run the package.json scripts successfully
devscript inpackage.jsonI get an error.Here is the output:e2escript inpackage.json, jest tries to also run tests in the/distdirectory.What I expected to happen
test:e2ewould only run tests in the./e2edirectory and jest would ignore thedistdirectoryDiscussion
Suggestions
Here's how I would update the package.json script:
"test:e2e": "jest ./e2e","dev": "tsc && tsx pkl-gen-typescript/main.ts ./examples/basic-intro/config.pkl",And I would create a configuration file for jest so that the directories it recognizes as valid (e.g.
testMatchpatterns) are made explicit.