Skip to content

Instantly share code, notes, and snippets.

@breadadams
Last active July 1, 2018 20:54
Show Gist options
  • Select an option

  • Save breadadams/9e602b19d8ba139c0657a0f97c26f1cf to your computer and use it in GitHub Desktop.

Select an option

Save breadadams/9e602b19d8ba139c0657a0f97c26f1cf to your computer and use it in GitHub Desktop.

Revisions

  1. breadadams renamed this gist Jul 1, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. breadadams created this gist Jul 1, 2018.
    326 changes: 326 additions & 0 deletions sc-path-test.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,326 @@
    NodePath {
    parent:
    Node {
    type: 'VariableDeclaration',
    start: 875,
    end: 912,
    loc: SourceLocation { start: [Object], end: [Object] },
    declarations: [ [Object] ],
    kind: 'const' },
    hub:
    Hub {
    file:
    File {
    _c: Map {},
    dynamicData: {},
    pipeline: Pipeline {},
    log: [Object],
    opts: [Object],
    parserOpts: [Object],
    pluginVisitors: [Array],
    pluginPasses: [Array],
    metadata: [Object],
    dynamicImportTypes: {},
    dynamicImportIds: {},
    dynamicImports: [],
    declarations: {},
    usedHelpers: {},
    path: [Object],
    ast: [Object],
    code: 'const Simple = styled.div`\n width: 100%;\n`\n\nconst Nested = styled.div`\n width: 100%;\n\n &:hover {\n color: papayawhip;\n }\n\n > div {\n background: white;\n }\n`\n\nconst Interpolations = styled.div`\n width: ${props => props.width};\n`\n\nconst NestedAndInterpolations = styled.div`\n width: ${props => props.width};\n\n &:hover {\n color: ${props => props.color};\n }\n`\n\nconst SelectorInterpolation = styled.div`\n width: ${props => props.width};\n\n ${props => props.selector} {\n color: papayawhip;\n }\n`\n\nconst RulesetInterpolationA = styled.div`\n width: ${props => props.width};\n ${props => props.ruleset} &:hover {\n color: papayawhip;\n }\n`\n\nconst RulesetInterpolationB = styled.div`\n ${props => props.ruleset}\n width: ${props => props.width};\n\n &:hover {\n color: papayawhip;\n }\n`\n\nconst Prefixes = styled.div`\n display: flex;\n align-items: center;\n`\n\nconst TestToBeExtended = styled.div``\n\nconst DoubleInterpolation = TestToBeExtended.extend`\n margin: ${props => props.vert} ${props => props.hori};\n`\n',
    shebang: '',
    hub: [Circular],
    scope: [Object] },
    options: undefined },
    contexts:
    [ TraversalContext {
    queue: [Array],
    parentPath: [Object],
    scope: [Object],
    state: undefined,
    opts: [Object],
    priorityQueue: [] } ],
    data: {},
    shouldSkip: false,
    shouldStop: false,
    removed: false,
    state: undefined,
    opts:
    { MemberExpression: { enter: [Array] },
    CallExpression: { enter: [Array] },
    TaggedTemplateExpression: { enter: [Array] },
    VariableDeclarator: { enter: [Array] },
    _exploded: {},
    _verified: {},
    BlockStatement: { exit: [Array] },
    Program: { exit: [Array] },
    ThisExpression: { enter: [Array] },
    Identifier: { enter: [Array] },
    JSXIdentifier: { enter: [Array] } },
    skipKeys: {},
    parentPath:
    NodePath {
    parent:
    Node {
    type: 'Program',
    start: 0,
    end: 1026,
    loc: [Object],
    sourceType: 'module',
    body: [Array],
    directives: [] },
    hub: Hub { file: [Object], options: undefined },
    contexts: [ [Object] ],
    data: {},
    shouldSkip: false,
    shouldStop: false,
    removed: false,
    state: undefined,
    opts:
    { MemberExpression: [Object],
    CallExpression: [Object],
    TaggedTemplateExpression: [Object],
    VariableDeclarator: [Object],
    _exploded: {},
    _verified: {},
    BlockStatement: [Object],
    Program: [Object],
    ThisExpression: [Object],
    Identifier: [Object],
    JSXIdentifier: [Object] },
    skipKeys: {},
    parentPath:
    NodePath {
    parent: [Object],
    hub: [Object],
    contexts: [Array],
    data: {},
    shouldSkip: false,
    shouldStop: false,
    removed: false,
    state: undefined,
    opts: [Object],
    skipKeys: {},
    parentPath: null,
    context: [Object],
    container: [Object],
    listKey: undefined,
    inList: false,
    parentKey: 'program',
    key: 'program',
    node: [Object],
    scope: [Object],
    type: 'Program',
    typeAnnotation: null },
    context:
    TraversalContext {
    queue: [Array],
    parentPath: [Object],
    scope: [Object],
    state: undefined,
    opts: [Object],
    priorityQueue: [] },
    container:
    [ [Object],
    [Object],
    [Object],
    [Object],
    [Object],
    [Object],
    [Object],
    [Object],
    [Object],
    [Object] ],
    listKey: 'body',
    inList: true,
    parentKey: 'body',
    key: 8,
    node:
    Node {
    type: 'VariableDeclaration',
    start: 875,
    end: 912,
    loc: [Object],
    declarations: [Array],
    kind: 'const' },
    scope:
    Scope {
    uid: 31,
    parent: null,
    hub: [Object],
    parentBlock: [Object],
    block: [Object],
    path: [Object],
    labels: [Object],
    references: [Object],
    bindings: [Object],
    globals: [Object],
    uids: {},
    data: {},
    crawling: false },
    type: 'VariableDeclaration',
    typeAnnotation: null },
    context:
    TraversalContext {
    queue: [ [Circular] ],
    parentPath:
    NodePath {
    parent: [Object],
    hub: [Object],
    contexts: [Array],
    data: {},
    shouldSkip: false,
    shouldStop: false,
    removed: false,
    state: undefined,
    opts: [Object],
    skipKeys: {},
    parentPath: [Object],
    context: [Object],
    container: [Array],
    listKey: 'body',
    inList: true,
    parentKey: 'body',
    key: 8,
    node: [Object],
    scope: [Object],
    type: 'VariableDeclaration',
    typeAnnotation: null },
    scope:
    Scope {
    uid: 31,
    parent: null,
    hub: [Object],
    parentBlock: [Object],
    block: [Object],
    path: [Object],
    labels: [Object],
    references: [Object],
    bindings: [Object],
    globals: [Object],
    uids: {},
    data: {},
    crawling: false },
    state: undefined,
    opts:
    { MemberExpression: [Object],
    CallExpression: [Object],
    TaggedTemplateExpression: [Object],
    VariableDeclarator: [Object],
    _exploded: {},
    _verified: {},
    BlockStatement: [Object],
    Program: [Object],
    ThisExpression: [Object],
    Identifier: [Object],
    JSXIdentifier: [Object] },
    priorityQueue: [] },
    container:
    [ Node {
    type: 'VariableDeclarator',
    start: 881,
    end: 912,
    loc: [Object],
    id: [Object],
    init: [Object] } ],
    listKey: 'declarations',
    inList: true,
    parentKey: 'declarations',
    key: 0,
    node:
    Node {
    type: 'VariableDeclarator',
    start: 881,
    end: 912,
    loc: SourceLocation { start: [Object], end: [Object] },
    id:
    Node {
    type: 'Identifier',
    start: 881,
    end: 897,
    loc: [Object],
    name: 'TestToBeExtended' },
    init:
    Node {
    type: 'TaggedTemplateExpression',
    start: 900,
    end: 912,
    loc: [Object],
    tag: [Object],
    quasi: [Object] } },
    scope:
    Scope {
    uid: 31,
    parent: null,
    hub: Hub { file: [Object], options: undefined },
    parentBlock:
    Node {
    type: 'File',
    start: 0,
    end: 1026,
    loc: [Object],
    program: [Object],
    comments: [],
    tokens: [Array] },
    block:
    Node {
    type: 'Program',
    start: 0,
    end: 1026,
    loc: [Object],
    sourceType: 'module',
    body: [Array],
    directives: [] },
    path:
    NodePath {
    parent: [Object],
    hub: [Object],
    contexts: [Array],
    data: {},
    shouldSkip: false,
    shouldStop: false,
    removed: false,
    state: undefined,
    opts: [Object],
    skipKeys: {},
    parentPath: null,
    context: [Object],
    container: [Object],
    listKey: undefined,
    inList: false,
    parentKey: 'program',
    key: 'program',
    node: [Object],
    scope: [Circular],
    type: 'Program',
    typeAnnotation: null },
    labels: Map { _c: Map {} },
    references:
    { Simple: true,
    Nested: true,
    Interpolations: true,
    props: true,
    NestedAndInterpolations: true,
    SelectorInterpolation: true,
    RulesetInterpolationA: true,
    RulesetInterpolationB: true,
    Prefixes: true,
    TestToBeExtended: true,
    DoubleInterpolation: true },
    bindings:
    { Simple: [Object],
    Nested: [Object],
    Interpolations: [Object],
    NestedAndInterpolations: [Object],
    SelectorInterpolation: [Object],
    RulesetInterpolationA: [Object],
    RulesetInterpolationB: [Object],
    Prefixes: [Object],
    TestToBeExtended: [Object],
    DoubleInterpolation: [Object] },
    globals: { styled: [Object] },
    uids: {},
    data: {},
    crawling: false },
    type: 'VariableDeclarator',
    typeAnnotation: null }