Use entry file as an alternative to egg.json #215
Replies: 7 comments 2 replies
-
This is actually a creative idea that we hadn't yet considered. Because users' packages are already configured with the concept of |
Beta Was this translation helpful? Give feedback.
-
This is dependent on a de facto standard and would thus be restricting to users who do not subscribe to such methodologies. I'm -1 for this. |
Beta Was this translation helpful? Give feedback.
-
If we allowed it as strictly an alternative and not the standard, that wouldn't be that bad I guess, but adding too many means to configure something will clutter the CLI not in terms of SLOC but rather in features. |
Beta Was this translation helpful? Give feedback.
-
so what about in the module's entry file, we export an // mod.ts (or ANY other JS/TS file)
export * from "./denon.ts";
export * from "./src/watcher.ts";
export * from "./src/runner.ts";
export { DenonConfig, DEFAULT_DENON_CONFIG } from "./src/config.ts";
export const egg = {
"name": "denon",
"description": "Monitor any changes in you Deno application and automatically restart.",
"entry": "./mod.ts", // won't need after this
"stable": true,
"version": "2.2.0",
"unlisted": false,
"files": [
"./README.md",
"./deps.ts",
"./test_deps.ts",
"./denon.ts",
"./denon.config.ts",
"./mod.ts",
"./templates/**/*",
"./src/**/*"
]
} then in the CLI: eggs publish mod.ts --bump="2.2.1" --stable="true" --unlisted="false" or if you don't wanna change anything from the config, you would do: eggs publish mod.ts --bump="2.2.1" |
Beta Was this translation helpful? Give feedback.
-
Okay so I really like this idea. It is really convenient and easy. Should be understandable for everyone. We could even offer type checking for it, since we already have the config interface defined |
Beta Was this translation helpful? Give feedback.
-
I like the idea of keeping a dynamic config but keeping it in just any js or ts file will be an extra step for user to specify in the publish command. What I think is that we allow users to place their eggs config in any file but we also have a default file from where the config is exported called |
Beta Was this translation helpful? Give feedback.
-
@divy-work I think that only searching for an exported config in the entry file won't be any extra work for the user because they have to have an entry file anyway. I agree that we don't necessarily have to search through all files being uploaded or in a given directory. Also, what would the point of having |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? If so, please describe.
the problem is another package.json in the form of egg.json
Describe the solution you'd like
Use
deps.ts
as an alternative to egg.json?like just export an object named
egg
which eggs could import and work with.example:
this would also be good in case someone needs this metadata in their application or metadata of their dependencies.
And this can also be used in auditing as this information is contained inside the package.
Describe alternatives you've considered
none
Additional context
possible solution to nestdotland/eggs#3
Beta Was this translation helpful? Give feedback.
All reactions