nails-boilerplate 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/lib/init.js CHANGED
@@ -50,7 +50,8 @@ function createApp( name ) {
50
50
  fs.closeSync(fd);
51
51
 
52
52
  copySync(path.resolve(templateRoot, './server'), name + '/server');
53
- copySync(path.resolve(templateRoot, './client'), name + '/client');
53
+ copySync(path.resolve(templateRoot, './src'), name + '/src');
54
+ copySync(path.resolve(templateRoot, './public'), name + '/public');
54
55
  copySync(path.resolve(templateRoot, './config'), name + '/config');
55
56
  copySync(path.resolve(templateRoot, './common'), name + '/common');
56
57
  copySync(path.resolve(templateRoot, './spec'), name + '/spec');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nails-boilerplate",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A node.js webserver scaffold",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,4 +1,4 @@
1
1
  export async function fetchReadme() {
2
- return fetch('/client/README.xml')
2
+ return fetch('/public/README.xml')
3
3
  .then(response => response.text());
4
4
  }
@@ -21,7 +21,7 @@ export default [
21
21
  // Routes the root request to index.html, as well as all other requests to static
22
22
  ['get', "/", {controller: 'home'}],
23
23
  // Routes all requests starting with /public as static requests to the public folder.
24
- ['get', '/client', {public: true}],
24
+ ['get', '/public', {public: true}],
25
25
  // A test route which routes the first part of pathname to controller and the second to the action
26
26
  ['get', /^\/(\w+)\/(\w+)$/i, {0: 'controller', 1: 'action'}],
27
27
  // Maps the first two parts of the path to controller and action, and the third to the id parameter
@@ -16,7 +16,7 @@ const CERTIFICATE_FILE = fs.readFileSync(`${import.meta.dirname}/ssl/certificate
16
16
  var config = {
17
17
  APP_ROOT: APP_ROOT,
18
18
  // root directory for delivering static assets
19
- PUBLIC_ROOT: SERVER_ROOT + '/client',
19
+ PUBLIC_ROOT: SERVER_ROOT + '/public',
20
20
  CONTROLLERS_ROOT: APP_ROOT + '/controllers',
21
21
  VIEWS_ROOT: APP_ROOT + '/views',
22
22
  //MODELS_ROOT: APP_ROOT + '/models',
@@ -23,7 +23,7 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "nails-boilerplate": ">=0.1.0",
26
+ "nails-boilerplate": ">=1.1.0",
27
27
  "vite": "^6.3.5",
28
28
  "@vitejs/plugin-legacy": "^6.1.1",
29
29
  "@vitejs/plugin-react": "^4.7.0",
@@ -1 +1 @@
1
- <script src="/client/js/client.js"></script>
1
+ <script src="/public/js/client.js"></script>
@@ -1 +1 @@
1
- <script src="/client/dist/nails-react-app.js" type="module"></script>
1
+ <script src="/public/dist/nails-react-app.js" type="module"></script>
@@ -1,2 +1,3 @@
1
- <link rel='shortcut icon' href='/client/favicon.ico' type='image/x-icon' />
2
- <link rel="stylesheet" href="/client/dist/nails-react-app.css" />
1
+ <link rel='shortcut icon' href='/public/favicon.ico' type='image/x-icon' />
2
+ <link rel="stylesheet" href="/public/css/styles.css" />
3
+ <link rel="stylesheet" href="/public/dist/nails-react-app.css" />
@@ -7,7 +7,7 @@ import Home from './HomePage';
7
7
  import About from './AboutPage';
8
8
  import Readme from './ReadmePage';
9
9
 
10
- import '../css/styles.css';
10
+ import './styles/appstyles.css';
11
11
 
12
12
  function App() {
13
13
  console.log("rendering app");
@@ -0,0 +1,3 @@
1
+ body {
2
+ background-color: aliceblue;
3
+ }
@@ -20,11 +20,11 @@ export default defineConfig({
20
20
  },
21
21
  build: {
22
22
  lib: {
23
- entry: 'client/src/app.jsx', // Your library's main entry file
23
+ entry: './src/app.jsx', // Your library's main entry file
24
24
  name: 'NailsReactApp',
25
25
  fileName: 'nails-react-app',
26
26
  },
27
- outDir: 'client/dist',
27
+ outDir: './public/dist',
28
28
  },
29
29
  esbuild: {
30
30
  minifyIdentifiers: false,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes