{"action":"closed","issue":{"url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/1121","repository_url":"https://api.github.com/repos/bazelbuild/rules_nodejs","labels_url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/1121/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/1121/comments","events_url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/1121/events","html_url":"https://github.com/bazelbuild/rules_nodejs/issues/1121","id":492149192,"node_id":"MDU6SXNzdWU0OTIxNDkxOTI=","number":1121,"title":"typescript “relative imports” are turned into “absolute imports” ","user":{"login":"wimzyLive","id":22066605,"node_id":"MDQ6VXNlcjIyMDY2NjA1","avatar_url":"https://avatars1.githubusercontent.com/u/22066605?v=4","gravatar_id":"","url":"https://api.github.com/users/wimzyLive","html_url":"https://github.com/wimzyLive","followers_url":"https://api.github.com/users/wimzyLive/followers","following_url":"https://api.github.com/users/wimzyLive/following{/other_user}","gists_url":"https://api.github.com/users/wimzyLive/gists{/gist_id}","starred_url":"https://api.github.com/users/wimzyLive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wimzyLive/subscriptions","organizations_url":"https://api.github.com/users/wimzyLive/orgs","repos_url":"https://api.github.com/users/wimzyLive/repos","events_url":"https://api.github.com/users/wimzyLive/events{/privacy}","received_events_url":"https://api.github.com/users/wimzyLive/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-09-11T10:23:54Z","updated_at":"2019-09-11T21:11:43Z","closed_at":"2019-09-11T21:11:43Z","author_association":"NONE","body":"<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄 \r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🐞 bug report\r\n\r\n### Affected Rule\r\n\r\n<!-- Can you pin-point one or more rules_nodejs as the source of the bug? -->\r\n<!-- ✍️edit: --> The issue is caused by the rule: \r\nPossibly **ts_library**\r\n\r\n\r\n### Is this a regression?\r\n\r\n<!-- Did this behavior use to work in the previous version? -->\r\n<!-- ✍️--> Yes, the previous version in which this bug was not present was: ....\r\nNot sure.\r\nTried with bazel/typescript 0.29 and 0.37, and both seems to have this issue.\r\n\r\n\r\n### Description\r\n\r\n<!-- ✍️--> A clear and concise description of the problem...\r\ntypescript file  with relative imports, turned into absolute import after compilation.\r\n\r\nbootstrapper.ts:\r\n```typescript\r\nimport { Stack, App, StackProps } from '@aws-cdk/core';\r\nimport { StaticSite } from './resources/static-site';\r\n\r\nclass MyStaticSiteStack extends Stack {\r\n  constructor(parent: App, name: string, props: StackProps) {\r\n    super(parent, name, props);\r\n\r\n    new StaticSite(this, 'StaticSite', {\r\n      domainName: this.node.tryGetContext('domain'),\r\n      siteSubDomain: this.node.tryGetContext('subdomain')\r\n    });\r\n  }\r\n}\r\n\r\nconst app = new App();\r\n\r\nnew MyStaticSiteStack(app, 'MyStaticSite', { env: { region: 'us-east-1' } });\r\n```\r\ntsconfig:\r\n```json\r\n{\r\n  \"compilerOptions\": {\r\n    \"outDir\": \"./dist\",\r\n    \"module\": \"commonjs\",\r\n    \"moduleResolution\": \"node\",\r\n    \"strict\": true,\r\n    \"target\": \"es2015\",\r\n    \"lib\": [\"es2015.promise\", \"es5\", \"es6\", \"es2017.object\", \"dom\"],\r\n    \"noImplicitAny\": false,\r\n    \"experimentalDecorators\": true,\r\n    \"strictNullChecks\": false,\r\n    \"baseUrl\": \"./\",\r\n    \"rootDir\": \"./\",\r\n    \"paths\": {\r\n      \"@bhavnastitch/*\": [\"./*\"],\r\n      \"@bh-orders-app/*\": [\"./bh-orders-app/*\"]\r\n    }\r\n  },\r\n  \"exclude\": [\"node_modules\"]\r\n}\r\n```\r\nBUILD File:\r\n```bazel\r\npackage(default_visibility=[\"//visibility:public\"])\r\nload(\"@npm_bazel_typescript//:index.bzl\", \"ts_library\")\r\n\r\nalias(\r\n    name = \"tsconfig.json\",\r\n    actual = \"//:tsconfig.json\",\r\n)\r\nts_library(\r\n    name = \"src\",\r\n    srcs = glob([\"**/*.ts\"]),\r\n    tsconfig= \":tsconfig.json\",\r\n    deps= [\r\n        \"@npm//@aws-cdk/aws-s3\",\r\n        \"@npm//@aws-cdk/core\"\r\n    ]\r\n)\r\n```\r\ncompiled file looks like this:\r\n```javascript\r\n(function (factory) {\r\n    if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n        var v = factory(require, exports);\r\n        if (v !== undefined) module.exports = v;\r\n    }\r\n    else if (typeof define === \"function\" && define.amd) {\r\n        define(\"backend/bh-orders-app/bootstrapper\", [\"require\", \"exports\", \"@aws-cdk/core\", \"backend/bh-orders-app/resources/static-site\"], factory);\r\n    }\r\n})(function (require, exports) {\r\n    \"use strict\";\r\n    Object.defineProperty(exports, \"__esModule\", { value: true });\r\n    const core_1 = require(\"@aws-cdk/core\");\r\n    const static_site_1 = require(\"backend/bh-orders-app/resources/static-site\");\r\n    class MyStaticSiteStack extends core_1.Stack {\r\n        constructor(parent, name, props) {\r\n            super(parent, name, props);\r\n            new static_site_1.StaticSite(this, 'StaticSite', {\r\n                domainName: this.node.tryGetContext('domain'),\r\n                siteSubDomain: this.node.tryGetContext('subdomain')\r\n            });\r\n        }\r\n    }\r\n    const app = new core_1.App();\r\n    new MyStaticSiteStack(app, 'MyStaticSite', { env: { region: 'us-east-1' } });\r\n});\r\n```\r\n\r\nThis is what I get back but when I run it it wont work because it doesn't know what backend/bh-orders-app/resources/static-site refers to .\r\n\r\nDirectory structure:\r\n```\r\nbackend--\r\n         |--bh-order-app\r\n            |--resources\r\n               |--static-site.ts\r\n            |--bootstrapper.ts <---- File that I have provided example for.\r\n            |--BUILD\r\n         |-WORKSPACE\r\n```\r\n## 🔬 Minimal Reproduction\r\n\r\n<!--\r\nPlease create and share minimal reproduction of the issue. For the purpose you can create a GitHub repository and share a link. Make sure you don't upload any confidential files.\r\n-->\r\nExample Repo: https://github.com/wimzyLive/bhavnastitch/tree/master/backend\r\n\r\n## 🔥 Exception or Error\r\n\r\n<pre><code>\r\nNo Errors or warnings.\r\n\r\n</code></pre>\r\n\r\n\r\n## 🌍  Your Environment\r\n\r\n**Operating System:**\r\n\r\n<pre>\r\n  <code>\r\nmacOS Mojave (version 10.14.4)\r\n  </code>\r\n</pre>\r\n\r\n**Output of `bazel version`:**\r\n\r\n<pre>\r\n  <code>\r\nBuild label: 0.25.2\r\nBuild target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar\r\nBuild time: Fri May 10 20:50:40 2019 (1557521440)\r\nBuild timestamp: 1557521440\r\nBuild timestamp as int: 1557521440\r\n  </code>\r\n</pre>\r\n\r\n\r\n"}}
{"actor":{"display_login":"alexeagle"}}