Skip to content

Commit

Permalink
Change project name
Browse files Browse the repository at this point in the history
  • Loading branch information
ShestakovViktor committed Apr 1, 2024
1 parent 98b36fd commit ed20628
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 67 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ jobs:
cache: "npm"
- run: npm install
- run: npm run build-editor
- run: npm run build-website
- uses: actions/upload-artifact@master
- run: npm run build-viewer
- uses: actions/configure-pages@main
- uses: actions/upload-pages-artifact@main
with:
name: page
path: build
if-no-files-found: error

deploy:
runs-on: ubuntu-latest
Expand All @@ -39,13 +38,5 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/download-artifact@master
with:
name: page
path: .
- uses: actions/configure-pages@main
- uses: actions/upload-pages-artifact@main
with:
path: .
- id: deployment
uses: actions/deploy-pages@main
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

/build

/public/project.mp
/public/project.mp

/.vscode
34 changes: 0 additions & 34 deletions .vscode/launch.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Mapkin - editor for creating maps
OpenMap
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "mapkin",
"name": "openmap",
"version": "0.0.1",
"description": "",
"scripts": {
"dev": "ts-node node_modules/.bin/webpack-dev-server --config webpack.dev.ts",
"build-editor": "ts-node node_modules/.bin/webpack --config webpack.build.editor.ts",
"build-website": "ts-node node_modules/.bin/webpack --config webpack.build.website.ts",
"build": "npm run build-editor && npm run build-website",
"build-viewer": "ts-node node_modules/.bin/webpack --config webpack.build.viewer.ts",
"build": "npm run build-editor && npm run build-viewer",
"test": "ts-node node_modules/.bin/mocha --require tsconfig-paths/register ./src/**/*.spec.ts"
},
"author": "",
Expand Down Expand Up @@ -47,4 +47,4 @@
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0"
}
}
}
3 changes: 2 additions & 1 deletion public/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<title>OpenMap</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale:1, user-scalable=no" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800" rel="stylesheet" />
Expand All @@ -10,7 +11,7 @@


<body>
<div id="app"></div>
<div id="openmap"></div>
</body>

</html>
10 changes: 5 additions & 5 deletions src/core/Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,25 @@ export class Converter {
const inject = ""
+ `<script defer src="${name}/data.js"></script>`
+ "\n "
+ "<script defer src=\"website.js\"></script>";
+ "<script defer src=\"openmap.js\"></script>";

const website = template.replace("<!--foo-->", inject);
const blob = new Blob([website], {type: "text/html"});

return {["website.html"]: blob};
return {["OpenMap.html"]: blob};
}

private async getBundleBlob(): Promise<Blobs> {
const fileName = "website.js";
const fileName = "viewer.js";
const response = await fetch(fileName);
const viewerBundle = await response.blob();

return {["website.js"]: viewerBundle};
return {["openmap.js"]: viewerBundle};
}

private getDataBlob(data: Data): Blobs {
const dataString = JSON.stringify(data, null, 4);
const dataTemplate = `const qwerty = \`${dataString}\`;`;
const dataTemplate = `const OPEN_MAP_DATA = \`${dataString}\`;`;
const dataBlob = new Blob([dataTemplate], {type: "text/javascript"});

const {value: name} = this.store.config.getByParams({name: "name"})[0];
Expand Down
6 changes: 3 additions & 3 deletions src/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {ViewerProvider} from "@ui/viewer/context";
import {Editor} from "./ui/editor/widget";
import {EditorProvider} from "@ui/editor/context";

const app = document.querySelector("#app");
if (!app) throw new Error("There is no element with \"app\" id");
const container = document.querySelector("#openmap");
if (!container) throw new Error("There is no container element");

const store = new Store();
const core = new Core(store);
Expand All @@ -25,4 +25,4 @@ render(() => {
</EditorProvider>
</ViewerProvider>
);
}, app);
}, container);
2 changes: 1 addition & 1 deletion src/module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ declare module "*.module.scss" {
export default content;
}

declare const qwerty: string = undefined;
declare const OPEN_MAP_DATA: string = undefined;
8 changes: 4 additions & 4 deletions src/website.tsx → src/viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {ViewerProvider} from "@ui/viewer/context";
import {Viewer} from "@src/ui/viewer/widget";
import {Store} from "@core";

const app = document.querySelector("#app");
if (!app) throw new Error("There is no root");
const container = document.querySelector("#openmap");
if (!container) throw new Error("There is no container element");

const data = JSON.parse(qwerty);
const data = JSON.parse(OPEN_MAP_DATA);
const store = new Store(data);

render(() => {
Expand All @@ -19,4 +19,4 @@ render(() => {
<Viewer/>
</ViewerProvider>
);
}, app);
}, container);
2 changes: 1 addition & 1 deletion webpack.build.website.ts → webpack.build.viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import common from "./webpack.config";
export default merge<Configuration>(common, {
mode: "production",
entry: {
website: "./src/website.tsx",
viewer: "./src/viewer.tsx",
},
output: {
filename: "[name].js",
Expand Down

0 comments on commit ed20628

Please sign in to comment.