@sltsh/aion-tokens 0.3.0
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/LICENSE +21 -0
- package/README.md +48 -0
- package/dist/flatten.d.ts +2 -0
- package/dist/flatten.d.ts.map +1 -0
- package/dist/flatten.js +18 -0
- package/dist/flatten.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/light.d.ts +21 -0
- package/dist/light.d.ts.map +1 -0
- package/dist/light.js +72 -0
- package/dist/light.js.map +1 -0
- package/dist/oklch.d.ts +14 -0
- package/dist/oklch.d.ts.map +1 -0
- package/dist/oklch.js +86 -0
- package/dist/oklch.js.map +1 -0
- package/dist/palette.d.ts +155 -0
- package/dist/palette.d.ts.map +1 -0
- package/dist/palette.js +179 -0
- package/dist/palette.js.map +1 -0
- package/dist/preview.d.ts +29 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +72 -0
- package/dist/preview.js.map +1 -0
- package/dist/report.d.ts +17 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +279 -0
- package/dist/report.js.map +1 -0
- package/dist/rivals.d.ts +22 -0
- package/dist/rivals.d.ts.map +1 -0
- package/dist/rivals.js +83 -0
- package/dist/rivals.js.map +1 -0
- package/dist/semantic.d.ts +203 -0
- package/dist/semantic.d.ts.map +1 -0
- package/dist/semantic.js +99 -0
- package/dist/semantic.js.map +1 -0
- package/dist/solve.d.ts +44 -0
- package/dist/solve.d.ts.map +1 -0
- package/dist/solve.js +59 -0
- package/dist/solve.js.map +1 -0
- package/dist/states.d.ts +28 -0
- package/dist/states.d.ts.map +1 -0
- package/dist/states.js +89 -0
- package/dist/states.js.map +1 -0
- package/dist/status.d.ts +12 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +12 -0
- package/dist/status.js.map +1 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +2 -0
- package/dist/util.js.map +1 -0
- package/dist/verify.d.ts +2 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +42 -0
- package/dist/verify.js.map +1 -0
- package/package.json +40 -0
package/dist/states.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { compositeEmitted } from './oklch.js';
|
|
2
|
+
import { ACCENTS, SYNTAX, comment, diffWash, findMatch, neutral, overlay } from './palette.js';
|
|
3
|
+
export const SHIPPED = {
|
|
4
|
+
neutral, overlay, diffWash, findMatch, comment,
|
|
5
|
+
syntax: Object.fromEntries(Object.keys(SYNTAX).map((role) => [role, ACCENTS[SYNTAX[role]]])),
|
|
6
|
+
};
|
|
7
|
+
const surfaces = (source) => ({
|
|
8
|
+
editor: source.neutral.editor,
|
|
9
|
+
peekEditor: source.neutral.terminal,
|
|
10
|
+
hoverWidget: source.neutral.widget,
|
|
11
|
+
// The current find match is opaque, so it is a surface rather than an overlay. Nothing
|
|
12
|
+
// it covers can raise it, which is why it may be the loudest decoration in the editor.
|
|
13
|
+
findMatch: source.findMatch.current,
|
|
14
|
+
});
|
|
15
|
+
// A stack is the decorations the native editor paints over one another on the same
|
|
16
|
+
// characters. A selection and a word highlight can both land on a word the caret is
|
|
17
|
+
// already inside, so that pair is real.
|
|
18
|
+
//
|
|
19
|
+
// The current line and a selection cannot stack: VS Code renders the current-line
|
|
20
|
+
// background only while every selection is empty, in `_shouldRenderInContent`. Gating a
|
|
21
|
+
// state the renderer never produces held the current line at 1.05:1 against the editor
|
|
22
|
+
// for no reader's benefit.
|
|
23
|
+
const EDITOR_STACKS = [
|
|
24
|
+
[],
|
|
25
|
+
['lineHighlight'],
|
|
26
|
+
['selection'],
|
|
27
|
+
['wordHighlight'],
|
|
28
|
+
['lineHighlight', 'wordHighlight'],
|
|
29
|
+
['selection', 'wordHighlight'],
|
|
30
|
+
];
|
|
31
|
+
const STACKS = {
|
|
32
|
+
editor: EDITOR_STACKS,
|
|
33
|
+
peekEditor: EDITOR_STACKS,
|
|
34
|
+
hoverWidget: [[]],
|
|
35
|
+
findMatch: [[], ['wordHighlight']],
|
|
36
|
+
};
|
|
37
|
+
// A diff wash goes on top of the selection, not under it. VS Code registers
|
|
38
|
+
// `DecorationsOverlay` after `SelectionsOverlay` and both render into the same line
|
|
39
|
+
// element in registration order, so the wash is the last layer before the glyph. The
|
|
40
|
+
// bases it sits on are the plain line, the current line and the selection.
|
|
41
|
+
const DIFF_LAYERS = [
|
|
42
|
+
['addedLine'],
|
|
43
|
+
['addedLine', 'addedWord'],
|
|
44
|
+
['removedLine'],
|
|
45
|
+
['removedLine', 'removedWord'],
|
|
46
|
+
];
|
|
47
|
+
const DIFF_BASES = [[], ['lineHighlight'], ['selection']];
|
|
48
|
+
// The other matches are a wash, and their own registration says they must be, so that the
|
|
49
|
+
// decorations under them still read. The decoration renders in an editor, so the surfaces
|
|
50
|
+
// are the editor and the peek editor, not a widget.
|
|
51
|
+
const OTHER_MATCH_BASES = [
|
|
52
|
+
[], ['lineHighlight'], ['selection'], ['selection', 'wordHighlight'],
|
|
53
|
+
];
|
|
54
|
+
// The complete set of backgrounds the contrast guarantee covers. Anything absent here is
|
|
55
|
+
// outside the claim, and `README.md` says so rather than implying every state passes.
|
|
56
|
+
export function readingStates(source = SHIPPED) {
|
|
57
|
+
const stackOn = (base, names) => names.reduce((under, name) => compositeEmitted(source.overlay[name].color, source.overlay[name].alpha, under), base);
|
|
58
|
+
const washOn = (base, names) => names.reduce((under, name) => compositeEmitted(source.diffWash[name].color, source.diffWash[name].alpha, under), base);
|
|
59
|
+
const surface = surfaces(source);
|
|
60
|
+
const rows = [];
|
|
61
|
+
for (const [name, base] of Object.entries(surface)) {
|
|
62
|
+
for (const stack of STACKS[name]) {
|
|
63
|
+
rows.push({ name: [name, ...stack].join(' + '), background: stackOn(base, stack) });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const base of DIFF_BASES) {
|
|
67
|
+
for (const layer of DIFF_LAYERS) {
|
|
68
|
+
rows.push({
|
|
69
|
+
name: ['editor', ...base, ...layer].join(' + '),
|
|
70
|
+
background: washOn(stackOn(surface.editor, base), layer),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const base of OTHER_MATCH_BASES) {
|
|
75
|
+
for (const name of ['editor', 'peekEditor']) {
|
|
76
|
+
rows.push({
|
|
77
|
+
name: [name, ...base, 'findMatchOther'].join(' + '),
|
|
78
|
+
background: stackOn(stackOn(surface[name], base), ['findMatchOther']),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return rows;
|
|
83
|
+
}
|
|
84
|
+
export const readingForegrounds = (source = SHIPPED) => ({
|
|
85
|
+
comment: source.comment,
|
|
86
|
+
punctuation: source.neutral.textSecondary,
|
|
87
|
+
...source.syntax,
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"states.js","sourceRoot":"","sources":["../src/states.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAmB/F,MAAM,CAAC,MAAM,OAAO,GAAgB;IAClC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO;IAC9C,MAAM,EAAE,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACtD;CAC/B,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,MAAmB,EAAE,EAAE,CAA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CAAC;YAChC,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC/C,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC;aACzD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACrC,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAU,EAAE,CAAC;YACrD,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;gBACnD,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;aACtE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAsB,OAAO,EAAyB,EAAE,CAAC,CAAC;IAC3F,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa;IACzC,GAAG,MAAM,CAAC,MAAM;CACjB,CAAC,CAAC"}
|
package/dist/status.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Oklch } from './oklch.js';
|
|
2
|
+
import type { StatusName } from './palette.js';
|
|
3
|
+
export interface StatusScale {
|
|
4
|
+
readonly text: Oklch;
|
|
5
|
+
readonly solid: Oklch;
|
|
6
|
+
readonly subtle: Oklch;
|
|
7
|
+
readonly border: Oklch;
|
|
8
|
+
readonly onSolid: Oklch;
|
|
9
|
+
}
|
|
10
|
+
export declare const status: Record<StatusName, StatusScale>;
|
|
11
|
+
export declare const statusLight: Record<StatusName, StatusScale>;
|
|
12
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK/C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;CACzB;AAED,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,WAAW,CAGjD,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,WAAW,CAGtD,CAAC"}
|
package/dist/status.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { STATUS, accentScale, neutral } from './palette.js';
|
|
2
|
+
import { lightAccentScale, lightNeutral } from './light.js';
|
|
3
|
+
import { mapValues } from './util.js';
|
|
4
|
+
export const status = mapValues(STATUS, (accent) => {
|
|
5
|
+
const scale = accentScale(accent);
|
|
6
|
+
return { text: scale.solid, solid: scale.solid, subtle: scale.subtle, border: scale.border, onSolid: neutral.editor };
|
|
7
|
+
});
|
|
8
|
+
export const statusLight = mapValues(STATUS, (accent) => {
|
|
9
|
+
const scale = lightAccentScale(accent);
|
|
10
|
+
return { text: scale.solid, solid: scale.solid, subtle: scale.subtle, border: scale.border, onSolid: lightNeutral.page };
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAUtC,MAAM,CAAC,MAAM,MAAM,GAAoC,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;IAClF,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AACxH,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAoC,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;IACvF,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,IAAI,EAAE,CAAC;AAC3H,CAAC,CAAC,CAAC"}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,EAC9C,QAAQ,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KACjC,MAAM,CAAC,CAAC,EAAE,CAAC,CAGK,CAAC"}
|
package/dist/util.js
ADDED
package/dist/util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,MAAoB,EACpB,SAAkC,EACpB,EAAE,CAChB,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,KAAU,EAAE,GAAQ,CAAC,CAAC,CAAC,CACrE,CAAC"}
|
package/dist/verify.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":""}
|
package/dist/verify.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { checks, designTables, failures } from './report.js';
|
|
2
|
+
const MARK = { pass: 'PASS', fail: 'FAIL', exempt: 'EXMT', info: ' ' };
|
|
3
|
+
const pad = (value, width) => value.padEnd(width);
|
|
4
|
+
const padLeft = (value, width) => value.padStart(width);
|
|
5
|
+
function printChecks(rows) {
|
|
6
|
+
const sections = [...new Set(rows.map((r) => r.section))];
|
|
7
|
+
for (const section of sections) {
|
|
8
|
+
const group = rows.filter((r) => r.section === section);
|
|
9
|
+
console.log(`\n${section.toUpperCase()}`);
|
|
10
|
+
for (const row of group) {
|
|
11
|
+
const measured = row.state === 'info' ? '' : `${row.ratio.toFixed(2)}:1`;
|
|
12
|
+
const floor = row.floor > 0 && row.state !== 'info' ? `floor ${row.floor.toFixed(1)}` : '';
|
|
13
|
+
console.log(` ${MARK[row.state]} ${pad(row.token, 30)} ${pad(row.hex, 10)} on ${pad(row.surface, 16)} ` +
|
|
14
|
+
`${pad(row.surfaceHex, 9)} ${padLeft(measured, 8)} ${floor}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function main() {
|
|
19
|
+
if (process.argv.includes('--markdown')) {
|
|
20
|
+
for (const [name, table] of Object.entries(designTables())) {
|
|
21
|
+
console.log(`<!-- ${name} -->`);
|
|
22
|
+
console.log(table);
|
|
23
|
+
console.log();
|
|
24
|
+
}
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const rows = checks();
|
|
28
|
+
printChecks(rows);
|
|
29
|
+
const failed = failures(rows);
|
|
30
|
+
const counted = (state) => rows.filter((r) => r.state === state).length;
|
|
31
|
+
console.log(`\n${rows.length} tokens: ${counted('pass')} pass, ${counted('fail')} fail, ` +
|
|
32
|
+
`${counted('exempt')} exempt, ${counted('info')} informational`);
|
|
33
|
+
if (failed.length > 0) {
|
|
34
|
+
console.error('\nThe contrast floor is a build step. These tokens are below it:');
|
|
35
|
+
for (const row of failed) {
|
|
36
|
+
console.error(` ${row.token} ${row.hex} on ${row.surface} = ${row.ratio.toFixed(2)}:1, floor ${row.floor}`);
|
|
37
|
+
}
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
main();
|
|
42
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG7D,MAAM,IAAI,GAA+B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAEtG,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,KA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AC;YACzB,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,OAAO,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/G,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sltsh/aion-tokens",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "The Aion colour system: OKLCH definitions, contrast invariants and sRGB emitters.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.build.json",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
22
|
+
"verify": "npm run build && node dist/verify.js",
|
|
23
|
+
"tables": "npm run build && node dist/verify.js --markdown",
|
|
24
|
+
"prepack": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/culori": "^4.0.1",
|
|
28
|
+
"@types/node": "^26.4.1",
|
|
29
|
+
"culori": "^4.0.1"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/sltsh/aion.git",
|
|
34
|
+
"directory": "packages/tokens"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public",
|
|
38
|
+
"registry": "https://registry.npmjs.org/"
|
|
39
|
+
}
|
|
40
|
+
}
|