Setup NPM with an empty package.json file
Note that, even if we're excluding the `node_modules/` folder from version control, we aren't adding it to Capistrano's shared folders because, when `node_modules` is a symbolic link, NPM removes it when running `npm install`.
This commit is contained in:
@@ -24,6 +24,7 @@ public/tenants/*/sitemap.xml
|
||||
public/assets/
|
||||
public/machine_learning/data/
|
||||
public/tenants/*/machine_learning/data/
|
||||
node_modules/
|
||||
|
||||
# Bundler config, cache and gemsets
|
||||
**/.bundle/
|
||||
|
||||
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@@ -42,7 +42,10 @@ jobs:
|
||||
- name: Setup NPM
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
cache: "npm"
|
||||
node-version-file: ".node-version"
|
||||
- name: Install node packages
|
||||
run: npm clean-install
|
||||
- name: Copy secrets and database files
|
||||
run: for i in config/*.example; do cp "$i" "${i/.example}"; done
|
||||
- name: Setup database
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -26,6 +26,7 @@ tmp/
|
||||
/public/assets/
|
||||
/public/machine_learning/data/
|
||||
/public/tenants/*/machine_learning/data/
|
||||
/node_modules/
|
||||
|
||||
# Bundler config, cache and gemsets
|
||||
.bundle/
|
||||
|
||||
@@ -23,6 +23,7 @@ tests:
|
||||
- bundle --without development
|
||||
- bundle exec rake db:setup
|
||||
- bundle exec rake assets:precompile > /dev/null 2>&1
|
||||
- npm clean-install
|
||||
- bin/knapsack_pro_rspec
|
||||
artifacts:
|
||||
when: on_failure
|
||||
|
||||
@@ -51,6 +51,9 @@ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz
|
||||
COPY Gemfile* ./
|
||||
RUN bundle install
|
||||
|
||||
COPY package* ./
|
||||
RUN npm install
|
||||
|
||||
# Copy the Rails application into place
|
||||
COPY . .
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@ FileUtils.chdir APP_ROOT do
|
||||
system! "gem install bundler --conservative"
|
||||
system("bundle check") || system!("bundle install")
|
||||
|
||||
# Install JavaScript dependencies
|
||||
system!("npm install")
|
||||
|
||||
puts "\n== Copying sample files =="
|
||||
unless File.exist?("config/database.yml")
|
||||
FileUtils.cp "config/database.yml.example", "config/database.yml"
|
||||
|
||||
@@ -117,6 +117,7 @@ module Consul
|
||||
|
||||
config.assets.paths << Rails.root.join("app", "assets", "fonts")
|
||||
config.assets.paths << Rails.root.join("vendor", "assets", "fonts")
|
||||
config.assets.paths << Rails.root.join("node_modules")
|
||||
|
||||
# Add lib to the autoload path
|
||||
config.autoload_paths << Rails.root.join("lib")
|
||||
|
||||
10
package-lock.json
generated
Normal file
10
package-lock.json
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "consuldemocracy",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "consuldemocracy"
|
||||
}
|
||||
}
|
||||
}
|
||||
3
package.json
Normal file
3
package.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "consuldemocracy"
|
||||
}
|
||||
Reference in New Issue
Block a user