Skip to content

Commit 4cbb3bf

Browse files
committed
Finished phase l
1 parent c0c1c19 commit 4cbb3bf

File tree

167 files changed

+1538
-496
lines changed

Some content is hidden

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

167 files changed

+1538
-496
lines changed

phaseA/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseA/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseB/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseB/src/@types/reactAst.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { ReactNode, Ref } from 'react';
2-
31
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
45
interface IntrinsicElements {
56
Hello: {
67
ref?: Ref<any>;

phaseB/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseC/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseC/src/@types/reactAst.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { ReactNode, Ref } from 'react';
2-
31
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
45
interface IntrinsicElements {
56
Hello: {
67
ref?: Ref<any>;

phaseC/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseD/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseD/src/@types/reactAst.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { ReactNode, Ref } from 'react';
2-
31
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
45
interface IntrinsicElements {
56
File: {
67
ref?: Ref<any>;

phaseD/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseE/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseE/src/@types/reactAst.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { ReactNode, Ref } from 'react';
2-
31
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
45
interface IntrinsicElements {
56
File: {
67
ref?: Ref<any>;

phaseE/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseF/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseF/src/@types/reactAst.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { ReactNode, Ref } from 'react';
2-
31
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
45
interface IntrinsicElements {
56
File: {
67
ref?: Ref<any>;

phaseF/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseG/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseG/src/@types/reactAst.d.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { ReactNode, Ref } from 'react';
2-
import template, {
3-
TemplateBuilderOptions,
4-
PublicReplacements
5-
} from '@babel/template';
6-
import { Path } from '..';
7-
81
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
import template, {
5+
TemplateBuilderOptions,
6+
PublicReplacements
7+
// @ts-ignore
8+
} from '@babel/template';
9+
// @ts-ignore
10+
import { Path } from '..';
11+
912
interface IntrinsicElements {
1013
Ast: {
1114
ref?: Ref<any>;

phaseG/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseH/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseH/src/@types/reactAst.d.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { ReactNode, Ref } from 'react';
2-
import template, {
3-
TemplateBuilderOptions,
4-
PublicReplacements
5-
} from '@babel/template';
6-
import { Path } from '..';
7-
81
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
import template, {
5+
TemplateBuilderOptions,
6+
PublicReplacements
7+
// @ts-ignore
8+
} from '@babel/template';
9+
// @ts-ignore
10+
import { Path } from '..';
11+
912
interface IntrinsicElements {
1013
Ast: {
1114
ref?: Ref<any>;

phaseH/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseI/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseI/src/@types/reactAst.d.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { ReactNode, Ref } from 'react';
2-
import template, {
3-
TemplateBuilderOptions,
4-
PublicReplacements
5-
} from '@babel/template';
6-
import { Path } from '..';
7-
81
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
import template, {
5+
TemplateBuilderOptions,
6+
PublicReplacements
7+
// @ts-ignore
8+
} from '@babel/template';
9+
// @ts-ignore
10+
import { Path } from '..';
11+
912
interface IntrinsicElements {
1013
Ast: {
1114
ref?: Ref<any>;

phaseI/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,

phaseJ/example/index.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
import React, { FC } from 'react';
22
import util from 'util';
3-
import { render, Smart } from '../src';
3+
import { render } from '../src';
44

55
export interface AppProps {
6+
hello?: string;
67
howdy?: string;
78
}
89

910
export const App: FC<AppProps> = (props: AppProps) => {
1011
console.log('PROPS', props);
1112
return (
1213
<>
13-
<Smart code="const hello = 'world'" />
14+
{props.hello}
1415
{props.howdy}
1516
</>
1617
);
1718
};
1819
App.defaultProps = {
20+
hello: "const hello = 'austin'",
1921
howdy: "const howdy = () => 'austin'"
2022
};
2123

2224
console.log('======== RECONCILER LIFECYCLE ========');
23-
const renderedOutput = render(<App />);
25+
const renderedOutput = render(<App hello="const hello = 'world'" />);
2426

2527
console.log('\n\n======== RENDERED OUTPUT ========');
2628
console.log(util.inspect(renderedOutput, false, null, true));

phaseJ/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"lib"
9191
],
9292
"jest": {
93-
"testRegex": "((tests(/|/.*/)[^_/]*)|\\.spec)\\.[jt]sx?$",
93+
"testRegex": "((tests(/|/.*/)[^_/]*)|(src(/|/.*/)[^_/]*\\.spec))\\.[jt]sx?$",
9494
"verbose": true,
9595
"setupFilesAfterEnv": [
9696
"./tests/_setup.ts"

phaseJ/src/@types/reactAst.d.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { ReactNode, Ref } from 'react';
2-
import template, {
3-
TemplateBuilderOptions,
4-
PublicReplacements
5-
} from '@babel/template';
6-
import { Path } from '..';
7-
81
declare namespace JSX {
2+
// @ts-ignore
3+
import { ReactNode, Ref } from 'react';
4+
import template, {
5+
TemplateBuilderOptions,
6+
PublicReplacements
7+
// @ts-ignore
8+
} from '@babel/template';
9+
// @ts-ignore
10+
import { Path } from '..';
11+
912
interface IntrinsicElements {
1013
Ast: {
1114
ref?: Ref<any>;

phaseJ/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"incremental": true,
99
"jsx": "preserve",
1010
"lib": ["esnext"],
11-
"module": "CommonJS",
12-
"moduleResolution": "Node",
11+
"module": "commonjs",
12+
"moduleResolution": "node",
1313
"outDir": "lib",
1414
"resolveJsonModule": true,
1515
"sourceMap": true,
File renamed without changes.
File renamed without changes.

phaseRoot/.eslintrc renamed to phaseK/.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"import/export": "off",
1616
"import/named": "off",
1717
"import/no-unresolved": "off",
18+
"no-empty-function": "warn",
1819
"no-unused-vars": "off",
1920
"react/forbid-foreign-prop-types": "off",
2021
"react/jsx-wrap-multilines": "off",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

phaseK/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Phase K
2+
3+
> add options

phaseK/example/index.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import { render, Smart } from '../src';
3+
4+
console.log('======== RECONCILER LIFECYCLE ========');
5+
const renderedOutput = render(
6+
<>
7+
<Smart code="const hello = 'world'" />
8+
const howdy = () => 'texas'
9+
</>
10+
);
11+
12+
console.log('\n\n======== RENDERED OUTPUT ========');
13+
console.log(renderedOutput);
14+
console.log('\n\n--------------');

0 commit comments

Comments
 (0)