@silexlabs/silex 3.0.0-alpha.26 → 3.0.0-alpha.28

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.
Files changed (44) hide show
  1. package/.dockerignore +5 -0
  2. package/.editorconfig +14 -0
  3. package/.eslintrc.json +43 -0
  4. package/.github/FUNDING.yml +13 -0
  5. package/.github/workflows/docker-hub-publish.yml +36 -0
  6. package/.github/workflows/npm-publish.yml +19 -0
  7. package/.github/workflows/test.yml +26 -0
  8. package/.nvmrc +1 -0
  9. package/CODE_OF_CONDUCT.md +128 -0
  10. package/CONTRIBUTING.md +108 -0
  11. package/Dockerfile +15 -0
  12. package/directus.silex.js +7 -0
  13. package/dist/client/js/main.js +1 -1
  14. package/dist/server/cli.js +5 -2
  15. package/dist/server/index.js +28 -5
  16. package/jest.config.js +10 -0
  17. package/logos/logo_by_ceubri/silex-icon-2018@200px.png +0 -0
  18. package/logos/logo_by_ceubri/silex-icon-2018@4x.png +0 -0
  19. package/logos/logo_by_ceubri/silex-logo-2018-white-transp.pdf +0 -0
  20. package/logos/logo_by_ceubri/silex-logo-2018-white.jpg +0 -0
  21. package/logos/logo_by_ceubri/silex-logo-2018-white.pdf +0 -0
  22. package/logos/logo_by_ceubri/silex-logo-2018-white.png +0 -0
  23. package/logos/logo_by_ceubri/silex-logo-2018-white@0.5x.png +0 -0
  24. package/logos/logo_by_ceubri/silex-logo-2018-white@0.75x.png +0 -0
  25. package/logos/logo_by_ceubri/silex-logo-2018-white@4x.jpg +0 -0
  26. package/logos/logo_by_ceubri/silex-logo-2018-white@4x.png +0 -0
  27. package/logos/logo_by_ceubri/silex-logo-2018.ai +2520 -6
  28. package/logos/logo_by_ceubri/silex-logo-2018.jpg +0 -0
  29. package/logos/logo_by_ceubri/silex-logo-2018.pdf +0 -0
  30. package/logos/logo_by_ceubri/silex-logo-2018.png +0 -0
  31. package/logos/logo_by_ceubri/silex-logo-2018@0.5x.png +0 -0
  32. package/logos/logo_by_ceubri/silex-logo-2018@0.75x.png +0 -0
  33. package/logos/logo_by_ceubri/silex-logo-2018@4x.jpg +0 -0
  34. package/logos/logo_by_ceubri/silex-logo-2018@4x.png +0 -0
  35. package/logos/silexlabs.png +0 -0
  36. package/package.json +1 -7
  37. package/src/ts/server/cli.ts +4 -2
  38. package/src/ts/server/index.ts +4 -3
  39. package/tsconfig-server-debug.json +20 -0
  40. package/tsconfig-server-release.json +20 -0
  41. package/tsconfig.jest.json +9 -0
  42. package/tsconfig.json +27 -0
  43. package/webpack.config.js +29 -0
  44. package/webpack.debug.config.js +8 -0
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silexlabs/silex",
3
3
  "description": "Free and easy website builder for everyone.",
4
- "version": "3.0.0-alpha.26",
4
+ "version": "3.0.0-alpha.28",
5
5
  "version:backwardcompat": "3.0.0",
