refactor: use external compiler package#952
refactor: use external compiler package#952janvennemann wants to merge 20 commits intotidev:nextfrom
Conversation
man, this was ugly
New dependencies added: alloy-compilerAuthor: Axway Appcelerator Description: Compiler for Alloy components Homepage: https://github.com/appcelerator/alloy-devkit/tree/develop/packages/alloy-compiler#readme
|
| Created | 4 months ago |
| Last Updated | 3 days ago |
| License | Apache-2.0 |
| Maintainers | 1 |
| Releases | 7 |
| Direct Dependencies | @babel/code-frame, chmodr, colors, fs-extra, global-paths, jsonlint, lodash, moment, resolve and xmldom |
| Keywords | alloy, common and utils |
README
alloy-utils
Alloy utility library
Installation
npm i alloy-utilsUsage
const {
utils, // Utility functions
logger, // Alloy logger
constants, // Constants used in Alloy
platforms, // Platform information
tiapp, // Utils to work with tiapp.xml
tssGrammar // TSS grammar defintion
} = require('alloy-utils');strip-ansi
Author: Sindre Sorhus
Description: Strip ANSI escape codes from a string
Homepage: https://github.com/chalk/strip-ansi#readme
| Created | over 6 years ago |
| Last Updated | 6 months ago |
| License | MIT |
| Maintainers | 2 |
| Releases | 16 |
| Direct Dependencies | ansi-regex |
| Keywords | strip, trim, remove, ansi, styles, color, colour, colors, terminal, console, string, tty, escape, formatting, rgb, 256, shell, xterm, log, logging, command-line and text |
README
strip-ansi 
Strip ANSI escape codes from a string
Install
$ npm install strip-ansi
Usage
const stripAnsi = require('strip-ansi');
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'strip-ansi for enterprise
Available as part of the Tidelift Subscription.
The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
Related
- strip-ansi-cli - CLI for this module
- strip-ansi-stream - Streaming version of this module
- has-ansi - Check if a string has ANSI escape codes
- ansi-regex - Regular expression for matching ANSI escape codes
- chalk - Terminal string styling done right
Maintainers
ewanharris
left a comment
There was a problem hiding this comment.
Generally looks good, some comments but only the version number comment is required. Incredible work @janvennemann!
Moving on to do some more thorough testing
| path.join(paths.resources, titaniumFolder, 'alloy'), | ||
| { rootDir: paths.project, restrictionPath: restrictionPath } | ||
| // NOTE: copies `alloy-utils/lib/constants.js` into `<project-dir>/Resources/<platform>/alloy` | ||
| U.copyFileSync( |
There was a problem hiding this comment.
I don't think it's a huge deal as it's only the constants file, but we'd lose the restrictionPath filtering by just using copyFileSync here
| }); | ||
| let finalCode = code; | ||
| const relativeOutfile = path.relative(compileConfig.dir.project, componentOutputPath); | ||
| if (compileConfig.sourcemap !== false) { |
There was a problem hiding this comment.
Note to self to check debugging in studio/vscode
| }); | ||
| } | ||
|
|
||
| // TODO: Remove once @titanium-sdk/babel-preset-app is in place |
There was a problem hiding this comment.
Is this an ALOY ticket to handle, or will it be done at the SDK level?
JIRA: https://jira.appcelerator.org/browse/ALOY-1725
This rips out everything that is relating to compiling Alloy components and moves it into a new package. The goal is to get a reusable compiler package that can be used across different projects. A first example of this is the alloy-loader.
Overview of the changes this PR contains:
mobilewebas a platform.