I was trying sencha 6.5, I've created a package using
sencha generate package DemoPkg
This has created a package for me, but I do not find directories for classic and modern inside it. Did anyone faced this issue? Any suggestion or help on this will be much appreciated.
As per sencha guide the structure of package should have following structure,
packages/
local/
foo/ # Top-level folder for the package
.sencha/
package/
sencha.cfg # Sencha Cmd configuration for this package
build-impl.xml # Generated build script for package
plugin.xml # Sencha Cmd plugin for this package
codegen.json # Data to support 3-way merge in code generator
classic/ # Classic toolkit-specific src code
examples/ # Example applications demonstrating the package
licenses/ # License agreement
modern/ # Modern toolkit-specific src code
overrides/ # Folder for automatically activated overrides
resources/ # Static resources (typically has images folder)
sass/ # Container for styling code
etc/ # General, non-component oriented styling
example/ # - internal use
src/ # Style rules named by component
var/ # Variables and mixins named by component
src/ # Folder for normal JavaScript code
build.xml # Build script (called by `sencha package build`)
package.json # Package descriptor
Readme.md # High-level information about this package
Sencha CMD will not generate the toolkit folders as mentioned in the docx and there is no options to do it, only we can mention the toolkit type for theme package. so we need to manually create the folders similar to universal app(both classic & modern) and update the package.json with path ${toolkit.name} like below
"resources": [
{
"path": "resources"
},
{
"path": "${toolkit.name}/resources"
}
],
"sass": {
"namespace": "UniversalPkg",
"etc": [
"${package.dir}/sass/etc/all.scss",
"${package.dir}/${toolkit.name}/sass/etc/all.scss"
],
"var": [
"${package.dir}/sass/var/all.scss",
"${package.dir}/sass/var",
"${package.dir}/${toolkit.name}/sass/var/all.scss",
"${package.dir}/${toolkit.name}/sass/var"
],
"src": [
"${package.dir}/sass/src",
"${package.dir}/${toolkit.name}/sass/src"
]
},
"classpath": [
"${package.dir}/src",
"${package.dir}/${toolkit.name}/src"
],
"overrides": [
"${package.dir}/overrides",
"${package.dir}/${toolkit.name}/overrides"
],
Related
I have a file that i need compulsory to make my application work,i am able to use the file in development by specifying fixed path var path = process.cwd() + '/src/app/components/task/Scripts'; and the file name after that,but after packaging the app i want to move the file i need in extraResources folder in system from where i will be able to use it let path = pathPackage.join(process.resourcesPath, 'extraResources');,i am using electron-forge maker to produce a production build exe,how ever there is no extraResources folder created after installing the exe,i am specifying it in package.json file
"build": {
"extraResources": [
"./extraResources/**"
]
},
Can someone provide a solution for it,i have tested all examples but none of them worked
As it mentions in the documention (actual options documented here), you can add files using the extraResource option of the packagerConfig configuration.
extraResource
extraResource: string | string[]
One or more files to be copied directly into the app's
Contents/Resources directory for macOS target platforms, and the
resources directory for other target platforms. The resources
directory can be referenced in the packaged app via the
process.resourcesPath value.
For example, in your package.json file:
{
"config": {
"forge": {
"packagerConfig": {
"extraResource": [
"./src/extraResources/file.txt",
"./src/extraResources/folder"
]
}
}
}
}
The files will be placed in the process.resourcesPath directory when running npm run package.
I setup a repo for a custom Nx builder and schematics to build an application / init. Initially I developed it in the tools/schematics folder and everything was working, but decided it should live in its own repo. I made sure to add the schematics (collection.json) and builders (builders.json) to the package.json, and setup the two files. Everything up to there seems to be working. I used yarn link to add the schematics to my nx monorepo (so I don't have to push it repeatedly while testing), and then try to add an app with nx g nx-name:app but I keep getting an error that it is unable to find the module for the schematic.
I have tried a lot before posting this. Renaming files. Using index.ts. Reinstalling node_modules. Re-linking in yarn.
Error:
Cannot find module 'C:\...\monorepo\node_modules\nx-name\src\schematics\application\application'
Require stack:
- C:\...\monorepo\node_modules\#angular-devkit\schematics\tools\export-ref.js
- C:\...\monorepo\node_modules\#angular-devkit\schematics\tools\index.js
- C:\...\monorepo\node_modules\#nrwl\workspace\src\command-line\workspace-schematic.js
- C:\...\monorepo\node_modules\#nrwl\workspace\src\command-line\nx-commands.js
- C:\...\monorepo\node_modules\#nrwl\workspace\index.js
- C:\...\monorepo\node_modules\#nrwl\cli\lib\init-local.js
- C:\...\monorepo\node_modules\#nrwl\cli\bin\nx.js
- C:\...\AppData\Roaming\npm\node_modules\#nrwl\cli\bin\nx.js
My collection.json:
{
"name": "nx-name",
"version": "0.0.1",
"extends": [
"#nrwl/workspace"
],
"schematics": {
"init": {
"factory": "./src/schematics/init/init",
"schema": "./src/schematics/init/schema.json",
"description": "Initialize the plugin",
"aliases": [
"ng-add"
],
"hidden": true
},
"application": {
"factory": "./src/schematics/application/application",
"schema": "./src/schematics/application/schema.json",
"description": "Create an application",
"aliases": [
"app"
]
}
}
}
My folder structure:
- src
- builders
- build
- build.impl.ts
- schema.json
- schematics
- application
- files
- a bunch of template files
- application.ts
- schema.d.ts
- schema.json
- init
- init.ts
- schema.d.ts
- schema.json
- .gitignore
- builders.json
- collection.json
- package.json
- tsconfig.json
- index.ts
- yarn.lock
Update:
Pointing the collection factories to the dist folder seems to run it partially? JSON files update, but the builder doesn't run and generate files from the templates. Maybe there is something I need to setup so that it knows to build the typescript source?
Adding package.json deps:
"dependencies": {
"#angular-devkit/architect": "^0.803.21",
"#angular-devkit/core": "8.3.14",
"#angular-devkit/schematics": "8.3.14",
"shelljs": "^0.8.3",
"typescript": "~3.5.3"
},
"devDependencies": {
"#nrwl/workspace": "^8.9.0",
"#types/node": "^13.1.4",
"#types/shelljs": "^0.8.6"
}
Turns out I was outputting the typescript builds to a dist folder. Don't do that or it breaks all the paths for the collection.json and any files used for templates. Just build the js files in the same locations as the ts files.
I am trying to use the .jsx file type and have created a custom .babelrc file as per the Next.js documentation (see below). https://github.com/zeit/next.js#customizing-babel-config
{
"plugins": [
["transform-react-jsx", {
"extensions": [".jsx"]
}]
],
"presets": [
"next/babel"
]
}
However with the above .babelrc file I receive the following error:
Can someone point me in the direction as to what I am doing wrong to get jsx files to load properly?
Cheers,
Stefan
Next.js has support for .jsx files out of the box. There should be no need to customize your .babelrc, so you can either use the default one or just delete it altogether.
Make sure you are running the latest version of Next.js, and possibly delete the node_modules and the .next folder in your project directory. Then install the dependencies again & build.
In my app.json I defined resources like the following :
"resources": [
"resources/images",
"resources/icons",
"resources/startup"
],
Instead of just creating a directory resources in the build folder and copying the inner folders (images, icons, startup)... the build creates another folder resources inside of the original resources folder, and the hierarchy becomes like this :
resources/resources/images
resources/resources/icons
resources/resources/startup
Where could be the problem ? Can I specify a custom resources folder for the build ?
You need to upgrade sencha cmd to version 5.0.2 or higher.
$ sencha upgrade
(source)
http://www.sencha.com/forum/showthread.php?290725-Sencha-Cmd-5.0.1-copies-resources-to-a-wrong-path
How added my-custom.css file in app.json or bootstrao.json files
app,json
{
"name": "My App",
"requires": [
],
"id": "166372b1-e416-4921-8ef2-2495765b9d76"
}
bootstrap.json
/**
* This file is generated by Sencha Cmd and should NOT be edited. It is a
* combination of content from app.json, and all required package's package.json
* files. Customizations should be placed in app.json.
*/
{"id":"166372b1-e416-4921-8ef2-2495765b9d76","js":[],"css":[]}
I think you're asking about adding CSS files to your application's app.json file. Basically, you need to add the following section to app.json then run sencha app build (which will update bootstrap.json for you).
"css": [
{
"path": "resources/css/my-styles.css"
}
],
However, a project initialized with Sencha Cmd would've had this section with helpful comments. Take a few minutes to become more familiar with Sencha Cmd and how you can use that to manage your project's files and build process:
http://docs.sencha.com/cmd/4.0.0/#!/guide/command_app_ext42