6
6
  "author": {
7
7
  "name": "Alex Hoyau",
@@ -11,12 +11,6 @@
11
11
  "bin": {
12
12
  "silex": "./dist/server/cli.js"
13
13
  },
14
- "files": [
15
- "src",
16
- "dist",
17
- "public",
18
- ".silex.js"
19
- ],
20
14
  "license": "GPL-3.0",
21
15
  "engines": {
22
16
  "node": ">=12"
@@ -5,16 +5,18 @@ import { parse } from 'cli'
5
5
  const options = parse({
6
6
  config: [ 'c', 'Path for the server side config file to load at startup', 'file'],
7
7
  port: [ 'p', 'Port to listen to', 'int'],
8
+ debug: [false, 'Debug mode, with live reload, source maps etc.', 'boolean'],
8
9
  'ssl-port': [ false, 'Port to listen to for SSL/HTTPS', 'int'],
9
- 'force-https': [ false, 'Force HTTPS', 'true'],
10
+ 'force-https': [ false, 'Force HTTPS', 'boolean'],
10
11
  'ssl-private-key': [ false, 'Path to private key for SSL', 'file'],
11
12
  'ssl-certificate': [ false, 'Path to SSL certificate', 'file'],
12
- 'force-https-trust-xfp-header': [ false, 'Sets the trustXFPHeader param of the express module "cookie-session". Use only with --force-https', 'true'],
13
+ 'force-https-trust-xfp-header': [ false, 'Sets the trustXFPHeader param of the express module "cookie-session". Use only with --force-https', 'boolean'],
13
14
  'session-secret': ['s', 'Session secret', 'string'],
14
15
  }, {})
15
16
 
16
17
  if(options.config) process.env.CONFIG = options.config
17
18
  if(options.port) process.env.PORT = options.port
19
+ if(options.debug) process.env.SILEX_DEBUG = options.debug
18
20
  if(options['ssl-port']) process.env.SSL_PORT = options['ssl-port']
19
21
  if(options['force-https']) process.env.SILEX_FORCE_HTTPS = options['force-https']
20
22
  if(options['ssl-private-key']) process.env.SILEX_SSL_PRIVATE_KEY = options['ssl-private-key']
@@ -22,9 +22,10 @@ I'm ready, listening to port ${config.port}
22
22
  main()
23
23
 
24
24
  // livereload
25
- import { createServer } from 'livereload'
26
- import { resolve } from 'path'
27
- function startLiverReload() {
25
+ async function startLiverReload() {
26
+ // Load modules only when needed (they may not even be installed)
27
+ const { createServer } = await import('livereload')
28
+ const { resolve } = await import('path')
28
29
  const dist = resolve(__dirname, '../client')
29
30
  const server = createServer({
30
31
  delay: 0,
@@ -0,0 +1,20 @@
1
+ {
2
+ "compileOnSave": true,
3
+ "compilerOptions": {
4
+ "outDir": "dist/server/",
5
+ "target": "esnext",
6
+ "watch": false,
7
+ "inlineSourceMap": true,
8
+ "module": "commonjs",
9
+ "removeComments": false,
10
+ "esModuleInterop": true, /* for import 'Events' in silex-plugins */
11
+ "typeRoots": [
12
+ "src/ts/types",
13
+ "node_modules/@types"
14
+ ]
15
+ },
16
+ "include": [
17
+ "src/ts/server/index.ts",
18
+ "src/ts/server/cli.ts"
19
+ ]
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "compileOnSave": false,
3
+ "compilerOptions": {
4
+ "outDir": "dist/server/",
5
+ "target": "esnext",
6
+ "watch": false,
7
+ "sourceMap": false,
8
+ "module": "commonjs",
9
+ "removeComments": true,
10
+ "esModuleInterop": true, /* for import 'Events' in silex-plugins */
11
+ "typeRoots": [
12
+ "src/ts/types",
13
+ "node_modules/@types"
14
+ ]
15
+ },
16
+ "include": [
17
+ "src/ts/server/index.ts",
18
+ "src/ts/server/cli.ts"
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "dist/client/",
4
+ "target": "ES2019",
5
+ "sourceMap": true,
6
+ "module": "esnext",
7
+ "esModuleInterop": true,
8
+ }
9
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "compileOnSave": true,
3
+ "compilerOptions": {
4
+ "outDir": "dist/client/",
5
+ "target": "ES2022",
6
+ "watch": true,
7
+ "sourceMap": true,
8
+ "module": "esnext",
9
+ "removeComments": false,
10
+ "allowJs": true,
11
+ "typeRoots": [
12
+ "src/ts/types",
13
+ "node_modules/@types"
14
+ ],
15
+ "moduleResolution": "node",
16
+ "esModuleInterop": true
17
+ },
18
+ "include": [
19
+ "src/ts/client/index.ts"
20
+ ],
21
+ "plugins": [
22
+ {
23
+ "name": "ts-lit-plugin",
24
+ "strict": true
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,29 @@
1
+ const path = require('path');
2
+ const webpack = require("webpack")
3
+
4
+ module.exports = {
5
+ entry: './src/ts/client/expose.ts',
6
+ mode: 'production',
7
+ module: {
8
+ rules: [
9
+ {
10
+ test: /\.tsx?$/,
11
+ use: 'ts-loader',
12
+ },
13
+ ]
14
+ },
15
+ resolve: {
16
+ extensions: [ '.tsx', '.ts', '.js' ],
17
+ },
18
+ output: {
19
+ filename: '[name].js',
20
+ path: path.resolve(__dirname, 'dist/client/js'),
21
+ library: 'silex',
22
+ },
23
+ plugins: [
24
+ new webpack.DefinePlugin({
25
+ VERSION: JSON.stringify(require("./package.json").version),
26
+ CONFIG_URL: process.env.CONFIG_URL && JSON.stringify(process.env.CONFIG_URL),
27
+ }),
28
+ ]
29
+ };
@@ -0,0 +1,8 @@
1
+ const prodConfig = require('./webpack.config')
2
+
3
+ module.exports = {
4
+ ...prodConfig,
5
+ //devtool: 'inline-source-map',
6
+ devtool: 'source-map',
7
+ mode: 'development',
8
+ };