Using Sencha Touch 1, I am having to manually create my app.jsb3 file (and add all linked JavaScript files to that .jsb3 file) in order to use jsbuilder to minify all files.
Anybody know the correct syntax to allow use of a wildcard (.*) (referred to as a Filter) in order to easily include all files in a folder?
I know the docs here: http://dev.sencha.com/deploy/JSBuilder2/JSB2FileFormat.txt
state that ".*" can be used - but I've had no joy:
"files": [
{"path": "views/", "name": "file1.js"},
{"path": "views/", "name": "file2.js"}, // currently manually adding each file
...
{"path": "views/", "name": ".*"}, // include all?
{"path": "views/.*"}, // include all?
]
The docs only show filters in relation to listing resources, but not also for listing files - may be why!
Related
I have an ExtJS package with the following structure:
Package
classic
resrouces
file.json
When I build the app with the package in production mode, the file.json is missing.
How can I get the build to include the resources from classic directory (within a package)?
EDIT
Adding the following to package.json enables copying files from both toolkit specific and shared resources directory.
"resource": {
"paths": [
"${package.dir}/resources",
"${package.dir}/${toolkit.name}/resources"
]
},
However, all the files (from classic/resources/ and resources/) are copied to the same directory (build/production/AppName/classic/resources/PackageName/) and if same filename exists in both directories, one file overwrites the other in the build directory.
build/production/AppName/classic/resources/PackageName/some_resource_file.json
How can they be separated so both files exists in the build?
In your main project folder, you have the file app.json, where you can define which directories should be copied when building the project and a rule for skipping some of them:
{
"production": {
"output": {
"resources": "resources",
// ...
},
},
"resources": [{
"path": "resources", // in your case classic/resources
"output": "shared"
}],
/**
* File / directory name pattern to ignore when copying to the builds. Must be a
* valid regular expression.
*/
"ignore": [
"(^|/)CVS(/?$|/.*?$)"
]
}
I've created my app the normal way with cmd in ext 5 and what I had done was simply put my css files (in the index.html file) and when I would run sencha app build my styles word override the ones in ext (that is things like the body tag).
Now, I've recreated my ext project with cmd again from scratch, copied in my app.js and app folder and it works but it seems that my app flashes my body tag but then it goes away and the standard css takes over.
That is, in my in my index.html I have the lines:
<link href="/Content/Styles/scrum-style.css" rel="stylesheet" type="text/css"/>
<link href="/Content/Styles/SessionSchedule.css" rel="stylesheet" type="text/css"/>
***Added Note:
After reading, I've copied the css from the two files into /sass/etc/all.scss and that pushed the css into the top of the generated file but it still seems to be overridden.
(also posted to sencha forums yesterday but got no response so trying here)
You could try adding them to app.json:
"css": [
{ "path": "Content/Styles/scrum-style.css" },
{ "path": "Content/Styles/SessionSchedule.css" },
{
// this entry uses an ant variable that is the calculated
// value of the generated output css file for the app,
// defined in .sencha/app/defaults.properties
"path": "${build.out.css.path}",
"bundle": true,
"exclude": ["fashion"]
}
],
Or you could load them remotely:
"css": [
{ "path": "Content/Styles/scrum-style.css", "remote": true },
{ "path": "Content/Styles/SessionSchedule.css", "remote": true },
{
// this entry uses an ant variable that is the calculated
// value of the generated output css file for the app,
// defined in .sencha/app/defaults.properties
"path": "${build.out.css.path}",
"bundle": true,
"exclude": ["fashion"]
}
],
But add them to "resources": [] as well to copy them on build.
There are 2 ways to include external CSS files in your application.
You can add references in index.html file. In this case after build you need to manual copy CSS files in build application resources folder.
You can add reference in app.json file in css array and build app. In this case if you do change in css file , you need to build app.
How would I get SublimeLinter to lint a file such as .babelrc (json or js). The "lint this view" option is greyed out.
Here's my user config: https://gist.github.com/86355281aca4d4fba941
SublimeLinter linters only work on files that have a defined syntax applied, which is recognized by the linter via the "syntax_map" setting and the syntax variable assigned in the linter's linter.py file. So, for example, SublimeLinter-eslint defines syntax as ('javascript', 'html', 'javascriptnext', 'javascript (babel)', 'javascript (jsx)', 'jsx-real'), meaning it will only work on files whose syntax maps to one of those values. Unfortunately, there is no setting in SublimeLinter that allows you to pass a list of file extensions to be linted; everything works by syntax.
The long and short of it is that you'll need to assign a JavaScript syntax to each file you want to lint. This is pretty straightforward: just open a .babelrc file, change the syntax to JavaScript, then select View -> Syntax -> Open all with current extension as... -> JavaScript -> JavaScript. This will create a file JavaScript.sublime-settings in your Packages/User directory with the following contents:
{
"extensions":
[
"babelrc"
]
}
You can then edit this file and add any other extensions you wish, and when you open them in Sublime they'll automatically be assigned the JavaScript syntax, and you'll be able to lint them.
Using CMD from within Sencha Architect I've been able to build a production build of my application. However I can not seem to figure out how to exclude a js file from the build process. I don't want it compiled in with app.js I want it as a separate script include in index.html - so cmd shouldn't touch it basically.
Sencha Arhitech generates and calls build.xml which calls build-impl.xml which calls init-impl.xml
Everywhere I've read, they say to include the following;
<target name="-before-init">
<echo>Setting build.operations...</echo>
<echo>app.dir=${app.dir}</echo>
<property name="build.operations">
exclude
-file=\resources\js\version.js
</property>
</target>
However it refuses to exclude the file...I can see the echos so I know it's hitting the target..
Any ideas? Is this how I am supposed to exclude files?
app.framework.version=4.2.1.883
app.cmd.version=4.0.4.84
Turns out this won't be possible to do until Sencha Architect 3.1
Steps by which i was able to exclude AppConfig file in production build.
Here file exclude means it will not be compressed/bundled and variable/properties of this file could be used any where in the app.
1. Config file(AppConfig.js in our case) MUST be inside resources fodler. Below are the contents of our AppConfig file
/////////////IxDetect is my Application Namespace///////////////////
var IxDetect = IxDetect || {};
IxDetect.AppConfig = {
logoPath: '',
logoTitle: 'Internal',
pentahoUrl: 'http://107.20.104.150/pentaho',
pentahoRptCube: 'TrafficWithFraudIndex'
};
////////////////////////////////
2. Link this file in index.html page like below
<script src="resources/AppConfig.js"></script>
3. Add one more item in "js" array in "app.json" file
"js": [
{
"path": "resources/AppConfig.js", // This is my file. Also make a sure you do not miss bundle and includeInBundle property
"bundle": false,
"includeInBundle": true
},
{
"path": "app.js",
"bundle": true
}
],
4. Try development and production build all should work file
Note: All above changes are done and tested on 6.2(Framework/CMD)
I must be having a bad search day, but I can't find any information about how to customize Sublime Text 2 so that toggle comment works correctly for windows batch files (i.e. adding either a REM or :: to the beginning of a line). Any help?
You can create a plugin or a macro to do it. Perhaps a snippet already exists but i have not found it.
I will try to explain the "create macro" alternative.
Create a macro with this code (save it in Packages/User, with name what-you-want.sublime-macro):
[
{"command": "split_selection_into_lines"},
{"command": "move_to", "args": {"to": "hardbol", "extend": false}},
{"command": "insert", "args": {"characters": "REM "}}
]
Now you can use it. Select the lines to comment and execute the macro.
You can also bind the macro to a key. Add in "Key Bindings - User" this key binding:
{ "keys": ["alt+."], "command": "run_macro_file",
"args": {"file": "Packages/User/what-you-want.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.dosbatch" }
]
}
The "selector" key in the "context" ensures that this key is only mapped when in batch files ("source.dosbatch").
References:
Banish Repetitive Tasks with Sublime Text 2 Macros
Key binding context to only react on e.g. Python code