Skip to content

Commit

Permalink
move javascript code into a src/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jleedev committed Jun 12, 2022
1 parent 5e32b51 commit 40bd8f6
Show file tree
Hide file tree
Showing 35 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _Contributors welcome!_

The repository is organized as follows:

- **style/** - The map style. See [Style Contributor's Guide](style/CONTRIBUTE.md)
- **src/** - The map style. See [CONTRIBUTING.md][].
- **dev/** - Development tools used for style development. See [Style Developer Tools](dev/README.md)
- _Coming soon! Other customized parts of the tech stack._

Expand Down
1 change: 1 addition & 0 deletions doc-img/shield_map_us.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions doc-img/shield_map_world.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"url": "git+https://github.com/zelonewolf/openstreetmap-americana.git"
},
"scripts": {
"config": "cp configs/config.maptiler.js config.js",
"code_format": "npx prettier --write . && npx svgo -f icons/ --config configs/config.svgo.cjs",
"config": "cp src/configs/config.maptiler.js src/config.js",
"code_format": "npx prettier --write . && npx svgo -f icons/ --config src/configs/config.svgo.cjs",
"clean": "rm -rf dist .parcel-cache",
"presprites": "rm -rf dist/sprites",
"sprites": "node scripts/sprites.js",
"status_map": "node scripts/status_map.js",
"taginfo": "node scripts/taginfo.js",
"start": "run-s clean sprites serve",
"serve": "parcel index.html --open --port 1776",
"build:code": "parcel build index.html --public-url ./",
"serve": "parcel src/index.html --open --port 1776",
"build:code": "parcel build src/index.html --public-url ./",
"build": "run-s clean sprites build:code taginfo status_map"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions scripts/status_map.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

import * as fs from "fs";
import * as ShieldDef from "../js/shield_defs.js";
import * as ShieldDef from "../src/js/shield_defs.js";

function fillPaths(svg, codes) {
let selectors = new Set(codes.map((code) => `.${code.toLowerCase()}`));
Expand Down Expand Up @@ -34,7 +34,7 @@ usSVG = usSVG.replace(
/<title>.+?<\/title>/,
"<title>U.S. states with shields supported by OpenStreetMap Americana</title>"
);
fs.writeFileSync(`${process.cwd()}/../doc-img/shield_map_us.svg`, usSVG);
fs.writeFileSync(`${process.cwd()}/doc-img/shield_map_us.svg`, usSVG);

let worldSVG = fs.readFileSync(`${process.cwd()}/scripts/blank_map_world.svg`, {
encoding: "utf8",
Expand All @@ -50,4 +50,4 @@ worldSVG = worldSVG.replace(
/<title>.+?<\/title>/,
"<title>Countries with shields supported by OpenStreetMap Americana</title>"
);
fs.writeFileSync(`${process.cwd()}/../doc-img/shield_map_world.svg`, worldSVG);
fs.writeFileSync(`${process.cwd()}/doc-img/shield_map_world.svg`, worldSVG);
2 changes: 1 addition & 1 deletion scripts/taginfo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

import * as fs from "fs";
import * as ShieldDef from "../js/shield_defs.js";
import * as ShieldDef from "../src/js/shield_defs.js";

/**
* Adds documentation about network=* tags to a project description object, modifying it in place.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 40bd8f6

Please sign in to comment.