@haxtheweb/create 0.0.5 → 0.1.2
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/README.md +22 -1
- package/dist/{index.js → create.js} +68 -42
- package/dist/templates/haxsite/default/.htaccess +79 -0
- package/dist/templates/haxsite/default/.nojekyll +0 -0
- package/dist/templates/haxsite/default/404.html +43 -0
- package/dist/templates/haxsite/default/CNAME +0 -0
- package/dist/templates/haxsite/default/Dockerfile +15 -0
- package/dist/templates/haxsite/default/LICENSE.md +201 -0
- package/dist/templates/haxsite/default/README.md +38 -0
- package/dist/templates/haxsite/default/adlcp_rootv1p2.xsd +110 -0
- package/dist/templates/haxsite/default/assets/banner.jpg +0 -0
- package/dist/templates/haxsite/default/assets/build-legacy.js +1 -0
- package/dist/templates/haxsite/default/assets/build-polyfills.js +1 -0
- package/dist/templates/haxsite/default/assets/favicon.ico +0 -0
- package/dist/templates/haxsite/default/assets/favicon.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-144x144.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-192x192.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-256x256.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-48x48.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-512x512.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-72x72.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-96x96.png +0 -0
- package/dist/templates/haxsite/default/assets/legacy-outline.css +25 -0
- package/dist/templates/haxsite/default/assets/upgrade-browser.html +136 -0
- package/dist/templates/haxsite/default/browserconfig.xml +11 -0
- package/dist/templates/haxsite/default/build-haxcms.js +123 -0
- package/dist/templates/haxsite/default/build.js +1 -0
- package/dist/templates/haxsite/default/custom/Dockerfile +15 -0
- package/dist/templates/haxsite/default/custom/README.md +20 -0
- package/dist/templates/haxsite/default/custom/package.json +27 -0
- package/dist/templates/haxsite/default/custom/rollup.config.js +20 -0
- package/dist/templates/haxsite/default/custom/src/custom.js +8 -0
- package/dist/templates/haxsite/default/false +0 -0
- package/dist/templates/haxsite/default/files/.gitkeep +0 -0
- package/dist/templates/haxsite/default/ims_xml.xsd +1 -0
- package/dist/templates/haxsite/default/imscp_rootv1p1p2.xsd +345 -0
- package/dist/templates/haxsite/default/imsmanifest.xml +57 -0
- package/dist/templates/haxsite/default/imsmd_rootv1p2p1.xsd +573 -0
- package/dist/templates/haxsite/default/index.html +211 -0
- package/dist/templates/haxsite/default/index.php +166 -0
- package/dist/templates/haxsite/default/manifest.json +65 -0
- package/dist/templates/haxsite/default/offline.html +11 -0
- package/dist/templates/haxsite/default/package.json +38 -0
- package/dist/templates/haxsite/default/pages/.gitkeep +0 -0
- package/dist/templates/haxsite/default/polymer.json +126 -0
- package/dist/templates/haxsite/default/push-manifest.json +8 -0
- package/dist/templates/haxsite/default/robots.txt +27 -0
- package/dist/templates/haxsite/default/service-worker.js +283 -0
- package/dist/templates/haxsite/default/site.json +39 -0
- package/dist/templates/haxsite/default/theme/theme.css +13 -0
- package/dist/templates/haxsite/default/theme/theme.html +46 -0
- package/dist/templates/haxsite/default/web-dev-server.haxcms.config.cjs +10 -0
- package/dist/templates/webcomponent/hax/package.json +1 -1
- package/dist/templates/webcomponent/hax/src/webcomponent.js +1 -1
- package/package.json +61 -59
- package/dist/templates/haxcms/course/package.json +0 -6
- package/dist/templates/theme/default/package.json +0 -6
package/README.md
CHANGED
|
@@ -5,11 +5,32 @@ Rapidly build web components for the Web that work with HAX. HAX The Web's CLI t
|
|
|
5
5
|
## Future state
|
|
6
6
|
- Create new HAX sites and administer them from the CLI
|
|
7
7
|
- Create new themes for HAXcms
|
|
8
|
+
- Interface w/ docs / AI agent on website
|
|
8
9
|
|
|
9
10
|
# Usage
|
|
10
11
|
|
|
11
12
|
```bash
|
|
13
|
+
npx @haxtheweb/create
|
|
14
|
+
#or
|
|
12
15
|
npm init @haxtheweb
|
|
13
16
|
```
|
|
14
17
|
|
|
15
|
-
Follow the prompts and let's HAX the Web together!
|
|
18
|
+
Follow the prompts and let's HAX the Web together!
|
|
19
|
+
|
|
20
|
+
## Web component
|
|
21
|
+
|
|
22
|
+
Step through answering basic install questions to build a HAX capable web component that works anywhere! Features:
|
|
23
|
+
- LitElement based
|
|
24
|
+
- DDDSuper class which adds our design system in
|
|
25
|
+
- Common conventions used to demonstrate and work with property binding
|
|
26
|
+
- Minor CSS variable inclusion for initial learning
|
|
27
|
+
|
|
28
|
+
## HAX Site
|
|
29
|
+
|
|
30
|
+
Build a HAX site that can be published and transported anywhere. Your users might love it on the front end, now you get the simplicity of building on the CLI.
|
|
31
|
+
- Same HAX sites you can create via front end
|
|
32
|
+
- Templated files that work just like any HAX site
|
|
33
|
+
- End points baked in to do CLI commands for common endpoint operations like adding pages, deleting and editing.
|
|
34
|
+
- Ability to import via URL just like the front-end
|
|
35
|
+
- Theme development starting point to be able to build themes locally
|
|
36
|
+
- Primed to publish to gh-pages, vercel and more
|
|
@@ -17,24 +17,24 @@ async function main() {
|
|
|
17
17
|
// should be able to grab author off the git config in most instances
|
|
18
18
|
let value = await exec(`git config user.name`);
|
|
19
19
|
let author = value.stdout.trim();
|
|
20
|
+
// delay so that we clear and then let them visually react to change
|
|
20
21
|
await (0, _promises.setTimeout)(500);
|
|
21
|
-
|
|
22
|
+
// intro text
|
|
23
|
+
p.intro(`${_picocolors.default.bgBlue(_picocolors.default.white(` HAXTheWeb CLI `))}`);
|
|
24
|
+
p.intro(`${_picocolors.default.bgMagenta(_picocolors.default.white(` Let's create a bright future `))}`);
|
|
22
25
|
const project = await p.group({
|
|
23
26
|
type: ({
|
|
24
27
|
results
|
|
25
28
|
}) => p.select({
|
|
26
29
|
message: `What type of project are you building`,
|
|
27
30
|
initialValue: 'webcomponent',
|
|
28
|
-
maxItems:
|
|
31
|
+
maxItems: 2,
|
|
29
32
|
options: [{
|
|
30
33
|
value: 'webcomponent',
|
|
31
34
|
label: 'Web component'
|
|
32
35
|
}, {
|
|
33
|
-
value: '
|
|
36
|
+
value: 'haxsite',
|
|
34
37
|
label: "HAX Site"
|
|
35
|
-
}, {
|
|
36
|
-
value: 'theme',
|
|
37
|
-
label: "HAX Theme"
|
|
38
38
|
}]
|
|
39
39
|
}),
|
|
40
40
|
typeOption: ({
|
|
@@ -48,26 +48,15 @@ async function main() {
|
|
|
48
48
|
maxItems: 1,
|
|
49
49
|
options: [{
|
|
50
50
|
value: 'hax',
|
|
51
|
-
label: "HAX
|
|
51
|
+
label: "HAX default"
|
|
52
52
|
}]
|
|
53
53
|
});
|
|
54
54
|
break;
|
|
55
|
-
case "
|
|
55
|
+
case "haxsite":
|
|
56
56
|
return p.select({
|
|
57
57
|
message: `What kind of site is it`,
|
|
58
|
-
initialValue: '
|
|
59
|
-
maxItems:
|
|
60
|
-
options: [{
|
|
61
|
-
value: 'course',
|
|
62
|
-
label: "Course"
|
|
63
|
-
}]
|
|
64
|
-
});
|
|
65
|
-
break;
|
|
66
|
-
case "theme":
|
|
67
|
-
return p.select({
|
|
68
|
-
message: `Theme base`,
|
|
69
|
-
initialValue: 'course',
|
|
70
|
-
maxItems: 2,
|
|
58
|
+
initialValue: 'default',
|
|
59
|
+
maxItems: 1,
|
|
71
60
|
options: [{
|
|
72
61
|
value: 'default',
|
|
73
62
|
label: "Default"
|
|
@@ -80,14 +69,17 @@ async function main() {
|
|
|
80
69
|
results
|
|
81
70
|
}) => {
|
|
82
71
|
return p.text({
|
|
83
|
-
message: '
|
|
84
|
-
|
|
72
|
+
message: 'Project name:',
|
|
73
|
+
placeholder: results.type === "webcomponent" ? "my-element" : "mysite",
|
|
85
74
|
validate: value => {
|
|
75
|
+
if (!value) {
|
|
76
|
+
return "Name is required";
|
|
77
|
+
}
|
|
86
78
|
if (value.indexOf(' ') !== -1) {
|
|
87
79
|
return "No spaces allowed in project name";
|
|
88
80
|
}
|
|
89
|
-
if (value.indexOf('-') === -1) {
|
|
90
|
-
return "Name must include at least one `-`";
|
|
81
|
+
if (results.type === "webcomponent" && value.indexOf('-') === -1 && value.indexOf('-') !== 0 && value.indexOf('-') !== value.length - 1) {
|
|
82
|
+
return "Name must include at least one `-` and must not start or end name.";
|
|
91
83
|
}
|
|
92
84
|
}
|
|
93
85
|
});
|
|
@@ -108,7 +100,15 @@ async function main() {
|
|
|
108
100
|
message: 'Author:',
|
|
109
101
|
initialValue: author
|
|
110
102
|
});
|
|
111
|
-
}
|
|
103
|
+
},
|
|
104
|
+
install: () => p.confirm({
|
|
105
|
+
message: 'Install dependencies? (npm)',
|
|
106
|
+
initialValue: true
|
|
107
|
+
}),
|
|
108
|
+
git: () => p.confirm({
|
|
109
|
+
message: 'Put in version control? (git)',
|
|
110
|
+
initialValue: true
|
|
111
|
+
})
|
|
112
112
|
}, {
|
|
113
113
|
onCancel: () => {
|
|
114
114
|
p.cancel('Operation cancelled.');
|
|
@@ -116,36 +116,56 @@ async function main() {
|
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
if (project.path) {
|
|
119
|
+
// values not set but important for templating
|
|
119
120
|
project.className = dashToCamel(project.name);
|
|
121
|
+
project.version = "9.0.0-alpha.0";
|
|
122
|
+
project.id = generateUUID();
|
|
123
|
+
project.timestamp = Date.now();
|
|
124
|
+
project.hexCode = "#009dc7";
|
|
125
|
+
// icons
|
|
126
|
+
["48x48", "72x72", "96x96", "144x144", "192x192", "256x256", "512x512"].map(size => project[`logo${size}`] = `assets/icon-${size}`);
|
|
127
|
+
console.log(project);
|
|
120
128
|
let s = p.spinner();
|
|
121
129
|
s.start('Copying files');
|
|
122
130
|
await (0, _promises.setTimeout)(250);
|
|
123
|
-
await exec(`cp -R ${
|
|
131
|
+
await exec(`cp -R ${process.mainModule.path}/templates/${project.type}/${project.typeOption}/ ${project.path}`);
|
|
124
132
|
// rename paths that are of the element name in question
|
|
125
133
|
await exec(`mv ${project.path}/src/webcomponent.js ${project.path}/src/${project.name}.js`);
|
|
126
134
|
await exec(`mv ${project.path}/lib/webcomponent.haxProperties.json ${project.path}/lib/${project.name}.haxProperties.json`);
|
|
127
135
|
s.stop('Files copied');
|
|
128
136
|
await (0, _promises.setTimeout)(250);
|
|
129
137
|
s.start('Making files awesome');
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
138
|
+
for (const filePath of readAllFiles(project.path)) {
|
|
139
|
+
try {
|
|
140
|
+
if (!filePath.endsWith('.jpg') && !filePath.endsWith('.png')) {
|
|
141
|
+
const ejsString = ejs.fileLoader(filePath, 'utf8');
|
|
142
|
+
let content = ejs.render(ejsString, project);
|
|
143
|
+
fs.writeFileSync(filePath, content);
|
|
144
|
+
// file written successfully
|
|
145
|
+
}
|
|
146
|
+
} catch (err) {
|
|
147
|
+
console.error(filePath);
|
|
148
|
+
console.error(err);
|
|
135
149
|
}
|
|
136
|
-
// file written successfully
|
|
137
|
-
} catch (err) {
|
|
138
|
-
console.error(err);
|
|
139
150
|
}
|
|
140
151
|
s.stop('Files are now awesome!');
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
if (project.install) {
|
|
153
|
+
await (0, _promises.setTimeout)(250);
|
|
154
|
+
s.start(`Let's install everything using the magic of npm`);
|
|
155
|
+
await (0, _promises.setTimeout)(250);
|
|
156
|
+
await exec(`cd ${project.path} && npm install`);
|
|
157
|
+
await (0, _promises.setTimeout)(250);
|
|
158
|
+
s.stop(`Everything is installed. It's go time`);
|
|
159
|
+
}
|
|
160
|
+
if (project.git) {
|
|
161
|
+
project.gitRepo = await p.text({
|
|
162
|
+
message: 'Git Repo location:',
|
|
163
|
+
placeholder: `git@github.com:${project.author}/${project.name}.git`
|
|
164
|
+
});
|
|
165
|
+
await exec(`cd ${project.path} && git init && git add -A && git commit -m "first commit" && git branch -M main${project.gitRepo != '' ? ` && git remote add origin ${project.gitRepo}` : ''}`);
|
|
166
|
+
}
|
|
147
167
|
}
|
|
148
|
-
let nextSteps = `cd ${project.path} \
|
|
168
|
+
let nextSteps = `cd ${project.path} \n${project.install ? '' : 'npm install\n'} npm start`;
|
|
149
169
|
p.note(nextSteps, `${project.name} is ready to go. To start development:`);
|
|
150
170
|
p.outro(`Welcome to the revolution. Ideas to HAX faster? ${_picocolors.default.underline(_picocolors.default.cyan('https://github.com/haxtheweb/issues'))}`);
|
|
151
171
|
}
|
|
@@ -171,4 +191,10 @@ function* readAllFiles(dir) {
|
|
|
171
191
|
yield path.join(dir, file.name);
|
|
172
192
|
}
|
|
173
193
|
}
|
|
194
|
+
}
|
|
195
|
+
function generateUUID() {
|
|
196
|
+
return "ss-s-s-s-sss".replace(/s/g, _uuidPart);
|
|
197
|
+
}
|
|
198
|
+
function _uuidPart() {
|
|
199
|
+
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
174
200
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Protect files and directories from prying eyes.
|
|
2
|
+
<FilesMatch "\.(make|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
|
|
3
|
+
<IfModule mod_authz_core.c>
|
|
4
|
+
Require all denied
|
|
5
|
+
</IfModule>
|
|
6
|
+
<IfModule !mod_authz_core.c>
|
|
7
|
+
Order allow,deny
|
|
8
|
+
</IfModule>
|
|
9
|
+
</FilesMatch>
|
|
10
|
+
# Don't show directory listings for URLs which map to a directory.
|
|
11
|
+
Options -Indexes
|
|
12
|
+
# Follow symbolic links in this directory.
|
|
13
|
+
Options +FollowSymLinks
|
|
14
|
+
# Set the default handler.
|
|
15
|
+
DirectoryIndex index.php index.html
|
|
16
|
+
# Override PHP settings that cannot be changed at runtime. See
|
|
17
|
+
<IfModule mod_php5.c>
|
|
18
|
+
php_flag magic_quotes_gpc off
|
|
19
|
+
php_flag magic_quotes_sybase off
|
|
20
|
+
php_flag register_globals off
|
|
21
|
+
php_flag session.auto_start off
|
|
22
|
+
php_value mbstring.http_input pass
|
|
23
|
+
php_value mbstring.http_output pass
|
|
24
|
+
php_flag mbstring.encoding_translation off
|
|
25
|
+
</IfModule>
|
|
26
|
+
# Requires mod_expires to be enabled.
|
|
27
|
+
<IfModule mod_expires.c>
|
|
28
|
+
# Enable expirations.
|
|
29
|
+
ExpiresActive On
|
|
30
|
+
# Cache all files for 2 weeks after access (A).
|
|
31
|
+
ExpiresDefault A1209600
|
|
32
|
+
<FilesMatch \.php$>
|
|
33
|
+
ExpiresActive Off
|
|
34
|
+
</FilesMatch>
|
|
35
|
+
</IfModule>
|
|
36
|
+
# Various rewrite rules.
|
|
37
|
+
<IfModule mod_rewrite.c>
|
|
38
|
+
RewriteEngine on
|
|
39
|
+
# Set "protossl" to "s" if we were accessed via https://. This is used later
|
|
40
|
+
# if you enable "www." stripping or enforcement, in order to ensure that
|
|
41
|
+
# you don't bounce between http and https.
|
|
42
|
+
RewriteRule ^ - [E=protossl]
|
|
43
|
+
RewriteCond %{HTTPS} on
|
|
44
|
+
RewriteRule ^ - [E=protossl:s]
|
|
45
|
+
# Make sure Authorization HTTP header is available to PHP
|
|
46
|
+
# even when running as CGI or FastCGI.
|
|
47
|
+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
48
|
+
# Pass all requests not referring directly to files in the filesystem to
|
|
49
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
50
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
51
|
+
RewriteRule ^ . [L]
|
|
52
|
+
|
|
53
|
+
# Rules to correctly serve gzip compressed CSS and JS files.
|
|
54
|
+
# Requires both mod_rewrite and mod_headers to be enabled.
|
|
55
|
+
<IfModule mod_headers.c>
|
|
56
|
+
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
|
|
57
|
+
RewriteCond %{HTTP:Accept-encoding} gzip
|
|
58
|
+
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
|
59
|
+
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
|
|
60
|
+
# Serve gzip compressed JS files if they exist and the client accepts gzip.
|
|
61
|
+
RewriteCond %{HTTP:Accept-encoding} gzip
|
|
62
|
+
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
|
63
|
+
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
|
|
64
|
+
# Serve correct content types, and prevent mod_deflate double gzip.
|
|
65
|
+
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
|
|
66
|
+
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
|
|
67
|
+
<FilesMatch "(\.js\.gz|\.css\.gz)$">
|
|
68
|
+
# Serve correct encoding type.
|
|
69
|
+
Header set Content-Encoding gzip
|
|
70
|
+
# Force proxies to cache gzipped & non-gzipped css/js files separately.
|
|
71
|
+
Header append Vary Accept-Encoding
|
|
72
|
+
</FilesMatch>
|
|
73
|
+
</IfModule>
|
|
74
|
+
</IfModule>
|
|
75
|
+
# Add headers to all responses.
|
|
76
|
+
<IfModule mod_headers.c>
|
|
77
|
+
# Disable content sniffing, since it's an attack vector.
|
|
78
|
+
Header always set X-Content-Type-Options nosniff
|
|
79
|
+
</IfModule>
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Single Page Apps for GitHub Pages</title>
|
|
6
|
+
<script type="text/javascript">
|
|
7
|
+
// Single Page Apps for GitHub Pages
|
|
8
|
+
// https://github.com/rafrex/spa-github-pages
|
|
9
|
+
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
|
|
10
|
+
// ----------------------------------------------------------------------
|
|
11
|
+
// This script takes the current url and converts the path and query
|
|
12
|
+
// string into just a query string, and then redirects the browser
|
|
13
|
+
// to the new url with only a query string and hash fragment,
|
|
14
|
+
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
|
|
15
|
+
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
|
|
16
|
+
// Note: this 404.html file must be at least 512 bytes for it to work
|
|
17
|
+
// with Internet Explorer (it is currently > 512 bytes)
|
|
18
|
+
|
|
19
|
+
// If you're creating a Project Pages site and NOT using a custom domain,
|
|
20
|
+
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
|
|
21
|
+
// This way the code will only replace the route part of the path, and not
|
|
22
|
+
// the real directory in which the app resides, for example:
|
|
23
|
+
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
|
|
24
|
+
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
|
|
25
|
+
// Otherwise, leave segmentCount as 0.
|
|
26
|
+
var segmentCount = 0;
|
|
27
|
+
if (window.location.host.indexOf('github.io') != -1 && window.location.pathname.split('/').length > 1) {
|
|
28
|
+
segmentCount = 1;
|
|
29
|
+
}
|
|
30
|
+
var l = window.location;
|
|
31
|
+
l.replace(
|
|
32
|
+
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
|
|
33
|
+
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
|
|
34
|
+
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
|
|
35
|
+
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
|
|
36
|
+
l.hash
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
</script>
|
|
40
|
+
</head>
|
|
41
|
+
<body>
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
FROM haxtheweb/haxcms:2.0.9 as haxcms
|
|
2
|
+
|
|
3
|
+
FROM php:7.3-apache
|
|
4
|
+
|
|
5
|
+
RUN a2enmod rewrite
|
|
6
|
+
COPY ./services/haxcms/apache2.conf /etc/apache2/apache2.conf
|
|
7
|
+
|
|
8
|
+
COPY . /var/www/html
|
|
9
|
+
COPY --from=haxcms /var/www/html/build /var/www/html/build
|
|
10
|
+
COPY --from=haxcms /var/www/html/dist /var/www/html/dist
|
|
11
|
+
COPY --from=haxcms /var/www/html/system /var/www/html/system
|
|
12
|
+
COPY --from=haxcms /var/www/html/assets/babel-top.js /var/www/html/assets/babel-top.js
|
|
13
|
+
COPY --from=haxcms /var/www/html/assets/babel-bottom.js /var/www/html/assets/babel-bottom.js
|
|
14
|
+
COPY --from=haxcms /var/www/html/wc-registry.json /var/www/html/wc-registry.json
|
|
15
|
+
RUN chown -R www-data:www-data /var/www/html
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2018 The Pennsylvania State University
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# HAXsite
|
|
2
|
+
This is a HAXcms generated and managed micro-site. It can run on it's own but it was generated by a HAXcms system somewhere.
|
|
3
|
+
|
|
4
|
+
## Developer mode
|
|
5
|
+
HAXcms primary audience is people doing things entirely through the UI. It is however creating everything in a way that's very developer friendly though. This means you can peal this off from the original place it came from and run this as a stand alone repo by:
|
|
6
|
+
|
|
7
|
+
- leveraging the included package.json
|
|
8
|
+
- removing the symlinks to dist / node_modules / build
|
|
9
|
+
- copying the dist directory from the project root into your local setup: https://github.com/haxtheweb/haxcms/tree/master/dist
|
|
10
|
+
|
|
11
|
+
Using this approach you'll have to manage dependencies on your own but you'll be able to utilize custom themes / elements that you can to show up. If you do add any new elements or themes you'll need to ship this repo with the `polymer build` command executed in order to bundle / compile everything together for usage.
|
|
12
|
+
|
|
13
|
+
### special note
|
|
14
|
+
The CDN mirrors for HAXcms may or may not include the elements you wish to extend your project with so those options for rapid distributed publishing may not be availble.
|
|
15
|
+
|
|
16
|
+
# HAXcms
|
|
17
|
+
HAX CMS seeks to be the smallest possible back-end CMS to make HAX work and be able to build websites with it. Leveraging JSON Outline Schema, HAX is able to author multiple pages, which it then writes onto the file system.
|
|
18
|
+
|
|
19
|
+
# Customization capabilities as a developer
|
|
20
|
+
|
|
21
|
+
## Want to customize the theme via global CSS
|
|
22
|
+
- make changes to `theme/theme.css`
|
|
23
|
+
- This CSS loads on initial system load and CSS variables / ::part selectors can help override values
|
|
24
|
+
|
|
25
|
+
## Want to customize the JS that's run globally?
|
|
26
|
+
- make changes to `custom/build/custom.es6.js`
|
|
27
|
+
- This can also be modified as part of a built in build routine layed out in `custom/build`
|
|
28
|
+
- Assets can be built using the yarn / rollup routine that's included or manually writing JS into the files
|
|
29
|
+
|
|
30
|
+
Global JS could be used to load tracking code or inject your own custom element definitions so you can add your own web components in.
|
|
31
|
+
|
|
32
|
+
This can also be used to make a custom theme (modifying details in site.json to point to your theme element can make it load then)
|
|
33
|
+
|
|
34
|
+
## Need to customize something else?
|
|
35
|
+
https://github.com/elmsln/issues/issues or join the community on discord https://bit.ly/hax-discord and ask!
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
[Apache 2.0](LICENSE.md)
|