Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add compatiblity with transpilers. #671

Open
gabrielgortabns opened this issue Feb 3, 2023 · 2 comments
Open

[FR] Add compatiblity with transpilers. #671

gabrielgortabns opened this issue Feb 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@gabrielgortabns
Copy link

gabrielgortabns commented Feb 3, 2023

Let say, I have transpiler, that transform some code in ./src/ directory to other code in ./build/ directory. It would be nice, to be able to trigger upload from ./src/ directory, that would upload transpiled version of code.

Possible solution:

Configuration/setting where user can specify that if they trigger upload in ./src/FileCabined/SuiteScripts/sample.ts it will upload ./build/FileCabined/SuiteScripts/sample.js... it could be defined via regex, or syntax like:

{
    "source": ["src/**/*.ts", "src/**/*.js"]
    "build": ["build/**/*.js"]
}

or function:

function pathUpdate(path) {
    return path.replace(/^build/, "src").replace(/.ts$/, ".js");
}

that can be part of suitecloud.config.js.

@Rvice
Copy link

Rvice commented Feb 9, 2023

Have you tried doing this via the tsconfig file? Create a base tsconfig.json then create your separate build ones

  "extends": "./tsconfig.json",
  "compilerOptions": {
	"paths": {
      "N": ["node_modules/@hitc/netsuite-types/N"],
      "N/*": ["node_modules/@hitc/netsuite-types/N/*"],
      "SuiteScripts/*": ["../SuiteScripts/*"]
    },
	"outDir": "./src/FileCabinet/SuiteScripts",
  },
  "exclude": [
	"node_modules",
        ... Other files/folders exclude from this build
   ]

then in your package file something like

    "build": "npm run build-scripts && npm run build-test",
    "build-scripts": "tsc -p tsconfig.build.json",
    "build-test": "tsc -p tsconfig.tests.json",

@gabrielgortabns
Copy link
Author

gabrielgortabns commented Feb 13, 2023

yes but the issue is that while source files are in ./src/ files, and build files are in ./build/, I want to be able to execute for example command suitecloud.uploadfile without need to opening ./build/ folder (those are two different folders, but even if, I still can't execute upload in .ts file, bcs it would upload that TS file, not compiled JS version). RN, I must navigate to ./build/ as in ./src/ it throws error:

The file to upload should be in a supported folder inside the FileCabinet folder. For information about the supported folders, see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4724963992.html.

also this doesn't help, as in my case, I also change some other parts of path to file.

@lfpvillegas lfpvillegas added the enhancement New feature or request label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants