Closed NullVoxPopuli closed 2 years ago
Looking at this, I’m not sure this is a bug exactly or that the solution proposed is the right one, but there is a real thing to tackle here: we need to support workspaces well. I will probably be opening an issue tracking that shortly, and will link this to it (probably just closing in favor of it) when I have. Thanks!
Per note above, I am closing this in favor of #1451.
Please paste the output of
ember -v
hereember-cli: 3.16.x node: 12.x os: linux x64
Please paste the output of
tsc -v
hereVersion 3.9.7
Please paste the version of
ember-cli-typescript
andember-cli-typescript-blueprints
herePlease paste your
tsconfig.json
andtslint.json
oreslint.json
(if applicable) belowOur tsconfig is in two parts:
root:
tsconfig.json at the root with shared options
``` // https://www.typescriptlang.org/v2/en/tsconfig { "compilerOptions": { // Babel handles transpiling, not tsc "target": "ESNext", "module": "ESNext", // Many npm modules are not distributed as actual modules "allowSyntheticDefaultImports": true, // Some of these overlap with @typescript-eslint a bit, but we can fail faster // be also having the type checker check these. // // -- cleanliness "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": false, // -- correctness "noImplicitAny": true, "noImplicitThis": true, "alwaysStrict": true, "strictNullChecks": true, "importsNotUsedAsValues": "error", // enforces type imports when imports are not used as values // -- footgun prevention "strictPropertyInitialization": true, "noFallthroughCasesInSwitch": true, // noEmitOnError will "break the build" like a traditional statically typed language "noEmitOnError": false, // default to not transpiling to js every save "noEmit": true, // forward source maps to babel "inlineSourceMap": true, "inlineSources": true, // allow JS but don't type check the JS // checkJs conflicts with noImplicitAny "allowJs": true, "checkJs": false, "moduleResolution": "node", "experimentalDecorators": true, // NOTE: specifying "paths" here is not inherited by TS projects // as the "extends" option does not resolve paths when the baseUrl changes. // // Each ts project will have some duplication with all the upward relative paths // referencing addons within the monorepo. // "paths": {}, }, "exclude": [ ".git", "bower_components", "dist", "node_modules", "tmp", "vendor", "**/node_modules/*", "**/tmp/*", "**/dist/*" ] } ```a project:
tsconfig.json for an addon
``` { "extends": "../../../tsconfig.json", "compilerOptions": { "baseUrl": ".", "paths": { "dummy/tests/*": [ "tests/*" ], "dummy/*": [ "tests/dummy/app/*", "app/*" ], "my-addon": [ "addon" ], "my-addon/*": [ "addon/*" ], "my-addon/test-support": [ "addon-test-support" ], "my-addon/test-support/*": [ "addon-test-support/*" ], // Normally these are resolved in node_modules, but these packages are sym-linked "extra-types/*": ["../../../shared/packages/extra-types/*"], "browser-services": ["../../../shared/packages/browser-services/addon"], "browser-services/*": ["../../../shared/packages/browser-services/addon/*"], "ui": ["../ui/addon"], "ui/*": ["../ui/addon/*"], "*": [ "types/*" ] } }, "include": [ "app/**/*", "addon/**/*", "tests/**/*", "types/**/*", "test-support/**/*", "addon-test-support/**/*" ] } ```What are instructions we can follow to reproduce the issue?
This isn't going to be easy.
paths
entry because typescript doesn't know how to resolve local addons in a monorepoyarn prepublishOnly
in an addon that references other ts addons -- you'll get an error about files from the other addons not being within the rootDir.What I've had to do in the mean time is redefine the prepublish and postpublish commands:
which isn't great :(