diff --git a/.gitignore b/.gitignore index 967078997..7ebf53195 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ .DS_Store node_modules -static/svelte-app.json -scripts/svelte-app credentials.json __sapper__ yarn-error.log .env -.sessions \ No newline at end of file +.sessions diff --git a/package.json b/package.json index b9d943743..19bf46305 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,11 @@ "dev": "sapper dev", "start": "node __sapper__/build", "sapper": "sapper build", - "update_template": "node scripts/update_template.js", "stage": "now", "deploy": "npm run stage && now alias", "predeploy": "git-branch-is master && git diff --exit-code && npm run sapper", "deploy:ci": "now --token $NOW_TOKEN && now alias --token $NOW_TOKEN", - "prestage": "npm run update_template && npm run sapper", + "prestage": "npm run sapper", "predeploy:ci": "npm run prestage", "lint": "eslint src" }, diff --git a/scripts/build-svelte-app-json.js b/scripts/build-svelte-app-json.js deleted file mode 100644 index 59a4b4a07..000000000 --- a/scripts/build-svelte-app-json.js +++ /dev/null @@ -1,11 +0,0 @@ -const fs = require('fs'); - -const files = []; - -for (const path of process.argv.slice(2)) { - if (!path.includes('/.')) { - files.push({ path: path.slice(19), data: fs.readFileSync(path).toString() }); - } -} - -fs.writeFileSync('static/svelte-app.json', JSON.stringify(files)); diff --git a/scripts/update_template.js b/scripts/update_template.js deleted file mode 100644 index e68ada53d..000000000 --- a/scripts/update_template.js +++ /dev/null @@ -1,25 +0,0 @@ -const sh = require('shelljs'); -const fs = require('fs') - -sh.cd(__dirname+'/../') - -// fetch svelte app -sh.rm('-rf','scripts/svelte-app') -sh.exec('npx degit sveltejs/template scripts/svelte-app') - -// update repl-viewer.css based on template -sh.cp('scripts/svelte-app/public/global.css', 'static/repl-viewer.css') - -// remove src (will be recreated client-side) and node_modules -sh.rm('-rf', 'scripts/svelte-app/src') -sh.rm('-rf', 'scripts/svelte-app/node_modules') - -// build svelte-app.json -const appPath = 'scripts/svelte-app' -let files = [] - -for (const path of sh.find(appPath).filter(p => fs.lstatSync(p).isFile()) ) { - files.push({ path: path.slice(appPath.length + 1), data: fs.readFileSync(path).toString() }); -} - -fs.writeFileSync('static/svelte-app.json', JSON.stringify(files)); \ No newline at end of file diff --git a/static/svelte-app.json b/static/svelte-app.json new file mode 100644 index 000000000..fd39bc03f --- /dev/null +++ b/static/svelte-app.json @@ -0,0 +1 @@ +[{"path":".gitignore","data":".DS_Store\nnode_modules\npublic/bundle.*\npackage-lock.json\nyarn.lock"},{"path":"package.json","data":"{\n \"name\": \"svelte-app\",\n \"version\": \"1.0.0\",\n \"devDependencies\": {\n \"npm-run-all\": \"^4.1.3\",\n \"rollup\": \"^0.66.2\",\n \"rollup-plugin-commonjs\": \"^9.1.8\",\n \"rollup-plugin-node-resolve\": \"^3.4.0\",\n \"rollup-plugin-svelte\": \"^4.3.1\",\n \"rollup-plugin-terser\": \"^3.0.0\",\n \"sirv-cli\": \"^0.2.2\",\n \"svelte\": \"^2.13.5\"\n },\n \"scripts\": {\n \"build\": \"rollup -c\",\n \"autobuild\": \"rollup -c -w\",\n \"dev\": \"run-p start:dev autobuild\",\n \"start\": \"sirv public\",\n \"start:dev\": \"sirv public --dev\"\n }\n}\n"},{"path":"public/global.css","data":"html, body {\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\nbody {\n\tcolor: #333;\n\tmargin: 0;\n\tpadding: 8px;\n\tbox-sizing: border-box;\n\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n}\n\na {\n\tcolor: rgb(0,100,200);\n\ttext-decoration: none;\n}\n\na:hover {\n\ttext-decoration: underline;\n}\n\na:visited {\n\tcolor: rgb(0,80,160);\n}\n\nlabel {\n\tdisplay: block;\n}\n\ninput, button, select, textarea {\n\tfont-family: inherit;\n\tfont-size: inherit;\n\tpadding: 0.4em;\n\tmargin: 0 0 0.5em 0;\n\tbox-sizing: border-box;\n\tborder: 1px solid #ccc;\n\tborder-radius: 2px;\n}\n\ninput:disabled {\n\tcolor: #ccc;\n}\n\ninput[type=\"range\"] {\n\theight: 0;\n}\n\nbutton {\n\tbackground-color: #f4f4f4;\n\toutline: none;\n}\n\nbutton:active {\n\tbackground-color: #ddd;\n}\n\nbutton:focus {\n\tborder-color: #666;\n}"},{"path":"public/index.html","data":"\n\n
\n\t\n\t\n\n\t