apostrophecms / apostrophe-boilerplate Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
docker compose up -d
[apostrophe 4/14] RUN npm ci:
0.588 npm ERR! Cannot read property 'apostrophe' of undefined
0.595
0.595 npm ERR! A complete log of this run can be found in:
0.595 npm ERR! /root/.npm/_logs/2023-08-02T13_37_10_109Z-debug.log
failed to solve: process "/bin/sh -c npm ci" did not complete successfully: exit code: 1
docker-compose
process finished with exit code 17
Using the code from the tutorial to create default.html, a boilerplate page is created. However, the pages is not presented correctly in the browser. The hero and hero-text classes do not seem to be defined.
(http://mapworldlive.com:3000/new-page - a development system when app.js is running)
The developer tools in Firefox report that a style sheet could not be loaded:
/modules/apostrophe-assets/css/vendor/pikaday.less
In searching the software, I find the file is actually in:
./node_modules/apostrophe/lib/modules/apostrophe-assets/public/css/vendor/pikaday.less
Strangely, Chrome developer tools do not report this.
Using site.init
will allow us to access and pass the site
variable to other requires.
I am trying to install build the docker images but this error is raised:
╰─± docker compose build --no-cache
[+] Building 88.5s (17/18)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 773B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/library/node:14 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 5.27kB 0.0s
=> [ 1/14] FROM docker.io/library/node:14 0.0s
=> CACHED [ 2/14] WORKDIR /app 0.0s
=> [ 3/14] COPY package* ./ 0.0s
=> [ 4/14] RUN npm install 34.5s
=> [ 5/14] RUN mkdir scripts 0.7s
=> [ 6/14] RUN npm install -g m 1.5s
=> [ 7/14] RUN apt-get -y update 3.5s
=> [ 8/14] RUN apt-get -y install scons 3.2s
=> [ 9/14] RUN m 3.6 4.2s
=> [10/14] RUN m tools stable 4.3s
=> [11/14] RUN npm install -g pm2 21.1s
=> [12/14] COPY . ./ 0.0s
=> ERROR [13/14] RUN ./scripts/docker-build-assets-with-temporary-mongod 15.4s
------
> [13/14] RUN ./scripts/docker-build-assets-with-temporary-mongod:
#0 0.347 ./scripts/docker-build-assets-with-temporary-mongod: line 5: mongod: command not found
#0 0.356 docker-wait-for-port: waiting 15 seconds for mongo:27017
#0 15.35 docker-wait-for-port: timeout occurred after waiting 15 seconds for mongo:27017
------
failed to solve: executor failed running [/bin/sh -c ./scripts/docker-build-assets-with-temporary-mongod]: exit code: 124
I'm using apostraphecms version 3
.
I followed these steps to create a custom widget - https://v3.docs.apostrophecms.org/guide/custom-widgets.html#creating-a-widget-type
Once the configuration is done I restarted the application and checked in UI, the custom widget is not showing.
My widget folder structure is my-project/modules/two-column-widget
.
//my-project/modules/two-column-widget/index.js
module.exports = {
extend: '@apostrophecms/widget-type',
options: {
label: 'Two Column Widget',
},
fields: {
add: {
columnOne:{
type: 'area',
label: 'Column One',
options:{
widgets:{
'@apostrophecms/rich-text':{}
}
}
},
columnTwo:{
type: 'area',
label: 'Column Two',
options:{
widgets:{
'@apostrophecms/rich-text':{}
}
}
}
}
}
};
//my-project/modules/two-column-widget/views/widget.html
<section data-two-column-widget>
<div class="two-col__column">
{% area data.widget, 'columnOne' %}
</div>
<div class="two-col__column">
{% area data.widget, 'columnTwo' %}
</div>
</section>
require('apostrophe')({
shortName: 'apos-app',
modules: {
'@apostrophecms/rich-text-widget': {
options: {
className: 'bp-rich-text'
}
},
'@apostrophecms/image-widget': {
options: {
className: 'bp-image-widget'
}
},
'@apostrophecms/video-widget': {
options: {
className: 'bp-video-widget'
}
},
'two-column-widget':{},
'product':{},
asset: {},
'default-page': {}
}
});
These are the codes I have configured for custom widgets. While I run the project I don't have any errors though.
console:
apos-app % npm run dev
> [email protected] dev /Projects/apos-app
> nodemon
[nodemon] 2.0.15
[nodemon] reading config ./package.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 56075 to restart
[nodemon] ignoring: ./.git/**/* locales/*.json ./public/uploads/**/* public/apos-frontend/*.js ./data/**/*
[nodemon] watching path(s): app.js modules/**/* lib/**/*.js views/**/*.html
[nodemon] watching extensions: json,js,html,scss,vue
[nodemon] starting `node app.js`
[nodemon] forking
[nodemon] child pid: 56077
[nodemon] watching 28 files
(node:56077) DeprecationWarning: isConnected is deprecated and will be removed in the next major version
(Use `node --trace-deprecation ...` to show where the warning was created)
🧑💻 Building the Public-facing modern JavaScript and Sass...
👍 Public-facing modern JavaScript and Sass is complete!
🧑💻 Building the Raw CSS and JS...
👍 Raw CSS and JS is complete!
Listening at http://localhost:3000
Can anyone please help me to resolve the issue?
During environment setup, the latest Node.js version will be installed.
I was wondering why there is a specific Node version specified in the Dockerfile? Isn't it better to just pull the node
image instead of node:<version>
? No need to constantly update the version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.