Tips for incorporating the "build" directory into the Travis-CI build process and deployment of an npm module

Currently, I am working with a Typescript module that has a directory ./src

And I also have travis-ci set up for the project.

language: node_js
node_js:
- 5.1.0

install:
- npm install
- npm install -g mocha
- npm install -g gulp
- npm install -g tsd

- tsd rate
- tsd install

script: gulp

after_success: npm test

deploy:
  provider: npm
  email: secret
  api_key:
    secure: secret

The Gulp task generates files in the "./build" directory.

The issue arises when it comes to deployment.

# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   build/
#
nothing added to commit but untracked files present (use "git add" to track)

This forces me to locally build the project and then add it to GitHub, rendering the use of travis-ci somewhat unnecessary.

Answer №1

Successfully tackled the issue by following these steps:

1: Include ./build directory in the .gitignore file

build
typings
test/**/*.js
test/**/*.map

2: Establish a .npmignore file to disregard the rules in .gitignore (also added .src directory)

src
test
typings

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The combination of MUI CardContent and flexBox seems to have issues when used in conjunction with typography and chips

Take a look at this React code using MUI. It's designed to create a Card that showcases Character Information. const CharacterPreview = ({ characterKey }: CharacterPreviewProps) => { return ( <Card sx={{ maxWidth: 256, borderRadius: 4 }}&g ...

Angular Material's compatibility update for Angular 8 version

Currently, I'm in the midst of a project that relies on Angular v 8.2.14, and I'm interested in incorporating Angular Material controls into it. I've made an effort to integrate Angular Material into my project, however, the default version ...

Route protection is ineffective when dealing with two observables simultaneously

After writing the route guard as shown below, I encountered an issue with the else statement that was not returning a result, even though it should have. Surprisingly, there were no errors either. this.hotelSettingsService.get().pipe(map(res => { ...

setting up React package with npm installation

Currently, I am transitioning to react from pure front end development involving HTML, CSS, and a bit of jquery. As such, I have no prior experience with package installation. My intention was to install axios using npm. I initiated the process by running ...

Error: JSON unexpected token ' at position 2 - Solution for fixing this issue

Encountering a recurring JSON error where the user input from a textbox is being passed in JSON for assigning class level permissions in a parse server. var cc = "role:" + user; var jsonParam = "{ 'classLevelPermissions' : { ...

Ways to resolve the "localtunnel error: tunnel server offline - Request failed with status code 502" issue

As I work on setting up a microservice, everything functions perfectly on localhost. Wanting to extend its accessibility to other computers, I decided to utilize npm's localtunnel. Initially, it was successful for two consecutive days until I encounte ...

NodeJS is throwing a SyntaxError indicating an unexpected token ILLEGAL

After setting up an Ubuntu instance on my university server, I went ahead and installed NodeJS and NPM. With a FTP connection, I was able to send files to the instance. I uploaded the following NodeJS webserver file to my instance and attempted to run it ...

Retrieve the selected checkboxes from the latest .change() trigger

I'm facing an issue with a basic question that I can't seem to find the right terms to research for help. The problem revolves around a .change() listener that monitors checkbox changes within a div (used to toggle Leaflet Map layers). My goal i ...

Mastering the Art of Disabling buttons in Vue Based on Conditions

In my current project, I'm attempting to compare specific values of an initial object with an updated object in order to disable a button if they are the same. However, despite making changes, the button remains disabled: setDisabled() { return th ...

I followed the step to download Angular using NPM Install

When attempting to work on a repository that uses Angular without having it installed on my machine, I ran npm i. However, Angular was not automatically installed. So, I had to separately install the Angular CLI before running ng serve --open ...

AngularJS: Setting up filter asynchronously

I'm facing a challenge when trying to set up a filter that requires asynchronous data. The filter's purpose is simple - it needs to convert paths to names, but this task involves a mapping array that must be fetched from the server. While I cou ...

Working with Scala PlayFramework and Angular JS can be overwhelming due to the amount of duplication and confusion that arises from mixing different concepts

Attempting to build an application using the combination of playframework, scala, and Angular JS, I aimed to create a web app that functioned seamlessly whether JavaScript was enabled or disabled in the browser. This requirement is common when developing a ...

Error alert: The variable __webpack_dev_server_client__ has not been defined

When executing our build artifact stored in S3 through CloudFront, we encounter the error Uncaught ReferenceError: __webpack_dev_server_client__ is not defined. Interestingly, this error does not occur when running the script locally. Our script is bui ...

Can a variable be assigned based on the current route being accessed?

Currently, I am using a sidenav component with the following structure: <MenuItems> <NavLink to="/contacts/new">New</NavLink> <NavLink to="/contacts/list">New (all)</NavLink> <NavLink to="/con ...

What is the best way to assign attributes to multiple HTML elements using an array?

Seeking assistance to hide various sections in my HTML file upon button click, with the exception of one specific section. Encountered an error message: Uncaught TypeError: arr[i].setAttribute is not a function Here's a snippet of my code: const hide ...

Changing the map behavior when it is moved in Leaflet

I am currently using Leaflet to design a map that includes a personalized sound layer. Each tile on the map features an <audio> element, and I am exploring methods to adjust the audio playback as the user navigates around the map (specifically by mod ...

What is the appropriate method to utilize the scrollable feature in Tab View?

Currently, I am incorporating p-tabview and trying to enable the scrollable property as indicated on the primeng website: https://www.primefaces.org/primeng/showcase/#/tabview However, an error is showing up that says Can't bind to 'scrollable&a ...

TypeScript typings for generic currying functions

I'm struggling to improve my skills in functional programming, particularly when dealing with typing generic "curry" functions. One example is a "Curry" version of the reduce function that I've written: const reduce = <S, R>(fn: (result: R ...

The Express.io platform is having trouble loading the JavaScript file

Currently, I have an operational Express.io server up and running. However, I am encountering issues with the proper loading of my Javascript files. Here is a snippet from my Jade file: html head h1 Test index body script(src="/so ...

Find out the keycode of an event in ReactJS when a key is released

Whenever I try to get keyCode on a keyUp event, it always returns 0. Why is this happening? I want to avoid using keypress and similar methods, and I also need to utilize an arrow function: handleKeyPress = (e, type) => { let KeyCode = e.charCode; ...