This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: factor out utils * chore: factor out types * chore: factor out types * chore: persist all artifacts * chore: fix circle config * chore: factor out analyzer * chore: remove remaining perform-analysis references * chore: move analyze bin to analyze package * chore: clean up references * chore: prune dependency tree * chore: add missing types pkg * chore: change product name for release channels * chore: set artifact name based on channel * chore: escape ext * chore: do not duplicate * chore: vendor standalone bundle of analyzer * refactor: pass data instead of fns to analyzer * feat: make analysis runs stateless * fix: restart project syncing when id changes * chore: add new package to ci * fix: remove obsolete deps * fix: remove unneeded webpack entry * fix: add missing entry file
- Loading branch information
Showing
365 changed files
with
7,031 additions
and
1,715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,18 @@ commands: | |
- save_cache: | ||
paths: | ||
- node_modules | ||
- packages/analyzer/node_modules | ||
- packages/analyzer-cli/node_modules | ||
- packages/components/node_modules | ||
- packages/core/node_modules | ||
- packages/essentials/node_modules | ||
- packages/message/node_modules | ||
- packages/model/node_modules | ||
- packages/model-tree/node_modules | ||
- packages/site/node_modules | ||
- packages/tools/node_modules | ||
- packages/types/node_modules | ||
- packages/util/node_modules | ||
key: v5-dependencies-<< parameters.key >>-{{ checksum "yarn.lock" }} | ||
|
||
- run: | ||
|
@@ -68,26 +77,29 @@ jobs: | |
name: Install yarn | ||
command: yarn global add [email protected] | ||
|
||
- restore_cache: | ||
keys: | ||
- v5-dependencies-macos-{{ checksum "yarn.lock" }} | ||
- v5-dependencies-macos- | ||
- setup: | ||
key: macos | ||
|
||
- run: | ||
name: Install dependencies | ||
command: yarn install --frozen-lockfile || yarn | ||
name: Add npm bin to path | ||
command: echo 'export PATH="$(npm bin):$PATH"' >> $BASH_ENV | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
- packages/components/node_modules | ||
- packages/core/node_modules | ||
- packages/tools/node_modules | ||
key: v5-dependencies-macos-{{ checksum "yarn.lock" }} | ||
deps: | ||
docker: | ||
- image: circleci/node:8 | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- setup: | ||
key: linux | ||
|
||
- attach_workspace: | ||
at: ~/repo | ||
|
||
- run: | ||
name: Add npm bin to path | ||
command: echo 'export PATH="$(npm bin):$PATH"' >> $BASH_ENV | ||
name: Check dependencies | ||
command: lerna run check:dependencies --stream | ||
|
||
test: | ||
docker: | ||
|
@@ -137,10 +149,18 @@ jobs: | |
- persist_to_workspace: | ||
root: ~/repo | ||
paths: | ||
- packages/analyzer/lib | ||
- packages/analyzer-cli/lib | ||
- packages/components/lib | ||
- packages/core/lib | ||
- packages/essentials/lib | ||
- packages/message/lib | ||
- packages/model/lib | ||
- packages/model-tree/lib | ||
- packages/site/lib | ||
- packages/tools/lib | ||
- packages/types/lib | ||
- packages/util/lib | ||
|
||
ncc: | ||
docker: | ||
|
@@ -352,6 +372,9 @@ workflows: | |
- install_macos | ||
- lint | ||
- compile | ||
- deps: | ||
requires: | ||
- compile | ||
- test: | ||
requires: | ||
- compile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ lib | |
nccbuild | ||
dist | ||
node_modules | ||
**/vendor/alva-analyze.js | ||
**/vendor/alva-analyze.js.map | ||
*.log | ||
.DS_Store | ||
.static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
// @ts-check | ||
module.exports = { | ||
preset: "ts-jest", | ||
testMatch: ["**/*.test.ts", "**/*.test.tsx"], | ||
preset: 'ts-jest', | ||
testMatch: ['**/*.test.ts', '**/*.test.tsx'], | ||
modulePathIgnorePatterns: ['<rootDir>\/packages\/core\/nccbuild\/(.*)'], | ||
roots: [ | ||
"packages/core", | ||
"packages/essentials", | ||
"packages/site", | ||
"packages/tools" | ||
], | ||
testPathIgnorePatterns: [ | ||
"node_modules", | ||
"lib" | ||
'packages/analyzer', | ||
'packages/components', | ||
'packages/core', | ||
'packages/essentials', | ||
'packages/message', | ||
'packages/model', | ||
'packages/model-tree', | ||
'packages/site', | ||
'packages/tools', | ||
'packages/types', | ||
'packages/util' | ||
], | ||
testPathIgnorePatterns: ['node_modules', 'lib'], | ||
globals: { | ||
"ts-jest": { | ||
diagnostics: false | ||
'ts-jest': { | ||
diagnostics: { | ||
ignoreCodes: [151001, 2339] | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env node | ||
require('../lib/bin/analyze'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@meetalva/analyzer-cli", | ||
"version": "1.0.0", | ||
"description": "Derive component meta data and bundles from React projects", | ||
"bin": { | ||
"alva-analyze": "./bin/analyze" | ||
}, | ||
"scripts": { | ||
"check:dependencies": "alva-dependencies -i typescript-eslint-parser" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/meetalva/alva.git" | ||
}, | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Meet Alva Team", | ||
"url": "https://meetalva.io/" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://meetalva.github.io/", | ||
"bugs": { | ||
"url": "https://github.com/meetalva/alva/issues" | ||
}, | ||
"devDependencies": { | ||
"@meetalva/tools": "1.0.0" | ||
}, | ||
"dependencies": { | ||
"@meetalva/analyzer": "1.0.0", | ||
"@meetalva/model": "1.0.0", | ||
"@meetalva/types": "1.0.0", | ||
"@types/node": "^10.12.18", | ||
"yargs-parser": "10.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import * as Fs from 'fs'; | ||
import * as Path from 'path'; | ||
import * as Util from 'util'; | ||
import * as Model from '@meetalva/model'; | ||
import * as Analyzer from '@meetalva/analyzer'; | ||
import * as Types from '@meetalva/types'; | ||
|
||
const yargsParser = require('yargs-parser'); | ||
const writeFile = Util.promisify(Fs.writeFile); | ||
|
||
async function main() { | ||
const flags = yargsParser(process.argv.slice(2)); | ||
|
||
const missing = ['in', 'out'].filter( | ||
flag => !flags.hasOwnProperty(flag) || typeof flags[flag] !== 'string' | ||
); | ||
|
||
const analyzeBuiltins = flags.hasOwnProperty('builtins') ? flags.builtins : false; | ||
|
||
if (missing.length > 0) { | ||
console.error(`missing required flags: ${missing.map(m => `--${m}`).join(', ')}`); | ||
process.exit(1); | ||
} | ||
|
||
const cwd = flags.cwd || process.cwd(); | ||
const path = Path.resolve(cwd, flags.in); | ||
const outPath = flags.out ? Path.resolve(cwd, flags.out) : ''; | ||
const analysis = await Analyzer.analyze(path, { analyzeBuiltins }); | ||
|
||
if (analysis.type === Types.LibraryAnalysisResultType.Error) { | ||
console.trace(analysis.error); | ||
process.exit(1); | ||
return; | ||
} | ||
|
||
const project = Model.Project.create({ name: 'Project', draft: true, path: 'project' }); | ||
const library = Model.PatternLibrary.fromAnalysis(analysis.result, { | ||
project, | ||
analyzeBuiltins, | ||
installType: Types.PatternLibraryInstallType.Local | ||
}); | ||
|
||
await writeFile( | ||
outPath, | ||
`export const analysis = ${JSON.stringify(library.toJSON(), null, ' ')}` | ||
); | ||
} | ||
|
||
main().catch(err => { | ||
throw err; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"references": [ | ||
{ | ||
"path": "../analyzer" | ||
}, | ||
{ | ||
"path": "../types" | ||
}, | ||
{ | ||
"path": "../model" | ||
} | ||
], | ||
"compilerOptions": { | ||
"composite": true, | ||
"outDir": "lib", | ||
"skipLibCheck": true, | ||
"lib": ["es2017"], | ||
"experimentalDecorators": true, | ||
"moduleResolution": "node", | ||
"module": "commonjs", | ||
"rootDir": "src", | ||
"target": "es2017", | ||
"jsx": "react", | ||
"strict": true, | ||
"sourceMap": true, | ||
"declarationMap": true | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './lib'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./lib'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "@meetalva/analyzer", | ||
"version": "1.0.0", | ||
"description": "Derive component meta data and bundles from React projects", | ||
"scripts": { | ||
"check:dependencies": "alva-dependencies -i typescript-eslint-parser" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/meetalva/alva.git" | ||
}, | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Meet Alva Team", | ||
"url": "https://meetalva.io/" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://meetalva.github.io/", | ||
"bugs": { | ||
"url": "https://github.com/meetalva/alva/issues" | ||
}, | ||
"devDependencies": { | ||
"@meetalva/tools": "1.0.0" | ||
}, | ||
"dependencies": { | ||
"@meetalva/types": "1.0.0", | ||
"@meetalva/util": "1.0.0", | ||
"@types/lodash": "4.14.107", | ||
"@types/node": "^10.12.18", | ||
"@types/npm-package-arg": "^6.1.0", | ||
"@types/webpack": "^4.4.21", | ||
"lodash": "4.17.5", | ||
"memory-fs": "0.4.1", | ||
"npm-package-arg": "^6.1.0", | ||
"pacote": "^9.4.0", | ||
"precinct": "5.0.1", | ||
"read-pkg": "3.0.0", | ||
"resolve-pkg": "^1.0.0", | ||
"resolve": "1.8.1", | ||
"semver": "^5.6.0", | ||
"ts-simple-ast": "20.0.0", | ||
"tslib": "1.9.0", | ||
"typescript-eslint-parser": "^21.0.2", | ||
"typescript": "3.2.2", | ||
"unionfs": "^3.0.2", | ||
"uuid": "3.2.1", | ||
"webpack": "^4.28.2" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7a4a4a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployed at: https://alva-commits-7a4a4.surge.sh