@khanacademy/perseus-editor 0.0.1
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/.babelrc.js +8 -0
- package/README.md +3 -0
- package/dist/es/index.js +2 -0
- package/dist/es/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.flow +2 -0
- package/dist/index.js.map +1 -0
- package/dist/strings.js +9 -0
- package/package.json +30 -0
- package/src/__tests__/index.test.js +15 -0
- package/src/index.js +9 -0
package/.babelrc.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HACK(kevinb): Due to https://github.com/facebook/jest/issues/11741,
|
|
3
|
+
* we need to have this file, or updating inline snapshots can fail rather
|
|
4
|
+
* cryptically.
|
|
5
|
+
*
|
|
6
|
+
* We should remove this when jest is fixed.
|
|
7
|
+
*/
|
|
8
|
+
module.exports = require("../../build-settings/babel.config.js");
|
package/README.md
ADDED
package/dist/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.js"],"sourcesContent":["// @flow\nimport {foo} from \"@khanacademy/perseus\";\nimport * as i18n from \"@khanacademy/wonder-blocks-i18n\";\n\nexport const bar = (): void => {\n const msg = i18n._(\"foo() = %(foo)s\", {foo: foo()});\n // eslint-disable-next-line no-console\n console.log(msg);\n};\n"],"names":["bar","msg","i18n","_","foo","console","log"],"mappings":"6FAIO,IAAMA,EAAM,KACf,IAAMC,EAAMC,EAAKC,EAAE,kBAAmB,CAACC,IAAKA,MAE5CC,QAAQC,IAAIL"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@khanacademy/perseus");function r(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var t=r(require("@khanacademy/wonder-blocks-i18n"));exports.bar=()=>{const r=t._("foo() = %(foo)s",{foo:e.foo()});console.log(r)};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.js"],"sourcesContent":["// @flow\nimport {foo} from \"@khanacademy/perseus\";\nimport * as i18n from \"@khanacademy/wonder-blocks-i18n\";\n\nexport const bar = (): void => {\n const msg = i18n._(\"foo() = %(foo)s\", {foo: foo()});\n // eslint-disable-next-line no-console\n console.log(msg);\n};\n"],"names":["msg","i18n","_","foo","console","log"],"mappings":"ycAImB,KACf,MAAMA,EAAMC,EAAKC,EAAE,kBAAmB,CAACC,IAAKA,EAAAA,QAE5CC,QAAQC,IAAIL"}
|
package/dist/strings.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"publishConfig": {
|
|
3
|
+
"access": "public"
|
|
4
|
+
},
|
|
5
|
+
"name": "@khanacademy/perseus-editor",
|
|
6
|
+
"version": "0.0.1",
|
|
7
|
+
"description": "Perseus editors",
|
|
8
|
+
"module": "dist/es/index.js",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"source": "src/index.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@khanacademy/perseus": "^0.0.1"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@khanacademy/wonder-blocks-i18n": "^1.2.3",
|
|
19
|
+
"perseus-build-settings": "^0.0.1",
|
|
20
|
+
"react": "16.14.0",
|
|
21
|
+
"react-dom": "16.14.0"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@khanacademy/wonder-blocks-i18n": "^1.2.3",
|
|
25
|
+
"react": "16.14.0",
|
|
26
|
+
"react-dom": "16.14.0"
|
|
27
|
+
},
|
|
28
|
+
"author": "",
|
|
29
|
+
"license": "MIT"
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
import {bar} from "../index.js";
|
|
3
|
+
|
|
4
|
+
describe("#foo", () => {
|
|
5
|
+
it("should return foo", () => {
|
|
6
|
+
// Arrange
|
|
7
|
+
const logSpy = jest.spyOn(console, "log");
|
|
8
|
+
|
|
9
|
+
// Act
|
|
10
|
+
bar();
|
|
11
|
+
|
|
12
|
+
// Assert
|
|
13
|
+
expect(logSpy).toHaveBeenCalledWith("foo() = foo");
|
|
14
|
+
});
|
|
15
|
+
});
|
package/src/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
import {foo} from "@khanacademy/perseus";
|
|
3
|
+
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
4
|
+
|
|
5
|
+
export const bar = (): void => {
|
|
6
|
+
const msg = i18n._("foo() = %(foo)s", {foo: foo()});
|
|
7
|
+
// eslint-disable-next-line no-console
|
|
8
|
+
console.log(msg);
|
|
9
|
+
};
|