Comments (7)
Congratulations @dherges. I tried ng-packagr yesterday and its an excellent tool and absolutely easy to set up. It did exactly what I expected it to do. I am very happy to read (e.g. in #65) that you are focused and don't plan to make it the next best swiss-army-knife-cli. I really appreciate and share such mindset. 👍
After having read this thread, though, and that you'd be willing to introduce support for unit testing and cli-like commands I asked myself if I would expect that from the tool. Spec files aren't part of the distributed bundles and thus could actually be completely ignored by a packager/bundler. From that reasoning I came to conclude that I would probably consider anything which has to do with those files out of scope. I admit this might be kind of a fundamentalistic point of view and who am I to judge the plans for your project. I just thought to give you some feedback and start a discussion.
Part of why I am a little skeptic is, I am afraid that once this feature is implemented I need to pull in all these thousands of transitive dependencies of karma, webpack, jasmine etc. in order to enjoy ng-packagr. I am really interested to learn about your rationale and what your plans for ng-packagr are. Have you thought of implementing unit test support kind of like a separate ng-packagr-testing-plugin which is opt-in for anyone who has demand for a testing utility?
Thanks anyway. ❤️
from ng-packagr.
Implementing testing, will arise the need for "commands" in ng-packagr. Usage should be:
$ ng-packagr -p ng-package.json ### default build command
$ ng-packagr build -p ng-package.json ### build command
$ ng-packagr test -p ng-package.json ### test command (run tests once)
to be discussed: "watch mode" for local dev, "headless" runners for CI (phantom, ChromeTravisCI, or something else?)
$ ng-packagr test:dev -p ng-package.json ### test command for local dev (watch mode)
One idea: describe different test "profiles" (profiles is not a good word ... maybe "environment" or "ambient-thing?").
test:dev
: Chrome browser, watch modetest:ci
: 'ChromeTravisCi', phantom as fallback, run oncetest
: auto-detect or auto-configure best matching premise
Then, maybe allow users to set "premises" in ng-package.json
:
"test": {
"ambient": {
"dev": {
"browser": "Chrome",
"watch": true
},
"ci": {
"browser": "Phantom",
"watch": false
},
}
}
from ng-packagr.
@about-code Uh, I like the idea of a separate ng-packagr-testing
utility!
Maybe it's a nice idea to build a "multi-module" project e.g. w/ yarn workspaces for ng-packagr and then publish multiple npm packages as coexistent releases (same version number, et al).
from ng-packagr.
Maybe it's a nice idea to build a "multi-module" project e.g. w/ yarn workspaces for ng-packagr and then publish multiple npm packages as coexistent releases (same version number, et al).
I don't know yarn workspaces yet and would have thought of Lerna first, but if they are easier to manage, then yeah, it could be a very nice approach.
from ng-packagr.
Deprioritized this feature. Auto-generating the karma.conf.js
is probably not a good idea. IntelliJ (and other IDEs) have first-class support for Karma but need to locate that karma.conf.js
file in the project.
Will need to elaborate how to use testing in libs w/ minimal configuration. Using the @angular/cli/plugins/karma
removes the additional webpack config but it needs the .angular-cli.json
to work. A custom angular karma plugin that works w/ the above folder layout would be a good idea.
Rough draft idea: karma.conf.js
+ test.ts
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', 'angular'],
plugins: [
require('karma-jasmine'),
require('karma-angular-testing-plugin')
]
});
};
Maybe there is already an existing solution?
from ng-packagr.
Changed to "WONTFIX"
Motivation: existing tool support requires a karma.conf.js
to work. For example, IntelliJ has good Karma support. See above. Goal should imho to have an Angular test runner for karma
- a) w/ support for typescript and scss, less, and so on and on and on ....
- b) run tests against
dist
javascript files
from ng-packagr.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
This action has been performed automatically by a bot.
from ng-packagr.
Related Issues (20)
- Support esbuild HOT 2
- Support for adding custom PostCSS plugins HOT 1
- 17.1 Release Schematic Breakage HOT 4
- Embedded assets in CSS broken with 17.1 HOT 1
- Build inline SVG HOT 3
- v17.1.1 Breaks Angular Packages Containing SCSS HOT 3
- Webpack no longer picks up change from linked library. HOT 2
- Support building individual entrypoints alone HOT 2
- Can't import default export inside library component HOT 2
- secondary entry point peer deps HOT 3
- Documentation about postcss configuration HOT 4
- Cannot use import() to include external scripts in the library HOT 4
- Memory leak during build after upgrade to 17.x.x HOT 2
- ng-packagr hangs in Azure DevOps pipeline HOT 1
- Data path "" must NOT have additional properties (dest) HOT 2
- Data path "" must NOT have additional properties (dest). HOT 5
- Unit test is only running for the main packages, but it ignore the spec files in other sub-packages HOT 2
- Improve Postcss Documentation HOT 4
- i upgraded my angular project from v11 to v16. HOT 4
- Esbuild incorrect path resolution HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-packagr.