@@ -39,7 +39,7 @@ import { upgrade_008_to_009 as upgrade_call_python_function_008_to_009 } from '.
3939import * as workspaces from '../blocks/utils/workspaces' ;
4040
4141export const NO_VERSION = '0.0.0' ;
42- export const CURRENT_VERSION = '0.0.9 ' ;
42+ export const CURRENT_VERSION = '0.0.10 ' ;
4343
4444export async function upgradeProjectIfNecessary (
4545 storage : commonStorage . Storage , projectName : string ) : Promise < void > {
@@ -93,6 +93,11 @@ export async function upgradeProjectIfNecessary(
9393 // @ts -ignore
9494 case '0.0.8' :
9595 await upgradeFrom_008_to_009 ( storage , projectName , projectInfo ) ;
96+
97+ // Intentional fallthrough after case '0.0.9'
98+ // @ts -ignore
99+ case '0.0.9' :
100+ await upgradeFrom_009_to_0010 ( storage , projectName , projectInfo ) ;
96101 }
97102 await storageProject . saveProjectInfo ( storage , projectName ) ;
98103 }
@@ -193,6 +198,12 @@ function noPreupgrade(moduleContentText: string): string {
193198 return moduleContentText ;
194199}
195200
201+ /**
202+ * Upgrade function that makes no changes.
203+ */
204+ function noUpgrade ( _workspace : Blockly . Workspace ) {
205+ }
206+
196207async function upgradeFrom_000_to_001 (
197208 _storage : commonStorage . Storage ,
198209 _projectName : string ,
@@ -298,3 +309,15 @@ async function upgradeFrom_008_to_009(
298309 anyModuleType , upgrade ) ;
299310 projectInfo . version = '0.0.9' ;
300311}
312+
313+ async function upgradeFrom_009_to_0010 (
314+ storage : commonStorage . Storage ,
315+ projectName : string ,
316+ projectInfo : storageProject . ProjectInfo ) : Promise < void > {
317+ // Starting in 0010, Components are saved with args instead of ports.
318+ await upgradeBlocksFiles (
319+ storage , projectName ,
320+ anyModuleType , storageModuleContent . preupgrade_009_to_0010 ,
321+ noModuleTypes , noUpgrade ) ;
322+ projectInfo . version = '0.0.10' ;
323+ }
0 commit comments