Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: removing the variable subpackage in favor of @readme/variable #207

Merged
merged 2 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ const { options } = require('../options.js');
test('it should have the proper utils exports', () => {
expect(typeof markdown.utils.BaseUrlContext).toBe('object');
expect(typeof markdown.utils.GlossaryContext).toBe('object');
expect(typeof markdown.utils.OauthContext).toBe('object');
expect(typeof markdown.utils.SelectedAppContext).toBe('object');
expect(typeof markdown.utils.Variable).toBe('function');
expect(typeof markdown.utils.VariablesContext).toBe('object');

expect(markdown.utils.VARIABLE_REGEXP).toBe('(?:\\\\)?<<([-\\w:.\\s]+)(?:\\\\)?>>');
expect(markdown.utils.options).toStrictEqual({
compatibilityMode: false,
copyButtons: true,
Expand Down
12 changes: 4 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const rehypeReact = require('rehype-react');
*/
const BaseUrlContext = require('./contexts/BaseUrl');

const Variable = require('./variable');
const Variable = require('@readme/variable');

const {
GlossaryItem,
Expand Down Expand Up @@ -86,12 +86,8 @@ export function setup(blocks, opts = {}) {
export const utils = {
BaseUrlContext,
GlossaryContext: GlossaryItem.GlossaryContext,
OauthContext: Variable.OauthContext,
SelectedAppContext: Variable.SelectedAppContext,
VARIABLE_REGEXP: Variable.VARIABLE_REGEXP,
Variable: Variable.Variable,
VariablesContext: Variable.VariablesContext,
options,
VariablesContext: Variable.VariablesContext,
};

/**
Expand Down Expand Up @@ -163,7 +159,7 @@ export function reactProcessor(opts = {}, components = {}) {
'code-tabs': CodeTabs(sanitize),
'html-block': HTMLBlock(sanitize),
'rdme-callout': Callout(sanitize),
'readme-variable': Variable.Variable,
'readme-variable': Variable,
'readme-glossary-item': GlossaryItem,
'rdme-embed': Embed(sanitize),
'rdme-pin': PinWrap,
Expand Down Expand Up @@ -201,7 +197,7 @@ export function reactTOC(tree, opts = {}) {
createElement: React.createElement,
components: {
p: React.Fragment,
'readme-variable': Variable.Variable,
'readme-variable': Variable,
'readme-glossary-item': GlossaryItem,
},
});
Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
},
"dependencies": {
"@readme/emojis": "^3.0.0",
"@readme/syntax-highlighter": "^10.8.0",
"classnames": "^2.2.6",
"@readme/syntax-highlighter": "^10.10.1",
"copy-to-clipboard": "^3.3.1",
"hast-util-sanitize": "^4.0.0",
"hast-util-to-string": "^1.0.3",
Expand Down Expand Up @@ -73,7 +72,7 @@
"@commitlint/config-conventional": "^11.0.0",
"@hot-loader/react-dom": "^16.14.0",
"@readme/eslint-config": "^3.8.0",
"@readme/variable": "^13.4.12",
"@readme/variable": "^13.5.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"babel-jest": "^27.0.5",
Expand Down
2 changes: 1 addition & 1 deletion processor/parse/variable-parser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { VARIABLE_REGEXP } = require('../../variable');
const { VARIABLE_REGEXP } = require('@readme/variable');

function tokenizeVariable(eat, value, silent) {
// Modifies the regular expression to match from
Expand Down
3 changes: 0 additions & 3 deletions variable/__tests__/.eslintrc

This file was deleted.

122 changes: 0 additions & 122 deletions variable/__tests__/index.test.jsx

This file was deleted.

3 changes: 0 additions & 3 deletions variable/contexts/Oauth.js

This file was deleted.

6 changes: 0 additions & 6 deletions variable/contexts/SelectedApp.js

This file was deleted.

6 changes: 0 additions & 6 deletions variable/contexts/Variables.js

This file was deleted.

Loading