Skip to content

Commit 84c6d4a

Browse files
committed
migrate to skpm & typescript
get settings panel to work
0 parents  commit 84c6d4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+11463
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# build artifacts
2+
Sketch-Meaxure.sketchplugin
3+
4+
# npm
5+
node_modules
6+
.npm
7+
npm-debug.log
8+
9+
# mac
10+
.DS_Store
11+
12+
# WebStorm
13+
.idea
14+
15+
# sketch
16+
# sketch-assets

README.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Sketch Meaxure
2+
3+
## Installation
4+
5+
- [Download](../../releases/latest/download/Sketch-Meaxure.sketchplugin.zip) the latest release of the plugin
6+
- Un-zip
7+
- Double-click on Sketch-Meaxure.sketchplugin
8+
9+
## Development Guide
10+
11+
_This plugin was created using `skpm`. For a detailed explanation on how things work, checkout the [skpm Readme](https://github.com/skpm/skpm/blob/master/README.md)._
12+
13+
### Usage
14+
15+
Install the dependencies
16+
17+
```bash
18+
npm install
19+
```
20+
21+
Once the installation is done, you can run some commands inside the project folder:
22+
23+
```bash
24+
npm run build
25+
```
26+
27+
To watch for changes:
28+
29+
```bash
30+
npm run watch
31+
```
32+
33+
Additionally, if you wish to run the plugin every time it is built:
34+
35+
```bash
36+
npm run start
37+
```
38+
39+
### Custom Configuration
40+
41+
#### Babel
42+
43+
To customize Babel, you have two options:
44+
45+
- You may create a [`.babelrc`](https://babeljs.io/docs/usage/babelrc) file in your project's root directory. Any settings you define here will overwrite matching config-keys within skpm preset. For example, if you pass a "presets" object, it will replace & reset all Babel presets that skpm defaults to.
46+
47+
- If you'd like to modify or add to the existing Babel config, you must use a `webpack.skpm.config.js` file. Visit the [Webpack](#webpack) section for more info.
48+
49+
#### Webpack
50+
51+
To customize webpack create `webpack.skpm.config.js` file which exports function that will change webpack's config.
52+
53+
```js
54+
/**
55+
* Function that mutates original webpack config.
56+
* Supports asynchronous changes when promise is returned.
57+
*
58+
* @param {object} config - original webpack config.
59+
* @param {boolean} isPluginCommand - whether the config is for a plugin command or a resource
60+
**/
61+
module.exports = function(config, isPluginCommand) {
62+
/** you can change config here **/
63+
}
64+
```
65+
66+
### Debugging
67+
68+
To view the output of your `console.log`, you have a few different options:
69+
70+
- Use the [`sketch-dev-tools`](https://github.com/skpm/sketch-dev-tools)
71+
- Run `skpm log` in your Terminal, with the optional `-f` argument (`skpm log -f`) which causes `skpm log` to not stop when the end of logs is reached, but rather to wait for additional data to be appended to the input
72+
73+
### Publishing your plugin
74+
75+
```bash
76+
skpm publish <bump>
77+
```
78+
79+
(where `bump` can be `patch`, `minor` or `major`)
80+
81+
`skpm publish` will create a new release on your GitHub repository and create an appcast file in order for Sketch users to be notified of the update.
82+
83+
You will need to specify a `repository` in the `package.json`:
84+
85+
```diff
86+
...
87+
+ "repository" : {
88+
+ "type": "git",
89+
+ "url": "git+https://github.com/ORG/NAME.git"
90+
+ }
91+
...
92+
```

assets/i18n/manifest-en.json

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
{
2+
"author": "utom & Jebbs",
3+
"commands" : [
4+
{
5+
"name": "Toolbar",
6+
"identifier": "commandToolbar",
7+
"shortcut": "ctrl shift b",
8+
"handler" : "commandToolbar",
9+
"script": "mark.bundle.js"
10+
},
11+
{
12+
"name": "Toolbar 2.0 (beta)",
13+
"identifier": "commandToolbar2",
14+
"shortcut": "ctrl shift x",
15+
"handler" : "commandToolbar2",
16+
"script": "mark.bundle.js"
17+
},
18+
{
19+
"name": "Mark Overlay",
20+
"identifier": "commandOverlays",
21+
"shortcut": "ctrl shift 1",
22+
"handler" : "commandOverlays",
23+
"script": "mark.bundle.js"
24+
},
25+
{
26+
"name": "Mark Sizes",
27+
"identifier": "commandSizes",
28+
"shortcut": "ctrl shift 2",
29+
"handler" : "commandSizes",
30+
"script": "mark.bundle.js"
31+
},
32+
{
33+
"name": "Mark Spacings",
34+
"identifier": "commandSpacings",
35+
"shortcut": "ctrl shift 3",
36+
"handler" : "commandSpacings",
37+
"script": "mark.bundle.js"
38+
},
39+
{
40+
"name": "Mark Properties",
41+
"identifier": "commandProperties",
42+
"shortcut": "ctrl shift 4",
43+
"handler" : "commandProperties",
44+
"script": "mark.bundle.js"
45+
},
46+
{
47+
"name": "Mark Note",
48+
"identifier": "commandNote",
49+
"shortcut": "ctrl shift 5",
50+
"handler" : "commandNote",
51+
"script": "mark.bundle.js"
52+
},
53+
{
54+
"name": "Spec Export",
55+
"identifier": "commandExport",
56+
"shortcut": "ctrl shift e",
57+
"handler" : "commandExport",
58+
"script": "mark.bundle.js"
59+
},
60+
{
61+
"name": "Toggle Hidden",
62+
"identifier": "commandHidden",
63+
"shortcut": "ctrl shift h",
64+
"handler": "commandHidden",
65+
"script": "mark.bundle.js"
66+
},
67+
{
68+
"name": "Toggle Locked",
69+
"identifier": "commandLocked",
70+
"shortcut": "ctrl shift l",
71+
"handler": "commandLocked",
72+
"script": "mark.bundle.js"
73+
},
74+
{
75+
"name": "Clear Marks",
76+
"identifier": "commandClear",
77+
"shortcut": "",
78+
"handler": "commandClear",
79+
"script": "mark.bundle.js"
80+
},
81+
{
82+
"name": "Settings",
83+
"identifier": "commandSettings",
84+
"shortcut": "",
85+
"handler": "commandSettings",
86+
"script": "mark.bundle.js"
87+
},
88+
{
89+
"name": "Color Names",
90+
"identifier": "commandColor",
91+
"shortcut": "ctrl shift c",
92+
"handler": "commandColor",
93+
"script": "mark.bundle.js"
94+
},
95+
{
96+
"name": "Make Exportable",
97+
"identifier": "commandExportable",
98+
"shortcut": "ctrl shift s",
99+
"handler": "commandExportable",
100+
"script": "mark.bundle.js"
101+
},
102+
{
103+
"name": "Documention",
104+
"identifier": "linkHelp",
105+
"handler": "linkHelp",
106+
"script": "links.sketchscript"
107+
},
108+
{
109+
"name": "Feedback",
110+
"identifier": "linkFeedback",
111+
"handler": "linkFeedback",
112+
"script": "links.sketchscript"
113+
},
114+
{
115+
"name": "Donate",
116+
"identifier": "linkDonate",
117+
"handler": "linkDonate",
118+
"script": "links.sketchscript"
119+
},
120+
{
121+
"name": "Design Sites",
122+
"identifier": "linkNiudana",
123+
"handler": "linkNiudana",
124+
"script": "links.sketchscript"
125+
},
126+
{
127+
"name": "Sketch.im",
128+
"identifier": "linkSketchim",
129+
"handler": "linkSketchim",
130+
"script": "links.sketchscript"
131+
},
132+
{
133+
"name": "Init",
134+
"identifier": "commandInit",
135+
"handlers": {
136+
"actions": {
137+
"OpenDocument": "commandInit"
138+
}
139+
},
140+
"script": "mark.bundle.js"
141+
}
142+
],
143+
"menu" : {
144+
"isRoot" : false,
145+
"shortcut" : "",
146+
"items" : [
147+
"commandToolbar",
148+
"commandToolbar2",
149+
"-",
150+
"commandOverlays",
151+
"commandSizes",
152+
"commandSpacings",
153+
"commandProperties",
154+
"commandNote",
155+
"-",
156+
"commandExportable",
157+
"commandColor",
158+
"commandExport",
159+
"-",
160+
"commandHidden",
161+
"commandLocked",
162+
"commandClear",
163+
"-",
164+
"commandSettings",
165+
"linkDonate",
166+
{
167+
"title": "Help",
168+
"items": [
169+
"linkHelp",
170+
"linkFeedback",
171+
"linkDonate"
172+
]
173+
}
174+
],
175+
"title" : "Sketch Measure"
176+
},
177+
"identifier": "co.jebbs.measure",
178+
"appcast": "https://raw.githubusercontent.com/qjebbs/sketch-measure/master/appcast.xml",
179+
"homepage": "http://utom.design/measure/",
180+
"version": "2.9.1",
181+
"description" : "Make it a fun to create spec for developers and teammates",
182+
"authorEmail" : "[email protected]",
183+
"name" : "Sketch Measure"
184+
}

0 commit comments

Comments
 (0)